From 057681b33c05ae85f666035503cec715aed8af7d Mon Sep 17 00:00:00 2001 From: Emir Beganovic Date: Fri, 9 Oct 2026 01:06:45 +0200 Subject: [PATCH 1/2] Unpack the bundled Node tarball for the machine's architecture An aarch64 ISO bundles node-v*-linux-arm64.tar.gz, and mise-work.sh looked for node-v*-linux-x64.tar.gz on every machine. An offline install on aarch64 stopped at its last step: "Error: bundled Node.js tarball missing from /opt/packages". The name now follows uname -m. x86_64 looks for the same file as before. This is the change the n1x branch already carries, from Spencer Bull's 6d022e36. --- install/user/mise-work.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install/user/mise-work.sh b/install/user/mise-work.sh index 75ca0916..17479d0f 100644 --- a/install/user/mise-work.sh +++ b/install/user/mise-work.sh @@ -12,7 +12,12 @@ case ${OMARCHY_SETUP_CONTEXT:-runtime} in esac if [[ -n $NODE_PACKAGE_DIR ]]; then - NODE_TARBALL=$(find "$NODE_PACKAGE_DIR" -name "node-v*-linux-x64.tar.gz" -type f 2>/dev/null | head -n1) + # The ISO bundles the tarball for its own architecture. + case $(uname -m) in + aarch64) NODE_PLATFORM=linux-arm64 ;; + *) NODE_PLATFORM=linux-x64 ;; + esac + NODE_TARBALL=$(find "$NODE_PACKAGE_DIR" -name "node-v*-$NODE_PLATFORM.tar.gz" -type f 2>/dev/null | head -n1) if [[ -z $NODE_TARBALL ]]; then if [[ ${OMARCHY_SETUP_CONTEXT:-} == "provision-owner" ]]; then # A factory snapshot predating the bundled tarball may not have it staged. @@ -24,7 +29,7 @@ if [[ -n $NODE_PACKAGE_DIR ]]; then exit 1 fi else - NODE_VERSION=$(basename "$NODE_TARBALL" | sed 's/node-v\(.*\)-linux-x64.tar.gz/\1/') + NODE_VERSION=$(basename "$NODE_TARBALL" | sed "s/node-v\(.*\)-$NODE_PLATFORM.tar.gz/\1/") NODE_INSTALL_DIR="$HOME/.local/share/mise/installs/node/$NODE_VERSION" mkdir -p "$NODE_INSTALL_DIR" From 15b3529ef29ba18aa29f5445b310e3dfd763825a Mon Sep 17 00:00:00 2001 From: Emir Beganovic Date: Fri, 9 Oct 2026 01:13:27 +0200 Subject: [PATCH 2/2] Test that each architecture unpacks its own Node tarball The existing test runs mise-work.sh in the runtime context, which skips the bundled tarball altogether. This offers both tarballs to an x86_64 and an aarch64 machine and checks that each unpacks its own and hands Mise that version, and that a machine with only the other architecture's tarball fails. Against the old script the aarch64 case fails. --- test/shell.d/mise-work-path-test.sh | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/test/shell.d/mise-work-path-test.sh b/test/shell.d/mise-work-path-test.sh index 9c50b91b..f98fe6b9 100644 --- a/test/shell.d/mise-work-path-test.sh +++ b/test/shell.d/mise-work-path-test.sh @@ -100,6 +100,54 @@ env \ [[ $(<"$install_log") == "use -g node@latest" ]] || fail "installer only invokes Mise for the global Node setup" pass "new installs do not add project bin directories to PATH" +# An offline install unpacks the Node tarball the ISO bundles, and the ISO +# bundles the one for its own architecture. Both are on offer here; each +# machine must take its own. uname and the bundle directory are stand-ins. +bundle="$test_dir/bundle" +mkdir -p "$bundle" "$test_dir/node-src" +for platform in linux-x64 linux-arm64; do + mkdir -p "$test_dir/node-src/node-v24.1.0-$platform/bin" + echo "$platform" >"$test_dir/node-src/node-v24.1.0-$platform/bin/node" + tar -czf "$bundle/node-v24.1.0-$platform.tar.gz" -C "$test_dir/node-src" "node-v24.1.0-$platform" +done +cat >"$test_dir/bin/uname" <<'SH' +#!/bin/bash +[[ $* == -m ]] && { echo "$UNAME_TEST_MACHINE"; exit; } +exec /usr/bin/uname "$@" +SH +cat >"$test_dir/bin/find" <<'SH' +#!/bin/bash +[[ $1 == /opt/packages ]] && { shift; exec /usr/bin/find "$NODE_TEST_BUNDLE" "$@"; } +exec /usr/bin/find "$@" +SH +chmod +x "$test_dir/bin/uname" "$test_dir/bin/find" + +for case in "x86_64 linux-x64" "aarch64 linux-arm64"; do + read -r machine platform <<<"$case" + arch_home="$test_dir/$machine-home" + arch_log="$test_dir/$machine-mise.log" + mkdir -p "$arch_home" + env \ + HOME="$arch_home" \ + MISE_TEST_LOG="$arch_log" \ + NODE_TEST_BUNDLE="$bundle" \ + UNAME_TEST_MACHINE="$machine" \ + OMARCHY_SETUP_CONTEXT=iso-chroot \ + PATH="$test_dir/bin:/usr/bin" \ + bash -euo pipefail -c 'source "$1"' bash "$ROOT/install/user/mise-work.sh" + + installed="$arch_home/.local/share/mise/installs/node/24.1.0/bin/node" + [[ -f $installed && $(<"$installed") == "$platform" ]] || fail "$machine unpacks the $platform Node tarball" + [[ $(head -n1 "$arch_log") == "use -g node@24.1.0" ]] || fail "$machine hands Mise the bundled Node version" +done +[[ ! -e $bundle/node-v24.1.0-linux-x64.tar.gz ]] || rm "$bundle/node-v24.1.0-linux-x64.tar.gz" +if env HOME="$test_dir/missing-home" MISE_TEST_LOG="$test_dir/missing.log" NODE_TEST_BUNDLE="$bundle" \ + UNAME_TEST_MACHINE=x86_64 OMARCHY_SETUP_CONTEXT=iso-chroot PATH="$test_dir/bin:/usr/bin" \ + bash -euo pipefail -c 'source "$1"' bash "$ROOT/install/user/mise-work.sh" 2>/dev/null; then + fail "an x86_64 install accepts another architecture's Node tarball" +fi +pass "offline installs unpack the Node tarball for the machine's architecture" + stock_home="$test_dir/stock-home" stock_config="$stock_home/Work/.mise.toml" stock_project="$stock_home/Work/tries/untrusted-repository"