Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Once you have a syntax error in spack.yaml, you can't use 'spack config edit' to fix it. #41470

Open
3 tasks done
pbisbal1 opened this issue Dec 6, 2023 · 0 comments
Open
3 tasks done
Labels
bug triage The issue needs to be prioritized

Comments

@pbisbal1
Copy link

pbisbal1 commented Dec 6, 2023

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:
    - '%gcc@11.3.1

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 report and 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
@pbisbal1 pbisbal1 added bug triage The issue needs to be prioritized labels Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage The issue needs to be prioritized
Projects
None yet
Development

No branches or pull requests

1 participant