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
refactor(compilation): migrate ccache to extension; remove legacy ccache.sh
Wires the new ccache extension (extensions/ccache.sh) into the
compilation pipeline, replacing the in-core lib/functions/compilation/
ccache.sh module that was sourced unconditionally.
Changes:
- lib/functions/compilation/kernel.sh, uboot.sh: wrap the compile
pass with do_with_compile_wrapper so the new compile_wrapper_pre/
_post hooks fire around it.
- lib/functions/configuration/compilation-config.sh: dispatch
compile_prepare_vars (early phase, before any make-quoted-params
array is built) instead of inlining configure-ccache. Also clears
stale CCACHE export from a previous artifact iteration so a
second uboot/kernel call in the same shell can't reuse a now-
disabled cache. Keeps a one-shot deprecation warning if any
user-patch still sources the legacy lib.config.
- lib/functions/configuration/main-config.sh: if USE_CCACHE=yes
(or the ccache-remote extension is enabled) auto-enable the
'ccache' extension before initialize_extension_manager runs.
Honours both EXT alias and the legacy space-separated
ENABLE_EXTENSIONS form.
- lib/functions/general/extensions.sh: extract
extension_list_normalized helper used by the auto-enable shim.
- lib/functions/compilation/ccache.sh: removed (logic moved to
extensions/ccache.sh).
Behaviour is preserved for USE_CCACHE=yes (default-on for kernel/uboot
builds) and USE_CCACHE=no callers. ENABLE_EXTENSIONS=ccache-remote
implicitly pulls in ccache, matching pre-refactor coupling.
Assisted-by: Claude:claude-opus-4.7
so later array-building code captures them, and tweak PATH if a
30
+
wrapper prefix directory is needed.
31
+
COMPILE_PREPARE_VARS
32
+
33
+
# Framework-level limitation: USE_CCACHE / PRIVATE_CCACHE set in
34
+
# userpatches/lib.config (sourced after initialize_extension_manager —
35
+
# see main-config.sh:443 "too late to define hook functions or add
36
+
# extensions in lib.config") cannot auto-enable the ccache extension.
37
+
# Warn the user so they can migrate; we deliberately do not duplicate
38
+
# the env-setup logic here — it lives in extensions/ccache.sh as the
39
+
# sole owner of the ccache backend.
40
+
if [[ ("${USE_CCACHE}" == "yes"||"${PRIVATE_CCACHE}" == "yes") &&-z"${CCACHE}" ]];then
41
+
display_alert "USE_CCACHE / PRIVATE_CCACHE set, but no compile-cache extension is active" \
42
+
"likely set in userpatches/lib.config (framework limit: too late to enable extensions there). Add 'ccache' to ENABLE_EXTENSIONS / EXT in your CLI, env, or config file sourced earlier.""warn"
27
43
fi
28
44
29
45
# moved from config: this does not belong in configuration. it's a compilation thing.
@@ -36,7 +52,7 @@ function prepare_compilation_vars() {
36
52
# If CPUTHREADS is defined and a valid positive integer allow user to override CTHREADS
37
53
# This is useful for limiting Armbian build to a specific number of threads, e.g. for build servers
declare -g USE_CCACHE="${USE_CCACHE:-no}"# stop using ccache as our worktree is more effective
63
+
declare -g USE_CCACHE="${USE_CCACHE:-no}"# stop using ccache as our worktree is more effective
64
64
65
65
# Armbian config is central tool used in all builds. As its build externally, we have moved it to extension. Enable it here.
66
66
enable_extension "armbian-config"
@@ -173,7 +173,7 @@ function do_main_configuration() {
173
173
174
174
# Support for LUKS / cryptroot
175
175
if [[ $CRYPTROOT_ENABLE== yes ]];then
176
-
enable_extension "fs-cryptroot-support"# add the tooling needed, cryptsetup
176
+
enable_extension "fs-cryptroot-support"# add the tooling needed, cryptsetup
177
177
if [[ -z$CRYPTROOT_PASSPHRASE ]] && [[ -z$CRYPTROOT_AUTOUNLOCK ]];then# a passphrase is mandatory if rootfs encryption is enabled, unless CRYPTROOT_AUTOUNLOCK is wanted
178
178
exit_with_error "Root encryption is enabled but CRYPTROOT_PASSPHRASE or CRYPTROOT_AUTOUNLOCK is not set"
179
179
fi
@@ -326,14 +326,48 @@ function do_main_configuration() {
326
326
;;
327
327
esac
328
328
329
-
# enable APA extension for Debian Unstable release
329
+
# enable APA extension for Debian Unstable release
0 commit comments