File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,16 +14,23 @@ case "$action" in
1414 * ) echo " Usage: $0 {image|dev-image|repro-check|lint} [build-dir]" >&2 ; exit 2 ;;
1515esac
1616if [[ $action == lint ]]; then exec " $SELF /tests/acceptance.sh" ; fi
17- command -v mkosi > /dev/null || { echo ' mkosi >= 26 is required' >&2 ; exit 1; }
17+ command -v mkosi > /dev/null || { echo " mkosi $MKOSI_VERSION is required" >&2 ; exit 1; }
1818actual=$( mkosi --version | awk ' {print $2}' | cut -d. -f1)
19- (( actual >= MKOSI_MIN_VERSION )) || { echo " mkosi >= $MKOSI_MIN_VERSION required" >&2 ; exit 1; }
19+ [[ $actual == " $MKOSI_VERSION " ]] || {
20+ echo " mkosi $MKOSI_VERSION required, found $actual " >&2 ; exit 1;
21+ }
2022export SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH:- $(git -C " $ROOT " log -1 --format=% ct)}
2123export TZ=UTC LC_ALL=C
2224
2325build_one () {
2426 local out=$1 work=$2 flavor=$3
2527 local kstage=" $work /kernel-stage" tree=" $work /rootfs"
2628 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
2734
2835 mkosi_args=(
2936 --directory " $SELF "
Original file line number Diff line number Diff line change 3030fi
3131export PATH=" /opt/dstack-toolchains/rust/bin:/opt/dstack-toolchains/go/bin:$PATH "
3232" $SELF /scripts/install-toolchains.sh" " $toolchain_downloads "
33+ printf ' gcc: ' ; gcc --version | head -1
34+ printf ' g++: ' ; g++ --version | head -1
35+ printf ' ld: ' ; ld --version | head -1
36+ printf ' cmake: ' ; cmake --version | head -1
37+ dpkg-query -W -f=' build-package: ${binary:Package}=${Version}\n' \
38+ gcc g++ binutils cmake make ninja-build dwarves
3339
3440work=/var/tmp/dstack-component-work
3541kernel_stage=/var/tmp/dstack-kernel-stage
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ component_run() {
8989 " ${SOURCE_DATE_EPOCH:? } " " $( uname -m) "
9090 key_file " $definition " " $SELF /scripts/component-framework.sh" \
9191 " $SELF /scripts/dev-cache.sh" " $SELF /scripts/install-toolchains.sh" \
92- " $SELF /mkosi.build" " $SELF /mkosi.conf"
92+ " $SELF /mkosi.build" " $SELF /mkosi.conf" " $SELF /mkosi.tools.conf "
9393 component_cache_key
9494 } | sha256sum | cut -d' ' -f1)
9595 COMPONENT_KEYS[$name ]=$key
Original file line number Diff line number Diff line change @@ -61,7 +61,11 @@ grep -q 'DSTACK_COMPONENT_CACHE.*dev-image' "$D/build.sh"
6161grep -q ' scripts/build-components.sh' " $D /mkosi.build"
6262grep -q ' ^BuildPackages=' " $D /mkosi.conf"
6363grep -q ' ^ToolsTree=yes$' " $D /mkosi.conf"
64+ grep -q ' ^Snapshot=20260721T000000Z$' " $D /mkosi.tools.conf"
65+ grep -q ' clean -f' " $D /build.sh"
6466grep -q ' install-toolchains.sh' " $D /mkosi.build"
67+ grep -q ' ^RUST_TOOLCHAIN_VERSION=1.92.0$' " $D /versions.env"
68+ grep -q ' ^GO_TOOLCHAIN_VERSION=1.22.2$' " $D /versions.env"
6569for component in dstack-rust container-stack sysbox nvattest kernel nvidia zfs ovmf; do
6670 definition=" $D /components/$component /$component .sh"
6771 grep -q " ^COMPONENT_NAME=$component $" " $definition "
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ KERNEL_VERSION=7.1.4
44KERNEL_SHA256 = 1c63922a119675d38e3ae0f8f6ee07f15c41a786ab9ed66563749bb8c9a08e2e
55DEBIAN_RELEASE = trixie
66DEBIAN_SNAPSHOT = 20260721T000000Z
7- MKOSI_MIN_VERSION = 26
7+ MKOSI_VERSION = 26
88RUST_TOOLCHAIN_VERSION = 1.92.0
99RUSTC_TOOLCHAIN_SHA256 = 78b2dd9c6b1fcd2621fa81c611cf5e2d6950690775038b585c64f364422886e0
1010CARGO_TOOLCHAIN_SHA256 = e5e12be2c7126a7036c8adf573078a28b92611f5767cc9bd0a6f7c83081df103
You can’t perform that action at this time.
0 commit comments