From af62a062cc18626ccf039ee5b4bef5a7d04cc118 Mon Sep 17 00:00:00 2001 From: Nathan Hanford Date: Thu, 10 Oct 2024 15:48:58 -0700 Subject: Installer: rewire spliced specs via RewireTask (#39136) This PR allows users to configure explicit splicing replacement of an abstract spec in the concretizer. concretizer: splice: explicit: - target: mpi replacement: mpich/abcdef transitive: true This config block would mean "for any spec that concretizes to use mpi, splice in mpich/abcdef in place of the mpi it would naturally concretize to use. See #20262, #26873, #27919, and #46382 for PRs enabling splicing in the Spec object. This PR will be the first place the splice method is used in a user-facing manner. See https://spack.readthedocs.io/en/latest/spack.html#spack.spec.Spec.splice for more information on splicing. This will allow users to reuse generic public binaries while splicing in the performant local mpi implementation on their system. In the config file, the target may be any abstract spec. The replacement must be a spec that includes an abstract hash `/abcdef`. The transitive key is optional, defaulting to true if left out. Two important items to note: 1. When writing explicit splice config, the user is in charge of ensuring that the replacement specs they use are binary compatible with whatever targets they replace. In practice, this will likely require either specific knowledge of what packages will be installed by the user's workflow, or somewhat more specific abstract "target" specs for splicing, to ensure binary compatibility. 2. Explicit splices can cause the output of the concretizer not to satisfy the input. For example, using the config above and consider a package in a binary cache `hdf5/xyzabc` that depends on mvapich2. Then the command `spack install hdf5/xyzabc` will instead install the result of splicing `mpich/abcdef` into `hdf5/xyzabc` in place of whatever mvapich2 spec it previously depended on. When this occurs, a warning message is printed `Warning: explicit splice configuration has caused the the concretized spec {concrete_spec} not to satisfy the input spec {input_spec}". Highlighted technical details of implementation: 1. This PR required modifying the installer to have two separate types of Tasks, `RewireTask` and `BuildTask`. Spliced specs are queued as `RewireTask` and standard specs are queued as `BuildTask`. Each spliced spec retains a pointer to its build_spec for provenance. If a RewireTask is dequeued and the associated `build_spec` is neither available in the install_tree nor from a binary cache, the RewireTask is requeued with a new dependency on a BuildTask for the build_spec, and BuildTasks are queued for the build spec and its dependencies. 2. Relocation is modified so that a spack binary can be simultaneously installed and rewired. This ensures that installing the build_spec is not necessary when splicing from a binary cache. 3. The splicing model is modified to more accurately represent build dependencies -- that is, spliced specs do not have build dependencies, as spliced specs are never built. Their build_specs retain the build dependencies, as they may be built as part of installing the spliced spec. 4. There were vestiges of the compiler bootstrapping logic that were not removed in #46237 because I asked alalazo to leave them in to avoid making the rebase for this PR harder than it needed to be. Those last remains are removed in this PR. Co-authored-by: Nathan Hanford Co-authored-by: Gregory Becker Co-authored-by: Tamara Dahlgren --- .github/workflows/valid-style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/valid-style.yml b/.github/workflows/valid-style.yml index 1e133371c0..d107fdb197 100644 --- a/.github/workflows/valid-style.yml +++ b/.github/workflows/valid-style.yml @@ -85,7 +85,7 @@ jobs: source share/spack/setup-env.sh spack debug report spack -d bootstrap now --dev - spack style -t black + spack -d style -t black spack unit-test -V import-check: runs-on: ubuntu-latest -- cgit v1.2.3-70-g09d2