-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ninja: allow any MSVC runtime when consuming ninja #1985
Conversation
All green in build 1 (
|
This is touching the same issue as cmake: #1783 (review) Why disable a perfectly working configuration in a recipe? |
This was indeed influenced by #1783. The original issue that one was trying to solve was removing the dependency on the debug runtime for tools. It sounds like this is a deeper issue with how conan/CCI handles tools, so we may just want to cut the if statement out altogether. |
I didn't understand how this could solve the problem. The settings is solved before running build(), it should result in the same result. |
It does not change anything for building ninja, but it allows consumers to use an existing ninja binary regardless of compiler.runtime |
Context: I use conan-qt - my build options mean that I need ninja during the build of conan-qt - that worked until the change was made, now I can't build: |
This is totally aligned with this issue (conan-io/conan#6952), we are aware of the problem, but we don't know how to fix it yet. We would like to know that the recipe won't build in advance... but meanwhile, raising in the |
This PR is moving the Here in CCI this trick works because we are iterating first the profiles with MT, so profiles with MD are discarded (they compute the same package-id). Otherwise, we would get an error in the |
It fixes the vast majority of users which will just reuse ninja binary downloaded from conan-center (which includes 99.99% of CI setups). But I acknowledge that it does not fix MSVC users which force rebuilding ninja from sources. This PR requires these users to set compiler.runtime=MT when forcing ninja build from source, but grants the use of ninja to everyone without having to redistribute msvc runtime. |
@jgsogo @ericLemanissier Maybe a recipe should be able to set a default configuration, when used as a build requirement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation, now it makes sense
@jgsogo @uilianries @danimtb |
There is an internal issue for the CCI infrastructure. The way to go is quite straightforward, but it is not so easy to implement:
That way there is no need to block some configurations and the end user can use any profile to build the package from sources.
Totally, we will try to provide a better graph implementation for Conan 2.0.
This is more like the compatible package feature, isn't it? |
I'm thinking about a conan feature that allows a recipe to tag itself, Something like the following: class SomeProgramConan(ConanFile):
def as_build_requirement(self):
if self.settings.compiler == "Visual Studio":
self.override.settings.compiler.runtime = "MT"
self.override.settings.compiler.build_type = "Release" So let a recipe modify its own settings object. e.g. class SomeProgramConan(ConanFile):
def as_build_requirement(self):
if self.settings.compiler == "Visual Studio":
self.output.info("some_program must be built with gcc")
self.override.settings.compiler = "gcc" If conan would allow to have multiple compatible build profiles, then conan can iterate those and choose one to build this build requirement. |
Hi, IMO this is adding too much magic, recipe will be taking too many decisions without the user knowing about it. Yes, it is a problem if a recipe doesn't build with certain configuration because it will invalidate all the graph. If it is a build_requires the problem has an easy workaround: build the package first, use Another alternative would be for the user to override settings from specific packages. It is explicit, and IMO preferred from the user perspective:
There are other plans in my head (but they are not in the roadmap.... yet 😄 ). Not a solution, but it might help with some graphs: class Package(ConanFile):
def build_requirements(self):
self.build_requires("compiler/...", context="compilers")
self.build_requires("tool/...", context="helper")
... $ conan create <package> --profile:host=host --profile:compilers=xxxx --profile:helper=yyyy basically, you can use whatever identifier you want for a context and it will expand to a new graph. Maybe |
That looks nice. The future's bright! 😄 |
unfortunately this PR had zero effect because of #2049: there is no windows binary available. Why ? |
Specify library name and version: ninja/1.10.0
closes: #1831
CC @robert-shade
conan-center hook activated.