summaryrefslogtreecommitdiff
path: root/.github/images/linux-ci/README.md
blob: 29a94eee5d594e4bea5d2c6000664eeb20d695a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Linux CI images

WSJT-X publishes five private, single-platform build environments to GHCR:

| Package | Platform | CI consumers |
| --- | --- | --- |
| `wsjtx-internal/linux-noble` | `linux/amd64` | Normal and ASan/UBSan |
| `wsjtx-internal/linux-tsan-noble` | `linux/amd64` | TSan |
| `wsjtx-internal/linux-arm64-bookworm` | `linux/arm64` | aarch64 |
| `wsjtx-internal/linux-armhf-cross-bookworm` | `linux/amd64` | Native armhf cross-build |
| `wsjtx-internal/linux-armv7-bookworm` | `linux/arm/v7` | armhf tests and packaging under QEMU |

The normal images contain the compiler, development and packaging closure, and
the slow-moving pFUnit and Hamlib prefixes. The TSan image instead contains the
pinned, instrumented Qt, Boost, and Hamlib tuple. The armhf cross-builder pairs
a native x86-64 GCC 13.4 cross-toolchain with a Debian Bookworm armhf sysroot;
its runtime partner contains only the target execution and packaging closure.
WSJT-X objects and binaries are never baked into these images.

The Ubuntu and GCC base tags intentionally follow their maintained upstream
security updates. Each published generation records the resolved package set,
compiler identity, dependency pins, and recipe fingerprint. Normal-image
promotion is gated by image construction, the image-level checks, and a full
WSJT-X build using the exact immutable candidate. That build also publishes the
candidate generation's ccache snapshot before `stable` moves. TSan publication
is an explicit image cohort and verifies its pinned closure during the image
build; the current code-level TSan suite is not part of image promotion.

## Publication

`publish-linux-ci-images.yml` pushes unique candidate and immutable `build-*`
tags for the selected image cohort. Each Docker build verifies the image
manifest, dependency metadata, and a representative compile/link smoke test.
Before a normal candidate is promoted, the standard x64 WSJT-X build and test
pipeline runs against its exact `build-*` tag and saves a generation-specific
ccache archive. This prevents a new image from becoming stable without a cache
that pull requests can restore. Successful generations also receive
`validated-build-*` tags. The secondary normal-image `stable` tags move first
and `linux-noble:stable` moves last within that cohort. Consumers resolve that
pointer to its immutable `build-*` tag and use the same generation for every
normal Linux leg.

The ARMHF image pair is included when the cache-refresh workflow refreshes the
normal Linux image cohort. The pair is built, promoted, and rolled back as one
generation. Its toolchain stage is reused unless a toolchain input or the explicit
rebuild revision changes.

Opt-in full-ci, release, and standalone armhf builds resolve the last promoted
runtime generation once and require the matching cross-builder tag; a missing
member fails explicitly. Manual full-ci can instead name an immutable candidate
generation for pre-promotion acceptance testing.

The TSan workflow resolves `linux-tsan-noble:stable` independently when its
optional label is used. A missing TSan generation fails explicitly instead of
silently using the normal image. A TSan-only publication builds, promotes, or
rolls back only that package; it does not rebuild or retag normal or ARM images.

Ordinary non-TSan PR and `develop` jobs may overlap a dependency refresh. They
pin the image generation resolved at job start and allow a recipe-fingerprint
mismatch with a warning, so the last known-good stable generation remains a
usable fallback while the refresh completes. Image publication, release, and
TSan jobs keep strict fingerprint checks; if no promoted generation exists, the
resolver still fails explicitly.

The dependency refresh workflow runs image publication monthly and when image
recipes change on `develop`. Changed paths are classified from the same profile
membership used to calculate the recipe fingerprints, so normal-only and
TSan-only inputs refresh only their affected cohort while shared inputs refresh
both. The monthly refresh includes TSan; weekly and `all` refreshes omit it.
The `linux-tsan` manual target selects only TSan, while `linux` and
`linux-images` select normal and ARM64 without armhf. Use the direct publisher
workflow when explicit armhf validation is needed. A monthly epoch invalidates the
package-install layer so repository security updates are not hidden by
BuildKit's cache. The direct publisher workflow also supports
retagging a retained `validated-build-*` generation as `stable` for rollback.
Promotion and rollback are restricted to `develop`; non-promoting candidate
builds may be run from another ref.

## ARMHF toolchain reuse

The cross-builder has an independent toolchain stage pinned to a Debian Bookworm
amd64 base digest, which monthly refreshes do not update. Its inputs are the
bootstrap package recipe, apt helper, `armhf-toolchain-config.sh`, and
`armhf-cross-toolchain.config`. The final image
uses the maintained Bookworm base and refreshes host packages, the ARMHF sysroot,
and Hamlib independently. Monthly refresh epochs and full image fingerprints do
not invalidate the toolchain stage.

The ARMHF cross-builder exports intermediate layers to the `buildcache` tag in
its own GHCR package with registry `mode=max` caching. Internal and public-release
publication use their respective package namespaces for both imports and exports.
A fresh builder can therefore reuse the completed toolchain stage. Only source
archives use a local BuildKit cache mount; each actual toolchain build starts with
a clean build directory and retains its detailed failure log in the job output.

For an intentional toolchain refresh, update the pinned base digest when needed
and increment `ARMHF_TOOLCHAIN_REBUILD_REVISION` in `armhf-toolchain-config.sh`.
The revision invalidates the bootstrap package installation as well as compiler
construction. Compiler, ABI, crosstool-NG, and ct-ng configuration changes also
invalidate the relevant toolchain layers. Publish with `include_armhf: true` and
validate the resulting image pair before promoting it. Final image manifests
and compiler signatures are regenerated against the final host runtime libraries;
reusing compiler files does not bypass compatibility checks.

To validate reuse, export a baseline cache and import it into a fresh Buildx
builder after changing only the refresh epoch or a downstream dependency input.
The ct-ng build must be cached while the dependency work reruns. A changed ct-ng
configuration or rebuild revision must execute the toolchain build again. Keep
these validation publications separate from stable promotion and retain their
build logs, image verification results, and timings.

## ccache compatibility

The image recipe and ccache compatibility identities intentionally answer
different questions. The recipe and legacy `toolchain_id` describe the complete
image for verification and provenance. Actions-cache keys instead use the
architecture, sanitizer profile when applicable, a `gcc<major>-v2`
compatibility ID, and the immutable image generation.

Within that archive, ccache uses a verified content signature covering the C
and C++ drivers, GCC frontends and LTO executable, assembler, their resolved
runtime-library closure, the target, and GCC specs. Compiler changes therefore
miss safely inside the compatible archive.
Source, flags, generated sources, and included header contents retain ccache's
normal per-object invalidation. Changes to unrelated image packages do not
discard otherwise compatible objects.

A new generation first restores its own snapshot and then falls back to any
compatible older generation. The build recompiles only genuine misses and
saves an augmented generation-specific snapshot. Recipe-stale fallback builds
may restore caches but are not allowed to save them.

ARMHF warming compiles production and test targets and runs the binary audits,
then saves objects without preparing an AppDir or executing runtime tests and
packaging. Image-pair verification, including its brief QEMU checks, remains
required. The `armhf_build_only` workflow input defaults to false, preserving
full ARMHF CI; build-only cache writes require `develop`.

The cache-refresh workflow selects ARMHF weekly, for relevant build/configuration
changes on `develop`, and through its `linux-armhf` manual target. Source-only
pushes do not select it. Successful internal ARMHF image promotion warms the
exact new generation afterward; a warmer failure does not undo promotion.
Standalone and post-promotion warmers share a concurrency group, and an image
refresh suppresses duplicate standalone warming.

## Retention

The weekly retention job keeps `stable`, preserves unrecognized and untagged
versions, retains at least the newest three recognized package versions, and
deletes only recognized build, validated-build, and candidate versions older
than 60 days. Manual retention runs are dry-run only; scheduled runs apply the
printed plan. The ARMHF `buildcache` tag is protected as an unrecognized tag;
older cache manifests left untagged when it moves are also preserved.

The Buildx jobs deliberately disable provenance and SBOM attachment. Even a
single-platform attestation is represented through an image index with
untagged child manifests, which cannot be safely classified from GitHub's
package-version REST response alone.