-
Notifications
You must be signed in to change notification settings - Fork 981
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
[question] How to target a test package in a profile #16638
Comments
Hi @spectras Thanks for your question. Please try:
to apply the flags both to the |
This test checks the behavior: #16639 |
Thanks for the fast answer. Unfortunately, while this works fine for just one package, it does not scale to a full workflow. Here is a bit more context:
That is, it's not just one, the profile has something like: [conf]
tools.build:cxxflags=["/sdl"]
package_a/*:tools.build:cxxflags+=["/w24146"]
package_b/*:tools.build:cxxflags+=["/w24146", "/w24308"]
package_c/*:tools.build:cxxflags+=["/w14703", "/w24996"] We build packages on our CI, one job per package doing
(If curious, the |
Why not disabling |
I simplified a bit, there are more that just cxxflags, and there is more than just The job currently simply does How would I go with overriding the At this point, this would mean:
Unless I am missing a way to do that that does not imply making the job aware of the content of the profile? |
I have been trying a few things, but this seems not possible. The problem is that if you are defining per-package different Note that this is a good thing that this is not possible. If you are creating a package, lets say In general, consumers of a package should receive their necessary build information either from profiles or from the Maybe the original issue is using a configuration for dependencies like |
That's right, in the end there are 2 separate issues:
⇒ I agree, handling that on the recipe side would be ideal.
This might be an XY problem. If there is a way to pass the (I believe that means a way for the recipe to specify that some |
For the record, I also have the same issue with some other flags. For instance linker flag |
Yes, that is true, the profile always try to have higher precedence over the recipe, otherwise it would be very bad UX, the user trying to define something and being ignored by the recipe. That means that the order of flags is relevant for msvc in this case, and that defining
Why not defining |
Yes
That is a possible workaround, though a costly one. |
Hi again, I have been re-thinking this, and trying to see if there could be some other approach. My conclusions:
Trying to define that in profiles via raw
This seems indeed in the good direction, trying to provide a higher abstraction over this. Maybe the If it is a subsetting or an option, really depends on the number of packages that uses this, I think it sounds better as a subsettting, but I don't have enough knowledge of your scenario.
I don't think this would be a big issue. The The How many packages are we talking about?
would be enough? Using jinja templates it might be easy to just define lists of packages to exclude for every |
Thanks for taking the time to think about this. About the flags:
In fact, given how many flags impact the ABI, after carefully considering our options we defined: This is not ideal as any cxxflags or cflags is now part of the binary model. But it's definitely easier than altering every single recipe to add extra We also considered making those different
We did not think about a subsetting. The design intent of subsettings vs options is not really clear to us. So… so far we only introduced subsettings when they could be attached to an existing one. For instance we defined a
That's possible, but this needs to be duplicated into every profile, which is not ideal. We have… too many profiles :) At this point I don't think this deserves immediate attention. It seems this falls in a blind spot of the current model, and it would make more sense to keep this around for consideration for conan3 down the line. Zooming out, at the core, our problem is that:
In the current model, as profile always trumps package flags, the only solutions are lifting package-specific things to the profile, or implementing profile-level changes in packages, both being cumbersome and error-prone. On the other hand, maybe some form of explicit |
Many thanks for the feedback.
This sounds to me that is kind of a subsetting for the It will also avoid having to set the
But not really. Profiles admit composition via |
This was closed by #16639 The test checks basic test_package conf application, but that wasn't really enough for the above. Still, it seems that the best way to model those cases was something like a compiler subsetting to build a proper abstraction over it, so please feel free to re-open to continue the conversation, or you can always create a new ticket for any further question. Many thanks for your feedback! |
Unfortunately I did not have time to spend on this. We don't have dedicated devops people here and this happens a bit in-between, it's difficult to justify spending time on something we have a workaround for. I will re-open if/when this comes back in focus. In the perfect world this just lingers until conan3, and that hypothetical conan3 makes it moot. In the meantime, thanks for your work, conan was a cornerstone for us moving from hand-written scripts to a more declarative and reliable approach to dependencies. |
Totally understandable, don't worry about that.
Happy that Conan has been valuable to you, thanks very much for the feedback, it is really appreciated!!! 🙂 |
What is your question?
Hello,
In my profile, I need to change flags for a specific package for compatibility reasons.
I do it like this:
So far so good. The package builds correctly.
The test fails though because, using the same profile, it will not get the additional
cxxflags
asmypackage/*
is not applied to the test package afaik.Is there a way to have those flags apply when running the test package too?
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: