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

Environment created with a faulty spack.yaml cannot be removed with spack env rm #37502

Open
3 tasks done
greenc-FNAL opened this issue May 6, 2023 · 2 comments
Open
3 tasks done

Comments

@greenc-FNAL
Copy link
Member

Steps to reproduce

$ echo 'spookle:' > x.yaml
$ spack env create x x.yaml
==> Error: /scratch/greenc/art-ci-spack-2023-05-06/spack_env/var/spack/environments/x/spack.yaml:1: 'spookle' does not match any of the regexes: '^env|spack$'
$ spack env list
==> 1 environment
    x
$ spack env rm -y x
==> Error: /scratch/greenc/art-ci-spack-2023-05-06/spack_env/var/spack/environments/x/spack.yaml:1: 'spookle' does not match any of the regexes: '^env|spack$'
$ spack env list
==> 1 environments
    x

Error message

I would expect spack env rm to not attempt to parse the spack.yaml file before removing the environment unconditionally.

However, I'm not sure I would have expected spack env create to create and register the environment if the spack.yaml could not be parsed. Perhaps a user-provided spack.yaml should be parsed before the environment directory is created and the file copied it. Or, if we're creating an environment from an existing directory, that directory should not be registered as an environment that would then have to be removed.

Information on your system

  • Spack: 0.20.0.dev0 (1db3c3a)
  • Python: 3.9.15
  • Platform: linux-scientific7-skylake_avx512
  • 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
@greenc-FNAL greenc-FNAL added bug triage The issue needs to be prioritized commands environments labels May 6, 2023
@greenc-FNAL
Copy link
Member Author

I can take on fixing this, if there's consensus on how to proceed.

@alalazo alalazo added impact-low and removed triage The issue needs to be prioritized labels Jun 6, 2023
@white238
Copy link
Contributor

I hit this today. It should just remove the file imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

3 participants