diff --git a/.github/actions/ensure-rust-toolchain/action.yml b/.github/actions/ensure-rust-toolchain/action.yml index 7946a9670..36ad913bb 100644 --- a/.github/actions/ensure-rust-toolchain/action.yml +++ b/.github/actions/ensure-rust-toolchain/action.yml @@ -41,7 +41,7 @@ runs: IFS=',' read -r -a wanted_components <<< "$COMPONENTS" for component in "${wanted_components[@]}"; do [ -z "$component" ] && continue - if ! rustup component list --toolchain "$TOOLCHAIN" --installed | grep -qx "$component"; then + if ! rustup component list --toolchain "$TOOLCHAIN" --installed | grep -qE "^${component}(-|$)"; then missing_components+=("$component") fi done diff --git a/.github/actions/ensure-zig/action.yml b/.github/actions/ensure-zig/action.yml index 64afd5d82..3355fe10f 100644 --- a/.github/actions/ensure-zig/action.yml +++ b/.github/actions/ensure-zig/action.yml @@ -29,12 +29,11 @@ runs: ;; esac - tmpdir="${RUNNER_TEMP:-/tmp}/zig-${ZIG_VERSION}" - bindir="${HOME}/.local/bin" - rm -rf "$tmpdir" - mkdir -p "$tmpdir" "$bindir" - curl -fsSL "https://ziglang.org/download/${ZIG_VERSION}/${archive}.tar.xz" -o "$tmpdir/zig.tar.xz" - tar -xJf "$tmpdir/zig.tar.xz" -C "$tmpdir" - install -m755 "$tmpdir/${archive}/zig" "$bindir/zig" - echo "$bindir" >> "$GITHUB_PATH" - echo "Installed zig $("$bindir/zig" version)" + destdir="${HOME}/.local" + mkdir -p "$destdir" + rm -rf "${destdir:?}/${archive}" + curl -fsSL "https://ziglang.org/download/${ZIG_VERSION}/${archive}.tar.xz" -o "${destdir}/zig.tar.xz" + tar -xJf "${destdir}/zig.tar.xz" -C "$destdir" + rm -f "${destdir}/zig.tar.xz" + echo "${destdir}/${archive}" >> "$GITHUB_PATH" + echo "Installed zig $("${destdir}/${archive}/zig" version)" diff --git a/infra/docs/03-runner-image.md b/infra/docs/03-runner-image.md index 28f506f43..280c22994 100644 --- a/infra/docs/03-runner-image.md +++ b/infra/docs/03-runner-image.md @@ -419,7 +419,7 @@ docker run --rm --entrypoint bash omp-kata-runner:preloaded -lc ' for b in gh fd rg magick bun cargo rustc pkg-config zstd clang lld sccache zig cargo-nextest cargo-zigbuild cargo-xwin; do command -v "$b" >/dev/null || { echo "MISSING: $b"; exit 1; } done - echo "tools OK | bun $(bun --version) | rust $(rustc --version) | sccache $(sccache --version | cut -d\" \" -f2) | zig $(zig version) | gh $(gh --version | head -1 | cut -d\" \" -f3)" + echo "tools OK | bun $(bun --version) | rust $(rustc --version) | sccache $(set -- $(sccache --version); echo "$2") | zig $(zig version) | gh $(set -- $(gh --version | head -1); echo "$3")" ' ``` diff --git a/infra/reload-runner.sh b/infra/reload-runner.sh index 5e6c7550c..3497ff254 100755 --- a/infra/reload-runner.sh +++ b/infra/reload-runner.sh @@ -141,7 +141,7 @@ verify_baked_tools() { for b in gh fd rg magick bun cargo rustc pkg-config zstd clang lld sccache zig cargo-nextest cargo-zigbuild cargo-xwin; do command -v "$b" >/dev/null || { echo "MISSING: $b"; exit 1; } done - echo "tools OK | bun $(bun --version) | rust $(rustc --version) | sccache $(sccache --version | cut -d\" \" -f2) | zig $(zig version) | gh $(gh --version | head -1 | cut -d\" \" -f3)" + echo "tools OK | bun $(bun --version) | rust $(rustc --version) | sccache $(set -- $(sccache --version); echo "$2") | zig $(zig version) | gh $(set -- $(gh --version | head -1); echo "$3")" ' } @@ -173,7 +173,7 @@ build_with_docker() { for b in gh fd rg magick bun cargo rustc pkg-config zstd clang lld sccache zig cargo-nextest cargo-zigbuild cargo-xwin; do command -v "$b" >/dev/null || { echo "MISSING: $b"; exit 1; } done - echo "tools OK | bun $(bun --version) | rust $(rustc --version) | sccache $(sccache --version | cut -d\" \" -f2) | zig $(zig version) | gh $(gh --version | head -1 | cut -d\" \" -f3)" + echo "tools OK | bun $(bun --version) | rust $(rustc --version) | sccache $(set -- $(sccache --version); echo "$2") | zig $(zig version) | gh $(set -- $(gh --version | head -1); echo "$3")" ' echo "==> [3/5] importing into k3s containerd (k8s.io namespace)"