Skip to content

Replace spack branch spack-stack-dev with authoritative develop branch - #2217

Open
climbfuji wants to merge 6 commits into
JCSDA:developfrom
climbfuji:feature/spack-submodule
Open

climbfuji wants to merge 6 commits into
JCSDA:developfrom
climbfuji:feature/spack-submodule

Conversation

@climbfuji

@climbfuji climbfuji commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Use of generative AI

Please refer to our temporary spack-stack AI policy for further information.

  • I confirm that this contribution was submitted by a real person. If AI tools or agents were used in its preparation, I have personally reviewed and take responsibility for all submitted content, code, and proposed changes. This contribution is not autonomously generated by AI.

Description

This PR replaces our spack branch spack-stack-dev in https://github.com/jcsda/spack with the authoritative develop branch in the mothership repo https://github.com/spack/spack. The commit used here is spack/spack@ab3f3ac from about 3 weeks ago (for no other reason than me starting this work three weeks ago).

Switching from our fork/branch to the authoritative code means that the following customizations are no longer in the spack code.

  • Spack container recipe modifications. These can be dropped, because we no longer build containers with spack containerize thanks to @eap's work - containers are now ordinary site configurations that are deployed like any other site.
  • Environment variables <case-preserving-package-name>_ROOT in auto-generated Spack modulefiles. Spack by default uppercases the package name. We've advocated for a long time to preserve the case, because this is what CMake expects. The Spack developers didn't want to make this change. With the help of GPT-5.6 Sol Gov, I came up with an elegant solution that uses Jinja template modifications of the Spack module templates. I am crediting GPT for the solution, but I reviewed it and understand it, and it's great in my opinion.
  • Use of our fork/branch of spack-packages submodule as Git submodule instead of silently cloning the authoritative spack-packages repository, and addition of our own spack-stack packages. This is done in the source setup.sh step.

Additional changes were required because of upstream changes in the Spack engine:

  • spack.config.CONFIG is now a singleton with its own memory/cache that replaces spack.config.
  • Activating environments in our Spack extension works slightly differently.
  • spack.llnl.util is now spack.util.
  • The syntax to permit deprecated packages has changed.
  • The concretizer produced duplicate py-setuptools-scm packages for cylc-dev, this is resolved by pinning the package to earlier versions @:7 for cylc-dev only (other environments all use @8.2.1 without having to pin it).
  • Note that the argument to spack.cmd.require_active_env is required, but it doesn't seem to make any difference what the value is as long as the command exists.
  • Also note that the lmod module directory tree now uses the 7-digit hash for the MPI provider - this required a small update to spack stack setup-meta-modules.

I also updated and tested most of the utilities in ./util, as well as the NRL batch install script. For the latter, no changes were required - which means that likely no changes are required for the GMAO and EPIC batch install scripts.

[dev@lt-hein01 spst-spack-submodule]$ ls -1 util/
acorn                         # ignored
check_permissions.sh          # updated and tested
compilers                     # no changes needed
epic                          # ignored
fetch_cargo_deps.py           # updated and tested
fetch_go_deps.py              # updated and tested
get_version_list.sh           # STILL TODO
gmao                          # ignored
install_rust.sh               # no changes needed
ldd_check.py                  # no changes needed
modules_config_check.py       # updated and tested
parallel_install.sh           # ignored
show_duplicate_packages.py    # updated and tested
util_tests.sh                 # updated and tested
weekly_build                  # ignored

Dependencies

None.

We should freeze/lock the spack-stack-dev branch in https://github.com/jcsda/spack after merging this PR and adding a README.md to the branch to document the change.

Issues addressed

Closes #2218

Applications affected

None - as long as the implementation is correct, nothing will change downstream.

Systems affected

None - as long as the implementation is correct, nothing will change downstream.

Testing

  • CI: Note whether the automatic tests (GitHub actions tests that run automatically for every commit) pass or not
    • GitHub actions CI tests pass
    • GitHub actions CI tests do not pass (provide explanation)
    • GitHub actions CI tests skipped (provide explanation if necessary)
  • New tests added: List and describe any new tests added to GitHub actions
    • ...
  • Additional testing: Add information on any additional tests conducted
    • Build the NEPTUNE environment on my dev box, build NEPTUNE and run basic tests - this covers tcl environment modules
    • Build the NEPTUNE environment on Atlantis (an lmod system), build NEPTUNE + workflow and run end-to-end tests.

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.
  • All necessary updates to the documentation (spack-stack wiki) will be made when this PR is merged done

@climbfuji climbfuji self-assigned this Dec 2, 2026
@climbfuji
climbfuji marked this pull request as ready for review December 3, 2026 17:48
@climbfuji climbfuji moved this from Todo to In Progress in spack-stack-2.3.x (2027 Q1) Dec 3, 2026
f.write(packages_definition)

# Clear the spack config cache
spack.config.CONFIG.clear_caches()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is required because spack.config.CONFIG is a singleton with its own memory.

@climbfuji climbfuji mentioned this pull request Dec 4, 2026
5 of 11 tasks

@AlexanderRichert-NOAA AlexanderRichert-NOAA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is great!

@climbfuji

climbfuji commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator Author

@AlexanderRichert-NOAA @mathomp4 I had to push a small bug fix for spack stack setup-meta-modules, because the lmod module directory tree now uses the 7-digit hash for the MPI provider.

It's harmless and only affects the auto-generated MODULEPATH addition to find the modules for packages that depend on the (one and only) MPI provider. See b255701.

@climbfuji
climbfuji force-pushed the feature/spack-submodule branch from 9d30701 to b255701 Compare December 4, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Replace jcsda/spack spack-stack-dev with authoritative spack/spack develop code

4 participants