Skip to content

Support for banning writing to ~/.spack #26833

@mathstuf

Description

@mathstuf

Summary

Maybe this is already possible, but it seems that -C scopes are always read-only (ImmutableConfigScope), so I haven't found a way to provide a custom writeable scope.

Rationale

On CI machines that are not containerized (e.g., macOS, Windows), ensuring the CI jobs stay in a specific directory is key to keeping machines "clean". I'd like to tell Spack "never write to ~/.spack" and have it write its configurations elsewhere. Rewriting HOME is a sledgehammer that may have other unintended side effects (e.g., other tools not finding their configurations which are treated as read-only).

Description

Some way to add in a writeable scope at a higher precedence level than the user store. Maybe --config-scope-write or something?

Additional information

$ bin/spack --version
0.16.3-4938-e7c7f44bb6

General information

  • I have run spack --version and reported the version of Spack
  • I have searched the issues of this repo and believe this is not a duplicate

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA feature is missing in Spack

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions