diff --git a/Dockerfile b/Dockerfile index 5650678..5693132 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,12 +93,12 @@ FROM myoung34/github-runner:$VERSION AS core # Packages that do not depend on JAVA_VERSION/NODE_VERSION, so this layer is # shared by every tag too. # - iproute2: ip tools -# - cmake, build-essential, swig: native builds +# - cmake, ninja-build, build-essential, swig: native builds # - xxd: not in the base image # - pigz: parallel gzip, used by tar/docker when available RUN apt-get -qq update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - iproute2 cmake build-essential swig xxd pigz \ + iproute2 cmake ninja-build build-essential swig xxd pigz \ && rm -rf /var/lib/apt/lists/* # rustup-init only, no toolchain: ~/.cargo and ~/.rustup are links into the diff --git a/tests/image-smoke.sh b/tests/image-smoke.sh index 961442a..69a32eb 100755 --- a/tests/image-smoke.sh +++ b/tests/image-smoke.sh @@ -72,7 +72,7 @@ fi if [ "$variant" = ndk ]; then check "NDK is installed" 'ls -d "$ANDROID_SDK_ROOT"/ndk/*/ >/dev/null' fi -for tool in xxd flock jq git rustup-init; do +for tool in xxd flock jq git ninja rustup-init; do check "$tool is on PATH" "command -v $tool" done diff --git a/tests/slots.sh b/tests/slots.sh index 4bfaffc..950bc01 100644 --- a/tests/slots.sh +++ b/tests/slots.sh @@ -23,13 +23,14 @@ home="$work/home" mkdir -p "$data" "$home" # Run setup_slot in a child that holds its slot for $2 seconds and reports -# " " to file $1. +# " " to file $1. $3 is the container's home: runners have +# one each, so claims that run at the same time must not share one. claim() { - local out="$1" hold="$2" + local out="$1" hold="$2" container_home="${3:-$home}" ( # shellcheck source=SCRIPTDIR/../preflight-entrypoint.sh source "$root/preflight-entrypoint.sh" - CACHE_LINKS=("bun:$home/.bun" "pnpm/store:$home/.local/share/pnpm" "toolcache:$home/toolcache") + CACHE_LINKS=("bun:$container_home/.bun" "pnpm/store:$container_home/.local/share/pnpm" "toolcache:$container_home/toolcache") RUNNER_DATA_DIR="$data" setup_slot >/dev/null echo "$RUNNER_SLOT $LABELS $RUNNER_WORKDIR" >"$out" sleep "$hold" @@ -38,7 +39,7 @@ claim() { # --- concurrent claims ------------------------------------------------------- export LABELS=docker,light RUNNER_2_LABELS=docker,light,large -for i in 1 2 3 4; do claim "$work/claim.$i" 3 & done +for i in 1 2 3 4; do claim "$work/claim.$i" 3 "$work/home.$i" & done sleep 1 ids=$(cut -d' ' -f1 "$work"/claim.* | sort -n | tr '\n' ' ') [ "$ids" = "1 2 3 4 " ] || fail "concurrent claims got '$ids', want '1 2 3 4 '"