From de9ce7ce4768afc8ba3bc15ec1040d9d81e9c259 Mon Sep 17 00:00:00 2001 From: Adam French Date: Fri, 27 Nov 2026 14:18:54 +0000 Subject: [PATCH] Install apt packages host jobs need (libatomic1 for Node 26) actions/setup-node's Node 26 fails on minimal Ubuntu 24.04 with 'libatomic.so.1: cannot open shared object file'. RUNNER_APT_PACKAGES in the host file lists packages install.sh installs when missing. Co-Authored-By: Claude Opus 5.5 --- README.md | 5 ++++- hosts/stpbuild.env | 2 ++ hosts/stpvm.env | 2 ++ install.sh | 16 ++++++++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c5a3b01..ef6ad62 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,10 @@ JavaScript actions (`actions/checkout`, `actions/setup-node`, …) also need `node` on the host, or they fail with `Cannot find: node in PATH`: set `RUNNER_NODE_VERSION` in the host file and `install.sh` puts that release at `/usr/local/bin/node` (only `node`; jobs get their own Node from -`actions/setup-node`). A VM without Tailscale can +`actions/setup-node`). Shared libraries those jobs need go in +`RUNNER_APT_PACKAGES` (e.g. `libatomic1`, without which the Node 26 that +`actions/setup-node` installs fails with `libatomic.so.1: cannot open shared +object file`). A VM without Tailscale can still be set up from the Proxmox host: `qm guest exec -- bash -c '...'`. ## Upgrading diff --git a/hosts/stpbuild.env b/hosts/stpbuild.env index 87093cc..9fec0c2 100644 --- a/hosts/stpbuild.env +++ b/hosts/stpbuild.env @@ -8,3 +8,5 @@ RUNNER_CAPACITY=2 RUNNER_LABELS="build:host" # For JavaScript actions in host jobs (actions/checkout@v5 is node24). RUNNER_NODE_VERSION=24.22.3 +# Space-separated apt packages for host jobs. libatomic1: Node 26 (setup-node). +RUNNER_APT_PACKAGES="libatomic1" diff --git a/hosts/stpvm.env b/hosts/stpvm.env index 8317131..7163b30 100644 --- a/hosts/stpvm.env +++ b/hosts/stpvm.env @@ -6,3 +6,5 @@ RUNNER_NAME=stpvm RUNNER_USER=adamf RUNNER_CAPACITY=1 RUNNER_LABELS="self-hosted:host,ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest,ubuntu-24.04:docker://docker.gitea.com/runner-images:ubuntu-24.04,ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04" +# Space-separated apt packages for host jobs. libatomic1: Node 26 (setup-node). +RUNNER_APT_PACKAGES="libatomic1" diff --git a/install.sh b/install.sh index cbb7b81..036ae6b 100755 --- a/install.sh +++ b/install.sh @@ -68,6 +68,22 @@ if [ "$current" != "v${VERSION}" ]; then changed=1 fi +# --- host packages ----------------------------------------------------------- +# Libraries host-mode jobs need that a minimal Ubuntu lacks, e.g. libatomic1 +# for the Node 26 that actions/setup-node installs. +if [ -n "${RUNNER_APT_PACKAGES:-}" ]; then + read -ra pkgs <<<"$RUNNER_APT_PACKAGES" + missing=() + for p in "${pkgs[@]}"; do + dpkg-query -W -f='${Status}' "$p" 2>/dev/null | grep -q "ok installed" || missing+=("$p") + done + if [ ${#missing[@]} -gt 0 ]; then + echo "Installing packages: ${missing[*]}" + apt-get update -qq + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq "${missing[@]}" + fi +fi + # --- node (host-mode JavaScript actions) ------------------------------------- # In host mode the runner runs actions such as actions/checkout with the # host's `node`. Only `node` goes on PATH: the job's own Node comes from