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

concretize.lp: fix issue with reuse of conditional variants #43676

Merged
merged 4 commits into from Apr 16, 2024

Conversation

haampie
Copy link
Member

@haampie haampie commented Apr 16, 2024

Closes #43663

Currently if you request pkg +example where example is a conditional
variant, and you have a pkg in the database for which the condition
did not hold (so no +example nor ~example), the solver would reuse it
regardless, not imposing +example.

The change rules out exactly one thing: variant_set without variant_value,
which in practice could only happen when not node_has_variant (i.e. when
under the current package.py rules the variant's when condition did not
trigger).

@spackbot-app spackbot-app bot added core PR affects Spack core functionality stand-alone-tests Stand-alone (or smoke) tests for installed packages tests General test capability(ies) labels Apr 16, 2024
currently if you request `pkg +example` where `example` is a conditional
variant, and you have a `pkg` in the database for which the condition
did not hold (so no +example nor ~example), the solver would reuse it
regardless, not imposing `+example`.
@haampie haampie force-pushed the fix/reuse-variant-only-when-set branch from 6031ff7 to e7218dd Compare April 16, 2024 13:27
adamjstewart
adamjstewart previously approved these changes Apr 16, 2024
Copy link
Member

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the problem for me, thanks!

@alalazo alalazo self-assigned this Apr 16, 2024
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
@haampie haampie enabled auto-merge (squash) April 16, 2024 15:15
@haampie haampie merged commit 9ff5a30 into spack:develop Apr 16, 2024
34 of 35 checks passed
@haampie haampie deleted the fix/reuse-variant-only-when-set branch April 16, 2024 16:40
@haampie haampie added this to the v0.21.3 milestone Apr 16, 2024
tldahlgren pushed a commit to tldahlgren/spack that referenced this pull request Apr 23, 2024
)

Currently if you request pkg +example where example is a conditional
variant, and you have a pkg in the database for which the condition
did not hold (so no +example nor ~example), the solver would reuse it
regardless, not imposing +example.

The change rules out exactly one thing: variant_set without variant_value,
which in practice could only happen when not node_has_variant (i.e. when
under the current package.py rules the variant's when condition did not
trigger).
stephenmsachs pushed a commit to stephenmsachs/spack that referenced this pull request Apr 29, 2024
)

Currently if you request pkg +example where example is a conditional
variant, and you have a pkg in the database for which the condition
did not hold (so no +example nor ~example), the solver would reuse it
regardless, not imposing +example.

The change rules out exactly one thing: variant_set without variant_value,
which in practice could only happen when not node_has_variant (i.e. when
under the current package.py rules the variant's when condition did not
trigger).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core PR affects Spack core functionality stand-alone-tests Stand-alone (or smoke) tests for installed packages tests General test capability(ies)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reuse can prevent specs from concretizing
3 participants