question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Conan version ranges not working with loosely names packages.

See original GitHub issue

To help us debug your issue please explain:

  • I’ve read the CONTRIBUTING guide.
  • I’ve specified the Conan version, operating system version and any tool that can be relevant.
  • I’ve explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

Conan Version 1.12.2 Distributor ID: Ubuntu Description: Ubuntu 16.04.5 LTS Release: 16.04 Codename: xenial

This is a workaround for: https://github.com/conan-io/conan/issues/4600, see latest comments

Conan version ranges don’t work as expected with include_prerelease=True I’m expecting it to be able to find my latest package, but it does not.

I have the following packages on artifactory: CastleConanCommon/0.0.3@master/latest CastleConanCommon/0.0.4-3-gff22b81@master/latest The 0.0.4 is now using git describe to uniquely version every commit.

a test conanfile with

class testConanfile(ConanFile):
    name = "testConanfile"
    version = "1.0.0"
    generators = "virtualenv"
    build_requires = "CastleConanCommon/[>=0.0.4, include_prerelease=True]@master/latest"

This results in the conan install . -u to fail

# conan install . -u 
Configuration:
[settings]
arch=x86_64
build_type=Debug
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=5
os=Linux
[options]
[build_requires]
[env]

ERROR: Version range '>=0.0.4, include_prerelease=True' from requirement 'CastleConanCommon/[>=0.0.4, include_prerelease=True]@master/latest' required by 'virtual' could not be resolved

However, if I change the build_requires to build_requires = "CastleConanCommon/[>=0.0.3, include_prerelease=True]@master/latest" it works…

I’d expect that semver would recognized the first part 0.0.4-3-gff22b81 as 0.0.4 and be able to find the package.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Mark-Hatch-Bosecommented, Mar 3, 2019

@jgsogo here is the code I’m using to restructure the git tag to fit the node-semver if it’s useful for the documentation. We are using tags with vX.Y.Z pattern on our master branches. As mentioned, this was a workaround until the upcoming package revision feature is out (to enforce dependency tree rebuilds on every commit with full_package_mode). See https://github.com/conan-io/conan/issues/4600 for details.

def get_version_git_tag():
    try:
        git = tools.Git()
        gitTag = git.run("describe --tags --match 'v*.*.*' --long")
        gitTag = gitTag[1:]
        #we are renaming the package to fit prerelease versioning requirements
        gitTagRe = '([0-9]+\.[0-9]+\.[0-9]+)\-([0-9]+)\-([a-zA-Z0-9]+)'
        r = re.search(gitTagRe, gitTag)
        version = "%s-%s+%s" % (r.group(1), r.group(2), r.group(3))
        return version
    except:
        return None
0reactions
Mark-Hatch-Bosecommented, Apr 24, 2019

Updated with some testing on package revisions in https://github.com/conan-io/conan/issues/4600

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version ranges — conan 1.56.0 documentation
Version ranges ¶ · First, the local conan storage is searched for matching versions, unless the --update flag is provided to conan install....
Read more >
Conan version range not working properly - GitLab.org
Run conan remove Hello to remove local cache. Install the newly publish package using the following conanfile.txt : [requires] Hello/['>0.0.
Read more >
The Conan C++ package manager does not resolve to ...
One problem with package managers like pip is that they in part ... Instead, version ranges are evaluated when dependencies are first ......
Read more >
consuming conan latest version - Stack Overflow
Conan v.1.10 introduced two new options associated with version ranges (from the docs):. loose: to include/exclude valid semver string ...
Read more >
Package List — Spack 0.20.0.dev0 documentation
This is a list of things you can install using Spack. It is automatically generated based on the packages in this Spack version....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found