Generalize the remote tooling check to a list of required commands
Check NixOS configurations / eval-hosts (pull_request) Failing after 12m13s

Per-run tooling verification (added in the previous commit) was hardcoded
to checking just `nix`. Turn it into a small array instead, so a future
remote build step needing another tool extends that list rather than
growing a second parallel check.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
beatzaplentyandClaude Sonnet 5 committed 2026-07-20 14:42:00 +00:00
1 parent f5ef3194d4
commit 9a1d6842d7
1 file changed
+23 -12
+23 -12
View File
@@ -544,18 +544,29 @@ ensure_remote_repo() {
ssh "$ssh_target" "git clone '${origin_url}' '${remote_repo_dir}'" ssh "$ssh_target" "git clone '${origin_url}' '${remote_repo_dir}'"
fi fi
# Checked (and bootstrapped if missing) every run, not just right after a # Trivial check, run every time (not just right after a fresh clone) --
# fresh clone -- confirmed live: a first bootstrap can clone the repo # confirmed live: a first bootstrap can clone the repo successfully and
# successfully and still leave the node without a working `nix` (e.g. the # still leave the node without a working `nix` (e.g. the node had no
# node had no `sudo`, which the Nix installer's root path depends on -- # `sudo`, which the Nix installer's root path depends on -- see the fix
# see the fix in scripts/codex-setup.sh), and a later run with the repo # in scripts/codex-setup.sh), and a later run with the repo already
# already present would otherwise never retry it. Sources # present would otherwise never retry it. Sources
# scripts/lib/nix-bootstrap.sh's ensure_nix_profile the same way the # scripts/lib/nix-bootstrap.sh's ensure_nix_profile first -- a
# build commands below do -- a single-user Nix install typically only # single-user Nix install typically only gets sourced into login shells,
# gets sourced into login shells, and ssh's non-interactive command # and ssh's non-interactive command execution is neither, so a
# execution is neither, so a freshly-installed `nix` still wouldn't be on # freshly-installed `nix` still wouldn't be on PATH here without it.
# PATH here without it. #
if ssh "$ssh_target" "cd '${remote_repo_dir}' && . scripts/lib/nix-bootstrap.sh && ensure_nix_profile && command -v nix" >/dev/null 2>&1; then # Just `nix` today -- the only thing the remote build commands below
# actually invoke -- but a list (not a single hardcoded check) so a
# future remote step needing another tool can add itself here instead of
# growing a parallel check.
local remote_required_cmds=(nix)
local tooling_check_cmd="cd '${remote_repo_dir}' && . scripts/lib/nix-bootstrap.sh && ensure_nix_profile"
local cmd
for cmd in "${remote_required_cmds[@]}"; do
tooling_check_cmd="${tooling_check_cmd} && command -v ${cmd}"
done
if ssh "$ssh_target" "$tooling_check_cmd" >/dev/null 2>&1; then
echo "Build tooling already present on ${node}." echo "Build tooling already present on ${node}."
else else
echo "==> Bootstrapping build tooling on ${node} (scripts/codex-setup.sh)..." echo "==> Bootstrapping build tooling on ${node} (scripts/codex-setup.sh)..."