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.

[question] Why requirement overridden by conanfile.txt does not affect package id?

See original GitHub issue

I have the following conanfile.txt:

[requires]
boost/1.75.0-crypto1#4a232389c0e69e97cd1ba355746f3240
folly/2021.05.17.00#22a858c5a5f37e56090a4fe7ff253130

When I run conan install conanfile.txt here is what I see:

Requirements
    boost/1.75.0-crypto1 from local cache - Cache
    folly/2021.05.17.00 from local cache - Cache
Packages
    boost/1.75.0-crypto1:5192f911b1d09eae3e8ed7d7ccb33c7e49d1a208 - Cache
    folly/2021.05.17.00:9e1fadd5f24432ec43e01f6416e3ea0a3d6121dc - Download

WARN: folly/2021.05.17.00: requirement boost/1.75.0 overridden by your conanfile to boost/1.75.0-crypto1 

And let’s take a look at the selected folly package:

$ conan search folly/2021.05.17.00@
Existing packages for recipe folly/2021.05.17.00:

    Package_ID: 9e1fadd5f24432ec43e01f6416e3ea0a3d6121dc
        [options]
            fPIC: True
            shared: False
        [settings]
            arch: x86_64
            build_type: Release
            compiler: clang
            compiler.cppstd: 20
            compiler.libcxx: libstdc++11
            compiler.version: 12
            os: Linux
        [requires]
            boost/1.75.0:5192f911b1d09eae3e8ed7d7ccb33c7e49d1a208
            <other reqs>
        Outdated from recipe: False

Conan aknowledged that I am using custom boost version 1.75.0-crypto1, but it uses folly package built against a different boost version 1.75.0! Why is that so? I would expect folly to be rebuilt with my version of boost.

I can see how packages for both boost/1.75.0-crypto1 and boost/1.75.0 have the same package id. I assume this is ok since they are using the same settings, options and requires. But they have different version, which should affect requries for folly yielding different package ids for builds against boost/1.75.0-crypto1 and boost/1.75.0.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
memshardedcommented, Jun 15, 2022

Hi @mmatrosov

Good question. We already have a draft exactly about this, we are currently working on. It is a complicated to explain proposal, hopefully it will be ready in a couple of days, keep tuned to the tribe repo.

1reaction
memshardedcommented, Oct 1, 2021

Hi @mmatrosov

This happens, because the default package_id_mode regarding dependencies is semver_direct_mode. So a package like folly will not produce a new package_id unless the dependencies bumped to the major version. That was designed following the semver specification, which happened to be not that good for C++ binaries versioning. We have allowed to change and configure the default_package_id_mode to use more restrictive policies, try to change it (the only caveat is that ConanCenter binaries are built with the default, when changing this, you will need to build the binaries from source, because different package_id will be computed)

Read more comments on GitHub >

github_iconTop Results From Across the Web

override requirements in conan install · Issue #2140
The override information might not be reflected on the package at all, it depends on the package_id() details, but the idea is that...
Read more >
conan install — conan 1.44.1 documentation
Installs the requirements specified in a recipe (conanfile.py or conanfile.txt). It can also be used to install a concrete package specifying a reference....
Read more >
Defining Package ABI Compatibility
When this package is installed by a conanfile.txt, another package ... This package_id() method can be overridden to control the package ID generation....
Read more >
Defining Package ABI Compatibility
When this package is installed by a conanfile.txt, another package conanfile.py, ... unrelated_mode() : Requirements do not change the package ID.
Read more >
conanfile.txt — conan 1.53.0 documentation
root_package (Optional, Defaulted to all packages in deps): fnmatch pattern of the package name (“OpenCV”, “Boost”) from which files will be copied. folder:...
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