-
Notifications
You must be signed in to change notification settings - Fork 990
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] Using tool_requires dependencies in source method #15152
Comments
Hi @jdent-5c2ff9e Thanks for your feedback.
So at this moment it is challenging to implement what you are trying. |
Thanks, @memsharded — that's much appreciated. |
Hi @jdent-5c2ff9e I have been working on #15153 to try to improve over this, but it is being more challenging than expected. The case of creating packages in the cache with The strong assumption that But the same assumption that For the local flow, we have proposed in the tests of the PR a possible alternative:
def layout(self):
self.folders.source = "mysrc"
bt = self.settings.get_safe("build_type") or "Release"
self.folders.generators = f"mybuild{bt}" The trick is to define a "default" for the What do you think? Do you use the local flow a lot? Does this |
Hi, @memsharded. Thanks to you and your team for looking into this so quickly! I see the logic of that technique in the In cases where we'd otherwise implement I do appreciate Conan's efforts to ensure that the output of the |
Yes, exactly. If you don't need to cover all cases (build_folder_vars, multi-config vs single-config, subproject), then hopefully the layout is just a few relatively simple lines. But if that is not the case, let us know, and we can try to think something a bit more convenient.
Thanks very much for your feedback. It is certainly sometimes extremely challenging to cover all use cases, that often even pull in completely opposite directions (in this case the multitude user errors because of conditioning |
Finally implemented in #15153, will be in next 2.0.15, thanks very much for your feedback! |
Hi @jdent-5c2ff9e The solution in #15153 for 2.0.15 has introduced some regressions. We are going to change it, and this opt-out is being changed in #15319 for 2.0.16, making it a opt-in. Youwill have to explicitly define |
Thanks for the update! The opt-in sounds good. |
What is your question?
I maintain a number of Conan packages for internal use by our team, and have recently been working to migrate them to Conan 2.x. Some of these packages have actions in their
source
method that require an external tool — for example:source
method, because each NuGet package contains a collection of binaries for every supported build configurations: the desired NuGet package is therefore the same no matter the settings of the Conan package being built, and it's redundant to fetch it again for each configuration.)I've packaged these external tools (CVS, CMake, Nuget) as
tool_requires
dependencies; this worked well under Conan 1.x.However, it seems that the changes to how
tool_requires
dependencies work in Conan 2.x mean that this is no longer possible. Specifically, now that thetool_requires
dependencies are made available via theVirtualBuildEnv
generator (which can't be called from thesource
method), I can't see a supported way to use those tools in thesource
method.The recipes do remain correct if I move these steps out of the
source
method and intobuild
, but doing so means that a lot of redundant work is repeated for each build configuration. In some cases, this increases the time taken to build a set of packages from a recipe by several hours.Is there any other way to use this
tool_requires
functionality from thesource
method in Conan 2.x?Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: