|
| 1 | +# Updating the E3SM Spack Fork |
| 2 | + |
| 3 | +E3SM-Unified relies on a custom fork of Spack to build performance-critical |
| 4 | +software components that are not managed by Conda. This fork includes |
| 5 | +specialized packages (e.g., `moab`, `tempestremap`, `esmf`) and system-aware |
| 6 | +configurations to support a wide range of HPC environments. |
| 7 | + |
| 8 | +This page outlines the steps for updating and managing the E3SM Spack fork |
| 9 | +during an E3SM-Unified release cycle. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Repo Location |
| 14 | + |
| 15 | +The E3SM Spack fork lives at: |
| 16 | +🔗 [https://github.com/E3SM-Project/spack](https://github.com/E3SM-Project/spack) |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Key Tasks |
| 21 | + |
| 22 | +### 1. Add or Update Package Versions |
| 23 | + |
| 24 | +You may need to: |
| 25 | + |
| 26 | +* Add new versions of packages like `nco`, `moab`, `esmf`, `tempestremap`, etc. |
| 27 | +* Update build configurations, variants, or patches |
| 28 | +* rebase onto new releases of the main [spack repo](https://github.com/spack/spack) |
| 29 | + |
| 30 | +Follow Spack’s standard packaging conventions. Builds will typically be tested |
| 31 | +as part of E3SM-Unified deployment (or deployment of Polaris or Compass), so |
| 32 | +no other testing is typically necessary or practical. |
| 33 | + |
| 34 | +After changes are validated, push them to the appropriate branch or branches |
| 35 | +(see next section). |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +### 2. Create `spack_for_mache_<version>` Branches |
| 40 | + |
| 41 | +The main development branch on E3SM's spack for is `develop`. Each release of |
| 42 | +`mache` also references a specific Spack branch named: |
| 43 | + |
| 44 | +``` |
| 45 | +spack_for_mache_<version> |
| 46 | +``` |
| 47 | + |
| 48 | +Example: |
| 49 | + |
| 50 | +``` |
| 51 | +spack_for_mache_1.32.0 |
| 52 | +``` |
| 53 | + |
| 54 | +To create one from a local clone of the E3SM spack repo: |
| 55 | + |
| 56 | +```bash |
| 57 | +git checkout develop |
| 58 | +git checkout -b spack_for_mache_1.32.0 |
| 59 | +git push origin spack_for_mache_1.32.0 |
| 60 | +``` |
| 61 | +This ensures that the version of `mache` used for deployment has a stable and |
| 62 | +reproducible Spack reference. During development of a `mache` version, this |
| 63 | +also let you make potentially breaking changes to `spack_for_mache_<version>` |
| 64 | +for testing without breaking the `develop` branch. (Make sure to always push |
| 65 | +your changes to `origin` so they are available during E3SM-Unified deployment.) |
| 66 | + |
| 67 | +**Note**: Your `spack_for_mache_<version>` branch name should not include |
| 68 | +`rc<n>` even if you are testing a release candidate of `mache` as part of your |
| 69 | +E3SM-Unified deployment. The deployment scripts automatically strip off the |
| 70 | +`rc<n>` part when determining the name of the appropriate spack branch. |
| 71 | + |
| 72 | +Once you have a relatively stable `spack_for_mache_<version>` branch, you can |
| 73 | +push the changes you have made to `develop` so they are available for future |
| 74 | +`mache` versions and other users of E3SM's spack fork. |
| 75 | + |
| 76 | +```bash |
| 77 | +git checkout develop |
| 78 | +git reset --hard spack_for_mache_1.32.0 |
| 79 | +git push origin develop |
| 80 | +``` |
| 81 | +Please be careful not to use `git push --force` here. You should only be |
| 82 | +adding new commits, not changing the history of `develop`. |
| 83 | + |
| 84 | +### 3. Rebasing `develop` onto Spack Releases |
| 85 | + |
| 86 | +One important maintenance task for the E3SM Spack fork is to keep it up-to-date |
| 87 | +with the [main Spack repo](https://github.com/spack/spack). This requires |
| 88 | +interactively rebasing the `develop` branch onto the release, interactively |
| 89 | +selecting only commits authored within the E3SM Spack fork (i.e., excluding |
| 90 | +upstream Spack commits), and troubleshooting any merge conflicts that arise. |
| 91 | + |
| 92 | +Because this will involve a force-push, it is important to coordinate with |
| 93 | +other users of the fork. Make an issue similar to |
| 94 | +[this exampe](https://github.com/E3SM-Project/spack/issues/36) and ping |
| 95 | +relevant developers to arrange a good time for the update. |
| 96 | + |
| 97 | +```bash |
| 98 | +git checkout develop |
| 99 | +git remote add spack/spack [email protected]:spack/spack.git |
| 100 | +git fetch --all -p |
| 101 | +git rebase -i spack/spack/v0.23.1 |
| 102 | +# edit the list of commits so the first is "Add v2.1.0 to v2.1.6 to TempestRemap" |
| 103 | +git push --force origin develop |
| 104 | +``` |
| 105 | + |
| 106 | +You may wish to perform the rebase using a new branch (e.g., |
| 107 | +`rebase-onto-v0.23.1`) that you can point to in the issue you post to |
| 108 | +coordinate with other developers. This way, you can ask for guidance if you |
| 109 | +are unsure about the way you resolved any merge conflicts that arose. |
| 110 | + |
| 111 | +--- |
| 112 | + |
| 113 | +## Best Practices |
| 114 | + |
| 115 | +* Keep `develop` clean and stable — avoid experimental changes |
| 116 | +* Use branches to track specific `mache` releases |
| 117 | +* Coordinate with other E3SM package maintainers when rebasing the `develop` |
| 118 | + branch or updating shared packages |
| 119 | + |
| 120 | +--- |
| 121 | + |
| 122 | +➡ Next: [Updating `mache`](mache-updates.md) |
0 commit comments