Skip to content
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] 'shared' options in conanfile.txt are ignored in Conan2 #14919

Closed
1 task done
gouriano opened this issue Oct 12, 2023 · 1 comment
Closed
1 task done

[question] 'shared' options in conanfile.txt are ignored in Conan2 #14919

gouriano opened this issue Oct 12, 2023 · 1 comment
Assignees

Comments

@gouriano
Copy link

What is your question?

Hi
Let us say I have a conanfile.txt and want to install 'shared' packages

conan install ...  -o *:shared=True

At the same time, I want to have some of them 'static'.
In conanfile.txt I specify:

[options]
grpc*:shared=False

It worked as expected in Conan1, but it is not working in Conan2.
Conan2 still wants to install 'shared' grpc (which is not available on Windows, for example)
Is this change by design? Or, is it a bug?

Thanks

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this Oct 12, 2023
@memsharded
Copy link
Member

Hi @gouriano

Thanks for your question.
This was actually a deliberate change in Conan 2.0, to better align with the general priority rules.
In this case, the rule is that the user command line (or profile) always have the top priority. If the command line says that all packages must be shared, then all packages must be shared. No way that some conanfile in the graph can tell something different. This was done to give real control to the user/consumer, otherwise there were situations when users wanted to define something in the dependency graph, like actually making sure that all libs are shared, and they couldn't do it because some recipe in the middle was saying otherwise. Conan 2.0 new behavior respects better the principle that "final users should always have full control".

Said that, we have this ticket #14764, to investigate if we could have some other intermediate or compromise way that allows both full user control but also giving some more space for conanfile to define dependencies options.

So Conan 2.0 recommended approach would be to define grpc*:shared=False in the command line (or much better, in a profile file).

As #14764 already captures this issue, I'd suggest closing this one and following up on the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants