You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
templates/ # Jinja2 templates for all generated files
@@ -208,7 +208,8 @@ BUILD/
208
208
packages.yaml
209
209
repos.yaml
210
210
mirrors.yaml # if --mirror provided: buildcache/sourcemirror entries
211
-
config.yaml # if --mirror provided with a sourcecache/misccache (config:source_cache/misc_cache)
211
+
config.yaml # if --mirror provided with a sourcecache (config:source_cache)
212
+
concretizer.yaml # if --mirror provided with a concretizer cache (concretizer:concretization_cache), spack >= 1.1
212
213
bootstrap.yaml # if --mirror provided with a bootstrap mirror
213
214
key_store/ # if --mirror provided with gpg keys (decoded *.gpg)
214
215
compilers/
@@ -262,8 +263,8 @@ Writes all files to the build path. Key responsibilities:
262
263
263
264
### `Mirrors` class (`mirror.py`)
264
265
A clean exemplar of the "recipe validates & renders, builder just prints" pattern. Constructed by `Recipe` from the `--mirror` file path; does ALL mirror input processing eagerly in `__init__` (loads + schema-validates `mirrors.yaml`, validates mirror urls, decodes/validates gpg keys to in-memory bytes, checks cache paths are absolute and expands env vars). Then presents pure static artifacts:
- `config_files(config_root) -> {abs_path: bytes}` — the `mirrors.yaml`, `config.yaml`, `concretizer.yaml`, `bootstrap.yaml`, and gpg key files the builder writes verbatim
267
268
- `gpg_key_paths(config_root)` and the `build_cache_mirror` / `push_to_build_cache` properties (the latter is `None` for a keyless, read-only build cache)
268
269
269
270
Mirror/cache config is supplied ONLY via `--mirror`; a `mirrors.yaml` found in the system config dir is rejected with an error (it was never a system-config artifact). Relative gpg-key paths resolve against the `--mirror` file's own directory.
@@ -310,9 +311,9 @@ Spack mirrors and caches are configured in a single `mirrors.yaml` supplied with
310
311
- **`bootstrap`** (one): for bootstrapping Spack itself (clingo etc.). The `url` is either a local `spack bootstrap mirror` directory (referenced via its own `metadata/sources`+`metadata/binaries`) or a remote url (source-only). Needs **no key** (bootstrap binaries are sha256-verified) → emitted as `config/bootstrap.yaml` (+ a generated `metadata.yaml` only for the remote case); it is NOT a `mirrors.yaml` entry.
- **`sourcecache`** (one): a writable local dir Spack fills as it fetches sources → emitted as `config:source_cache`.
313
-
- **`misccache`** (one): a writable local dir for Spack's misc cache (package/build-cache indices and the **concretization cache** that lives under it) → emitted as `config:misc_cache`. Useful to persist across ephemeral builds. Concretization caching is on by default in Spack ≥ 1.2, opt-in in 1.1.
314
+
- **`concretizer`** (one): a writable local dir persisting Spack's **concretization results** → emitted as `concretizer:concretization_cache:{enable,url}` in `config/concretizer.yaml`. Useful to persist across ephemeral builds. The config key requires Spack ≥ 1.1; Stackinator infers the Spack version from `config.yaml:spack.commit` (via `Recipe.find_spack_version`, defaulting to the latest supported version when the commit can't be pinned) and **skips the cache with a warning** for Spack 1.0 (which rejects the key).
314
315
315
-
`sourcecache`/`misccache` are emitted to `config/config.yaml`; `bootstrap` to `config/bootstrap.yaml`; `buildcache`/`sourcemirror` to `config/mirrors.yaml` (+ decoded keys under `config/key_store/`).
316
+
`sourcecache` is emitted to `config/config.yaml`; `concretizer` to `config/concretizer.yaml`; `bootstrap` to `config/bootstrap.yaml`; `buildcache`/`sourcemirror` to `config/mirrors.yaml` (+ decoded keys under `config/key_store/`).
316
317
317
318
**Legacy:** a binary cache can still be configured with a `cache.yaml` (`root` + optional `key`) passed to `-c/--cache`. This path is deprecated in favour of a `buildcache` entry and will be removed.
Copy file name to clipboardExpand all lines: docs/build-caches.md
+18-8Lines changed: 18 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ A `mirrors.yaml` can describe five kinds of entry, each optional and each docume
18
18
|[`bootstrap`](#bootstrap-mirror)| one | mirror used to bootstrap Spack itself |
19
19
|[`sourcemirror`](#source-mirrors)| many | read-only mirrors that provide package sources |
20
20
|[`sourcecache`](#source-cache)| one | writable local cache that fills with sources as you build |
21
-
|[`misccache`](#misc-cache)| one | writable local cache for Spack's indices and concretization results |
21
+
|[`concretizer`](#concretizer-cache)| one | writable local cache that persists concretization results |
22
22
23
23
A complete example:
24
24
@@ -34,8 +34,8 @@ sourcemirror:
34
34
url: https://example.com/spack-sources
35
35
sourcecache:
36
36
path: /capstor/scratch/$USER/spack-sources
37
-
misccache:
38
-
path: /capstor/scratch/$USER/spack-misc
37
+
concretizer:
38
+
path: /capstor/scratch/$USER/spack-concretizer
39
39
```
40
40
41
41
To stop using any entry, remove (or comment out) it from `mirrors.yaml`.
@@ -184,21 +184,31 @@ sourcecache:
184
184
|-------|----------|-------------|
185
185
| `path` | yes | absolute path to a local directory (environment variables are expanded) |
186
186
187
-
## Misc cache
187
+
## Concretizer cache
188
188
189
-
The misc cache is a single, **writable** local directory for Spack's "misc" cache: the package and build-cache indices, and — importantly — the **concretization cache**, which stores the result of concretizing a set of specs so it does not have to be recomputed.
189
+
The concretizer cache is a single, **writable** local directory in which Spack persists its **concretization results** — the output of concretizing a set of specs, so it does not have to be recomputed.
190
190
Concretization can be a large fraction of build time, so pointing this at a persistent location is worthwhile when build directories are ephemeral (e.g. created in `/dev/shm` and deleted after each build).
191
191
192
192
```yaml title="mirrors.yaml"
193
-
misccache:
194
-
path: /capstor/scratch/$USER/spack-misc
193
+
concretizer:
194
+
path: /capstor/scratch/$USER/spack-concretizer
195
195
```
196
196
197
197
| Field | Required | Description |
198
198
|-------|----------|-------------|
199
199
| `path` | yes | absolute path to a local directory (environment variables are expanded) |
200
200
201
-
The concretization cache lives under this directory. Spack populates it automatically: concretization caching is on by default in Spack 1.2 and later, and is opt-in (`concretizer:concretization_cache:enable`) in Spack 1.1. It is keyed by the hash of the solver inputs, so a persistent cache can be reused safely across builds — stale entries simply miss.
201
+
This emits a `concretizer.yaml` that sets `concretizer:concretization_cache:{enable: true, url}`.
202
+
The cache is keyed by the hash of the solver inputs, so it can be reused safely across builds — stale entries simply miss.
203
+
204
+
!!! warning "It does not eliminate concretization time"
205
+
The cache stores only the *result of the solve* for a given set of inputs. Before it can be consulted, Spack still has to rebuild the full concretization problem on every run — loading the package recipes and enumerating the reusable packages — and that setup work is often the larger part of concretization. So a cache hit skips the solver but not the setup: concretization gets faster, not free.
206
+
207
+
The win is therefore largest for repeated builds of the same stack against a stable build cache (the previous solve is replayed), and smallest when the bulk of concretization time is in setup. The cache never makes concretization slower.
208
+
209
+
!!! note "Requires Spack ≥ 1.1"
210
+
The `concretizer:concretization_cache` config key was introduced in Spack 1.1, and Spack 1.0 rejects it.
211
+
Stackinator infers the Spack version from the `spack.commit` in `config.yaml` (defaulting to a supported version when the commit is a branch or arbitrary SHA that cannot be pinned). When it detects Spack 1.0 it skips the concretizer cache with a warning rather than producing a config that would fail the build.
0 commit comments