Skip to content

Commit 43b27d7

Browse files
committed
refactor(os): initialize production tools tree once
1 parent cf22473 commit 43b27d7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

os/mkosi/build.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ actual=$(mkosi --version | awk '{print $2}' | cut -d. -f1)
2121
}
2222
export SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH:-$(git -C "$ROOT" log -1 --format=%ct)}
2323
export TZ=UTC LC_ALL=C
24+
# A production invocation reconstructs the tools tree once from the immutable
25+
# snapshot, then shares that read-only environment across all requested flavors
26+
# or both legs of repro-check.
27+
if [[ $action != dev-image ]]; then
28+
mkosi --directory "$SELF" clean -f
29+
fi
2430

2531
build_one() {
2632
local out=$1 work=$2 flavor=$3
2733
local kstage="$work/kernel-stage" tree="$work/rootfs"
2834
rm -rf "$work" "$out"; mkdir -p "$out"
29-
# Production builds reconstruct the tools tree from the immutable snapshot;
30-
# no previously generated build environment is trusted.
31-
if [[ $action != dev-image ]]; then
32-
mkosi --directory "$SELF" clean -f
33-
fi
34-
3535
mkosi_args=(
3636
--directory "$SELF"
3737
--force

0 commit comments

Comments
 (0)