Skip to content

Update setup.sh: add export SPACK_DISABLE_LOCAL_CONFIG=true#1545

Merged
climbfuji merged 4 commits intoJCSDA:developfrom
climbfuji:feature/add_disable_local_config
Mar 7, 2025
Merged

Update setup.sh: add export SPACK_DISABLE_LOCAL_CONFIG=true#1545
climbfuji merged 4 commits intoJCSDA:developfrom
climbfuji:feature/add_disable_local_config

Conversation

@climbfuji
Copy link
Copy Markdown
Collaborator

@climbfuji climbfuji commented Mar 5, 2025

Summary

Update setup.sh: add export SPACK_DISABLE_LOCAL_CONFIG=true to completely isolate the spack-stack environments from user spack configurations. This requires additional steps to unset and restore the environment variable when creating new site configurations. Further, remove the exception for macOS (no longer needed, see #1545 (comment) below for more information)

Testing

  • Tested on NRL systems and @climbfuji's devbox
  • CI

Applications affected

None

Systems affected

"All" (not really), but at least air-gapped systems where the spack bootstrap mirror needs to be used every time from now on.

Dependencies

n/a

Issue(s) addressed

Closes #1544

Checklist

  • This PR addresses one issue/problem/enhancement, or has a very good reason for not doing so.
  • These changes have been tested on the affected systems and applications.
  • All dependency PRs/issues have been resolved and this PR can be merged.

…letely isolate the spack-stack environments from user spack configurations (JCSDA#60)
Copy link
Copy Markdown
Collaborator

@RatkoVasic-NOAA RatkoVasic-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@climbfuji
Copy link
Copy Markdown
Collaborator Author

Ooops, I remember. The problem was this didn't work for new site configs, because we use spack external find --scope=system. I will look into other options (scope=site, for example).

@climbfuji
Copy link
Copy Markdown
Collaborator Author

I fixed this in 2e91ad6, a17b244, and d42cf47 by adding one more step to the NewSiteConfig instructions (unset SPACK_DISABLE_LOCAL_CONFIG when setting SPACK_SYSTEM_CONFIG_PATH, and restoring SPACK_DISABLE_LOCAL_CONFIG when unsetting SPACK_SYSTEM_CONFIG_PATH). Same for GitHub actions CI runs.

I also removed the exception to skip avoiding ~/.spack for macOS. We needed this in the past when bootstrapping was a tedious and manual process, but fortunately this is no longer the case. I tested this on the macOS CI runner manally. Hopefully, it will work just as well in CI.

@climbfuji climbfuji requested review from eap and srherbener March 6, 2025 18:14
Copy link
Copy Markdown
Collaborator

@srherbener srherbener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good. I did not test, rather I'm relying on the CI testing and others. I like that by default user configuration is ignored for the build, and only for customized (new site config) builds you can temporarily enable user configuration. Thanks!

@climbfuji climbfuji merged commit 53f732a into JCSDA:develop Mar 7, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in spack-stack-2.0.x (2025 Q4) Mar 7, 2025
@climbfuji climbfuji deleted the feature/add_disable_local_config branch March 7, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

spack-stack environments must not depend on existing user configurations

4 participants