override requirements in conan install
See original GitHub issueIn the docs you explain requirement overriding. I guess that can be used to handle diamond dependency conflicts. You force existing packages to use different versions of their requirements.
But what if a library needs to be rebuilt to correctly use different versions of its requirements? We would need to create different packages of that library. We can handle that by adding an option and using conditional requirements in the conanfile. Wouldn’t it be nice to be able to override the requirements the same way you override options and settings in the conan install command? Someting like:
conan install . --requires="LibA/0.1@demo/testing"
Issue Analytics
- State:
- Created 6 years ago
- Reactions:14
- Comments:33 (16 by maintainers)
Top Results From Across the Web
Installing dependencies — conan 1.45.0 documentation
You can specify multiple requirements and override transitive “require's requirements”. In our example, Conan installed the Poco package and all its ...
Read more >Overriding profile settings in Conan - Stack Overflow
Conan install a package based on your profile, thus, it doesn't matter if you are on Windows or Linux. You can override your...
Read more >CONAN CHEAT SHEET - JFrog
conan config install <url>. Change a single config value ... Install requirements and generate files. $ mkdir build && cd build. $ conan...
Read more >Installing Conan dependencies | Software Architecture with C++
By default, Conan wants to download all the dependencies as prebuilt binaries. If the server doesn't have them prebuilt, Conan will build them...
Read more >Conan packages in the Package Registry - GitLab Docs
To publish Conan packages to the Package Registry, add the Package ... At the root of your project, create a build directory and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would say that overriding without validating fits our use case better. We would e.g. like to overwrite a version of
dep/1.0.0@user/stableordep/[^1.0.0]@user/stablewithdep/1.1.0@user/stableordep/master@user/testing.Yes, the override is hard, as long as the package name is the same, the rest of the reference will be overriden.
It also applies to transitive dependencies, yes, once a version is overriden it is overriden for the graph, not only for the declaring override consumer.
Not sure what is the
requirementhook (https://docs.conan.io/en/latest/reference/hooks.html#hooks-reference), so can’t say about this.Yes, this is the behavior 👍