diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2019-10-22 23:50:31 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2019-10-23 06:29:49 -0700 |
commit | af65146ef69fcde10d53b2ee12f82a9c28361e23 (patch) | |
tree | 8e3ed60856b662694ba1d1bb7b154e65fcb8126a /.gitlab-ci.yml | |
parent | b3f5084b96f1458e5ec041f197e0b0dabbc0ecff (diff) | |
download | spack-af65146ef69fcde10d53b2ee12f82a9c28361e23.tar.gz spack-af65146ef69fcde10d53b2ee12f82a9c28361e23.tar.bz2 spack-af65146ef69fcde10d53b2ee12f82a9c28361e23.tar.xz spack-af65146ef69fcde10d53b2ee12f82a9c28361e23.zip |
Preserve comments for Spack YAML objects (#11602)
This updates the configuration loading/dumping logic (now called
load_config/dump_config) in spack_yaml to preserve comments (by using
ruamel.yaml's RoundTripLoader). This has two effects:
* environment spack.yaml files expect to retain comments, which
load_config now supports. By using load_config, users can now use the
':' override syntax that was previously unavailable for environment
configs (but was available for other config files).
* config files now retain user comments by default (although in cases
where Spack updates/overwrites config, the comments can still be
removed).
Details:
* Subclasses `RoundTripLoader`/`RoundTripDumper` to parse yaml into
ruamel's `CommentedMap` and analogous data structures
* Applies filename info directly to ruamel objects in cases where the
updated loader returns those
* Copies management of sections in `SingleFileScope` from #10651 to allow
overrides to occur
* Updates the loader/dumper to handle the processing of overrides by
specifically checking for the `:` character
* Possibly the most controversial aspect, but without that, the parsed
objects have to be reconstructed (i.e. as was done in
`mark_overrides`). It is possible that `mark_overrides` could remain
and a deep copy will not cause problems, but IMO that's generally
worth avoiding.
* This is also possibly controversial because Spack YAML strings can
include `:`. My reckoning is that this only occurs for version
specifications, so it is safe to check for `endswith(':') and not
('@' in string)`
* As a consequence, this PR ends up reserving spack yaml functions
load_config/dump_config exclusively for the purpose of storing spack
config
Diffstat (limited to '.gitlab-ci.yml')
0 files changed, 0 insertions, 0 deletions