Skip to content

environments: only write when necessary#13546

Merged
tgamblin merged 2 commits intodevelopfrom
bugfix/env-write-empty-section
Nov 3, 2019
Merged

environments: only write when necessary#13546
tgamblin merged 2 commits intodevelopfrom
bugfix/env-write-empty-section

Conversation

@becker33
Copy link
Copy Markdown
Member

@becker33 becker33 commented Nov 1, 2019

Fixes #12313

This fixes a known bug that Spack adds keys to the environment yaml for everything left empty, filling in the default values.

Will edit with issue # of the issue this fixes once I find it.

@becker33 becker33 force-pushed the bugfix/env-write-empty-section branch from 5427c4d to 9cb3ba9 Compare November 1, 2019 20:28
Copy link
Copy Markdown
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.

I can confirm that this fixes #12313 for me!

@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented Nov 3, 2019

@becker33: this looks good to me for now. I think at a later date we should revisit the validator in spack.config and get rid of the defaults that clutter all the Spack config files. That might require rethinking more places in the Spack code, though -- I think this is well worth putting in now to make environments more usable for devs.

@tgamblin tgamblin merged commit aa7c229 into develop Nov 3, 2019
tgamblin pushed a commit that referenced this pull request Nov 3, 2019
This changes Spack environments so that the YAML file associated with the environment is *only* written when necessary (i.e., if it is changed *by spack*).  The lockfile is still written out as before.

There is a larger question here of which part of Spack should be responsible for setting defaults in config files, and how we can get rid of empty lists and data structures currently cluttering files like `compilers.yaml`.  But that probably requires a rework of the default-setting validator in `spack.config`, as well as the code that uses `spack.config`.  This will at least help for `spack.yaml`.
@adamjstewart adamjstewart deleted the bugfix/env-write-empty-section branch November 4, 2019 00:24
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.

spack concretize reorganizes spack.yaml

3 participants