Skip to content

Make stage use concrete specs from environment#22320

Merged
becker33 merged 3 commits intospack:developfrom
haampie:fix-stage-for-environments
Mar 29, 2021
Merged

Make stage use concrete specs from environment#22320
becker33 merged 3 commits intospack:developfrom
haampie:fix-stage-for-environments

Conversation

@haampie
Copy link
Copy Markdown
Member

@haampie haampie commented Mar 16, 2021

Same as in #21642, the idea is that
we want to easily stage a package that fails to build in a complex
environment. Instead of making the user create a spec by hand (basically
transforming all the rules in the environment manifest into a spec,
defying the purpose of the environment...), use the provided spec as a
filter for the already concretized specs. This also speeds up things,
cause we don't have to reconcretize.

pinging @scheibelp and @becker33

@haampie haampie closed this Mar 17, 2021
@haampie haampie reopened this Mar 17, 2021
@haampie haampie force-pushed the fix-stage-for-environments branch from 5c2f4b8 to d04c6c6 Compare March 17, 2021 10:23
Copy link
Copy Markdown
Member

@becker33 becker33 left a comment

Choose a reason for hiding this comment

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

This needs a test. Otherwise LGTM

@haampie
Copy link
Copy Markdown
Member Author

haampie commented Mar 26, 2021

Okay, I don't know how to test this other than mocking do_stage. Let me know if you want something better (and how).

haampie added 3 commits March 29, 2021 11:27
Same as in spack#21642, the idea is that
we want to easily stage a package that fails to build in a complex
environment. Instead of making the user create a spec by hand (basically
transforming all the rules in the environment manifest into a spec,
defying the purpose of the environment...), use the provided spec as a
filter for the already concretized specs. This also speeds up things,
cause we don't have to reconcretize.
@haampie haampie force-pushed the fix-stage-for-environments branch from 079c0b6 to c0e7464 Compare March 29, 2021 09:32
Comment on lines +19 to +31
def test_stage_spec(monkeypatch):
"""Verify that staging specs works."""

expected = set(['trivial-install-test-package', 'mpileaks'])

def fake_stage(pkg, mirror_only=False):
expected.remove(pkg.name)

monkeypatch.setattr(spack.package.PackageBase, 'do_stage', fake_stage)

stage('trivial-install-test-package', 'mpileaks')

assert len(expected) == 0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's a fun way of mocking this test to only test the command, not the underlying functionality. +1

@becker33 becker33 merged commit e89c9ec into spack:develop Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants