-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Once you have a syntax error in spack.yaml, you can't use 'spack config edit' to fix it. #41470
Description
Steps to reproduce
Edit spack.yaml, with 'spack config edit', like leaving off a closing quote, or listing the same package twice in the packages section. For example:
@alalazo
spack:
definitions:
- core_compiler:
- '%[email protected]
Save file and then try to edit again with 'spack config edit'. This will fail with the error below.
Error message
==> Error: Invalid environment configuration detected: error parsing YAML: near /usr/lynx/spack/stacks/lynx/spack.yaml, 9, 7: found character '%' that cannot start any token
While it's great to check the YAML files for valid syntax before parsing them, the commands used to edit those YAML files should not fail because of bad syntax, as that means we now have to call our editor directly with the path to the YAML file in order to correct this problem, when we should be able to use spack edit config to fix these issues.
Ideally, the syntax checker should run after we save changes to these files so that we catch errors immediately after editing them and can the run spack edit again to fix.
Prentice
Information on your system
- Spack: 0.22.0.dev0 (88e738c)
- Python: 3.9.16
- Platform: linux-rhel9-zen2
- Concretizer: clingo
General information
- I have run
spack debug reportand reported the version of Spack/Python/Platform - I have searched the issues of this repo and believe this is not a duplicate
- I have run the failing commands in debug mode and reported the output
Metadata
Metadata
Assignees
Labels
Type
Projects
Status