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

[bug] conan list filtering option asks users to use scope patterns when those don't work in that context #16545

Closed
RubenRBS opened this issue Jun 25, 2024 · 2 comments · Fixed by #16559
Assignees

Comments

@RubenRBS
Copy link
Member

RubenRBS commented Jun 25, 2024

Describe the bug

When running conan install with the --filter-options argument, you're supposed not to scope the option. But if you do so, you get a warning like

WARN: legacy: Unscoped option definition is ambiguous.
Use '&:shared=True' to refer to the current package.
Use '*:shared=True' or other pattern if the intent was to apply to dependencies

which disappears if you use a scope, but then the filter does not work properly

How to reproduce it

No response

@RubenRBS
Copy link
Member Author

I might have missremembered and you're actually supposed to scope it with *:. Still, the point stands than then it's not intuitive and we should check if we can do something about it

@memsharded
Copy link
Member

The only test that applies is c.run(f"list *:* -fs os=Windows -fo *:shared=False --format=json {r}"), so I am not sure if the intent is not to scope options. Actually, the warnings were added with the intention to always scope options everywhere, including profiles, and also in the --filter-options. The idea is that the filter will be what you would put in a profile, and get the same warning as if you use it in a profile.

The test doing it seems to work:

c.run(f"list *:* -fs os=Windows -fo *:shared=False --format=json {r}")
, with the scope.

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

Successfully merging a pull request may close this issue.

2 participants