-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Bugfix: fix sticky variants in externals #42253
Conversation
@spackbot fix style |
Let me see if I can fix that for you! |
I was able to run spack style --fix==> Running style checks on spack
selected: isort, black, flake8, mypy
==> Modified files
lib/spack/spack/solver/asp.py
lib/spack/spack/test/concretize.py
==> Running isort checks
isort checks were clean
==> Running black checks
reformatted lib/spack/spack/test/concretize.py
reformatted lib/spack/spack/solver/asp.py
All done! ✨ 🍰 ✨
2 files reformatted.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> Running mypy checks
Success: no issues found in 610 source files
mypy checks were clean
==> spack style checks were clean
I've updated the branch with style fixes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically LGTM
lib/spack/spack/test/concretize.py
Outdated
@@ -1522,6 +1522,18 @@ def test_sticky_variant_in_package(self): | |||
s = Spec("sticky-variant %clang").concretized() | |||
assert s.satisfies("%clang") and s.satisfies("~allow-gcc") | |||
|
|||
@pytest.mark.only_clingo("Original concretizer cannot use sticky variants") | |||
def test_sticky_variant_in_external(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def test_sticky_variant_in_external(self): | |
@pytest.mark.regression("42172") | |
def test_sticky_variant_in_external(self): | |
"""Tests that we can set sticky variants from an external spec.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can we test setting the sticky variant both ways + not having it?
@spackbot fix style |
Let me see if I can fix that for you! |
I was able to run spack style --fix==> Running style checks on spack
selected: isort, black, flake8, mypy
==> Modified files
lib/spack/spack/solver/asp.py
lib/spack/spack/test/concretize.py
var/spack/repos/builtin.mock/packages/sticky-variant-dependent/package.py
==> Running isort checks
isort checks were clean
==> Running black checks
reformatted lib/spack/spack/test/concretize.py
All done! ✨ 🍰 ✨
1 file reformatted, 2 files left unchanged.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> Running mypy checks
Success: no issues found in 610 source files
mypy checks were clean
==> spack style checks were clean
I've updated the branch with style fixes. |
Fixes #42172
Currently, the concretizer does not preserve information about which variants were set explicitly on externals, which leads to concretization failures when an external specifies a sticky variant. This PR fixes the generation of facts for externals to preserve that information.
Includes regression test.