bugfix: config edit should work with a malformed spack.yaml

If you don't format `spack.yaml` correctly, `spack config edit` still fails and
you have to edit your `spack.yaml` manually.

- [x] Add some code to `_main()` to defer `ConfigFormatError` when loading the
  environment, until we know what command is being run.

- [x] Make `spack config edit` use `SPACK_ENV` instead of the config scope
  object to find `spack.yaml`, so it can work even if the environment is bad.

Co-authored-by: scheibelp <scheibel1@llnl.gov>
This commit is contained in:
Todd Gamblin
2021-10-28 10:46:51 -07:00
committed by Peter Scheibel
parent 374e3465c5
commit 233dabbd4f
4 changed files with 106 additions and 10 deletions

View File

@@ -49,6 +49,8 @@ fi
$coverage_run $(which spack) unit-test -x --verbose
bash "$QA_DIR/test-env-cfg.sh"
# Delete the symlink going from ./lib/spack/docs/_spack_root back to
# the initial directory, since it causes ELOOP errors with codecov/actions@2
if [[ "$COVERAGE" == "true" ]]; then