Skip to content

Commit 11408b3

Browse files
Remove the unreliable APT cache steps :D FOR FIUTURE builds
1 parent 590388e commit 11408b3

1 file changed

Lines changed: 29 additions & 34 deletions

File tree

โ€Ž.github/workflows/build.ymlโ€Ž

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,25 @@ permissions:
1414
# CACHING ARCHITECTURE
1515
# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1616
#
17-
# Layer 1 โ”‚ APT packages โ”‚ apt-kernel-build-v1
18-
# โ”‚ โ”‚ Saves ~30s of apt-get install per run
19-
#
20-
# Layer 2 โ”‚ ccache โ”‚ ccache-<os>-<ver>-<cfg>-<patches>-<run_id>
21-
# โ”‚ โ”‚ KEY BUG FIX: always save a NEW key per run
22-
# โ”‚ โ”‚ so restore-keys always finds the freshest
17+
# Layer 1 โ”‚ ccache โ”‚ ccache-<os>-<ver>-<cfg>-<patches>-<run_id>
18+
# โ”‚ โ”‚ Always saves a NEW key per run so
19+
# โ”‚ โ”‚ restore-keys always finds the freshest
2320
# โ”‚ โ”‚ partial cache, never a stale pinned key.
2421
# โ”‚ โ”‚ SLOPPINESS + DIRECT mode = max hit rate.
2522
#
26-
# Layer 3 โ”‚ Source tarball โ”‚ kernel-tarball-<version>
23+
# Layer 2 โ”‚ Source tarball โ”‚ kernel-tarball-<version>
2724
# โ”‚ โ”‚ Immutable. Downloaded once, cached forever.
2825
#
29-
# Layer 4 โ”‚ Full build tree โ”‚ kernel-tree-<ver>-<cfg>-<patches>
26+
# Layer 3 โ”‚ Full build tree โ”‚ kernel-tree-<ver>-<cfg>-<patches>
3027
# โ”‚ โ”‚ Exact match = zero rebuild (incremental make).
3128
# โ”‚ โ”‚ Partial match via restore-keys still helps.
3229
# โ”‚ โ”‚ Saved unconditionally after every build.
3330
#
31+
# NOTE: APT package caching is intentionally omitted. actions/cache cannot
32+
# reliably handle /var/cache/apt glob paths or /var/lib/apt/lists โ€” the key
33+
# never matches on restore, producing "Cache not found" noise on every run
34+
# with zero benefit. apt-get install is fast enough (~30s) on its own.
35+
#
3436
# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
3537

3638
jobs:
@@ -134,17 +136,10 @@ jobs:
134136
echo "KBUILD_BUILD_TIMESTAMP=$(date -u -d "@$SOURCE_DATE_EPOCH" '+%a %b %e %H:%M:%S UTC %Y')" >> "$GITHUB_ENV"
135137
echo "KBUILD_BUILD_VERSION=${GITHUB_RUN_NUMBER}" >> "$GITHUB_ENV"
136138
137-
# โ”€โ”€ Layer 1: APT cache โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
138-
- name: Restore APT cache
139-
id: apt-cache
140-
uses: actions/cache@v4
141-
with:
142-
path: |
143-
/var/cache/apt/archives/*.deb
144-
/var/lib/apt/lists
145-
key: apt-kernel-build-v1
146-
restore-keys: apt-kernel-build-
147-
139+
# โ”€โ”€ APT: no caching โ€” actions/cache cannot reliably handle system paths
140+
# (/var/cache/apt glob and /var/lib/apt/lists vary per runner, causing
141+
# permanent "Cache not found" noise with zero restore benefit).
142+
# apt-get install is fast enough (~30s) without a cache layer.
148143
- name: Install build dependencies
149144
run: |
150145
sudo apt-get update -qq
@@ -156,7 +151,7 @@ jobs:
156151
# Put ccache shims first so 'gcc' resolves to ccache transparently
157152
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
158153
159-
# โ”€โ”€ Layer 2: ccache (restore) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
154+
# โ”€โ”€ Layer 1: ccache (restore) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
160155
# Use cache/restore (not cache) so we can save a fresh key after build.
161156
# Primary key includes run_id so we ALWAYS write a new entry, and
162157
# restore-keys fan out from most- to least-specific for the best warmup.
@@ -175,7 +170,7 @@ jobs:
175170
- name: Zero ccache stats (for clean per-run reporting)
176171
run: ccache --zero-stats
177172

178-
# โ”€โ”€ Layer 3: Source tarball โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
173+
# โ”€โ”€ Layer 2: Source tarball โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
179174
- name: Restore kernel source tarball
180175
id: kernel-tarball
181176
uses: actions/cache@v4
@@ -191,7 +186,7 @@ jobs:
191186
"https://cdn.kernel.org/pub/linux/kernel/v${KERNEL_VERSION}.x/sha256sums.asc"
192187
grep "linux-${FULL_VERSION}.tar.xz" sha256sums.asc | sha256sum -c -
193188
194-
# โ”€โ”€ Layer 4: Build tree (restore) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
189+
# โ”€โ”€ Layer 3: Build tree (restore) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
195190
# Exact hit = incremental make (only changed files recompile).
196191
# Partial hit = more ccache warmup, still much faster than cold.
197192
- name: Restore build tree
@@ -214,17 +209,18 @@ jobs:
214209
XZ_OPT="-T0" tar -xf "linux-${FULL_VERSION}.tar.xz" \
215210
-C kernel --strip-components=1
216211
212+
# โ”€โ”€ Configure โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
213+
# LOCALVERSION passed to olddefconfig so it's baked into autoconf.h,
214+
# keeping the value consistent across configure + build (ccache needs
215+
# the same preprocessed output both times).
217216
# โ”€โ”€ Patches โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
218217
# MUST run before Configure: the rtl8192eu patch adds new Kconfig
219218
# entries that olddefconfig must see to resolve CONFIG_RTL8192EU.
220219
#
221220
# Cache-aware: a sentinel file (.patches-applied) records the hash of
222-
# the patch set that was applied to this tree. If the restored build
223-
# tree already carries the correct patches (exact or partial cache hit
224-
# with identical PATCHES_HASH) we skip re-application entirely โ€”
225-
# avoiding "file already exists" / reverse-patch failures.
226-
# When PATCHES_HASH changes the cache key changes too, so a fresh tree
227-
# is extracted and the sentinel will not be present.
221+
# the patch set applied to this tree. If a restored build tree already
222+
# carries the correct patches we skip re-application โ€” avoiding
223+
# "file already exists" / reverse-patch failures on cache hits.
228224
- name: Apply patches
229225
working-directory: kernel
230226
run: |
@@ -243,14 +239,13 @@ jobs:
243239
# โ”€โ”€ Configure โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
244240
# Runs after patches so new Kconfig symbols (e.g. CONFIG_RTL8192EU)
245241
# are visible to olddefconfig and get resolved to their defaults.
246-
# LOCALVERSION passed here so it's baked into autoconf.h, keeping the
247-
# value consistent across configure + build (ccache needs the same
248-
# preprocessed output both times).
242+
# LOCALVERSION is baked into autoconf.h here, keeping it consistent
243+
# across configure + build so ccache gets maximum hit rate.
249244
- name: Configure kernel
250245
working-directory: kernel
251246
run: |
252247
cp ../hyperion.config .config
253-
make olddefconfig LOCALVERSION="-Hyperion-${HYPERION_VER}"
248+
make olddefconfig LOCALVERSION="-Hyperion-${HYPERION_VER}"
254249
255250
# โ”€โ”€ Build โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
256251
# -pipe: use pipes instead of temp files between compiler passes
@@ -269,7 +264,7 @@ jobs:
269264
if: always()
270265
run: ccache --show-stats --verbose
271266

272-
# โ”€โ”€ Layer 4: Build tree (save) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
267+
# โ”€โ”€ Layer 3: Build tree (save) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
273268
# Always save so the next run gets the freshest incremental state.
274269
# If key already exists GitHub skips the upload silently.
275270
- name: Save build tree
@@ -279,7 +274,7 @@ jobs:
279274
path: kernel
280275
key: kernel-tree-${{ env.FULL_VERSION }}-${{ env.CONFIG_HASH }}-${{ env.PATCHES_HASH }}
281276

282-
# โ”€โ”€ Layer 2: ccache (save) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
277+
# โ”€โ”€ Layer 1: ccache (save) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
283278
# Save even on build failure so a partial run still warms future runs.
284279
- name: Save ccache
285280
if: always()

0 commit comments

Comments
ย (0)