-
Notifications
You must be signed in to change notification settings - Fork 427
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
Add python (et al.) to used variants even if only referenced via special selectors #5139
base: main
Are you sure you want to change the base?
Conversation
faeaf00
to
ba7463e
Compare
Signed-off-by: Marcel Bargull <[email protected]>
Signed-off-by: Marcel Bargull <[email protected]>
f5eab4d
to
d424837
Compare
Signed-off-by: Marcel Bargull <[email protected]>
d424837
to
bfd39c5
Compare
I didn't really see a place where selector<->variant interactions are addressed. |
Hi there, thank you for your contribution! This pull request has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs. If you would like this pull request to remain open please:
NOTE: If this pull request was closed prematurely, please leave a comment. Thanks! |
1 similar comment
Hi there, thank you for your contribution! This pull request has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs. If you would like this pull request to remain open please:
NOTE: If this pull request was closed prematurely, please leave a comment. Thanks! |
Not stale. |
Description
Package-dependent special selectors like
py
and similar are hard-coded to be always available no matter ifpython
etc. are actually recognized as used variant variables.This is problematic since the values of those selectors are not well-defined in case the associated package is not pinned down as variant.
E.g., for a list of variants with different
python
versions, thepy
selector can be any of those versions and is in fact non-deterministically chosen in the current implementation.We have instances in the ecosystem where a multi-output recipe does not have a dependency on
python
but someskip: true # [py ...]
selector is used, as in; e.g., see conda-forge/conda-smithy#1782 and the linked recipes in there.
There are multiple ways to argue about this:
py
withoutpython
at the top level.py
(etc.) selectors should only be defined if the corresponding packages are used.Re. 1.: Yes, the recipe could be amended to have
skip: true # [python and py<39]
or move theskip
line to each output.Regardless, having an implicit non-deterministic behavior is something we should avoid in any case.
Re. 2.: If the selectors would not be defined, the rendering could gracefully fail with an error.
Changing the code to do this could be difficult since the rendering of the current recipe format is rather convoluted.
Plus, there could be recipes that expect those selectors to always be defined, i.e., it might be more disruptive regarding backwards compatibility to remove them.
The alternative, which is implemented here, is to pull in the packages into the "used variant variables" whenever such selectors are used.
This is also a breaking change (due to potentially introducing more variants), but less disruptive as the selectors' removals but possibly (e.g., for the top-level
skip: true # [py<39]
example above) even what the user expected in the first place.N.B.: Personally, I'd consider those selectors as unnecessary tech-debt and hope the ecosystem can move off of their usage with the new recipe format which is currently worked on in the
rattler-build
project.Checklist - did you ...
news
directory (using the template) for the next release's release notes?