Install native runtime deps for dotnet when missing on bare runners
Some checks failed
CI / build-and-push (push) Successful in 41s
CI / deploy-qa (push) Successful in 11s
CI / smoke-qa (push) Failing after 8s

The self-hosted qa runner's minimal image lacked libstdc++/libgcc, which
dotnet fails on with an obscure symbol-relocation error rather than a
clear "missing dependency" message.
This commit is contained in:
2026-07-04 18:12:15 -07:00
parent 2d6ee2197b
commit 8427e4c8a1

View File

@@ -52,6 +52,29 @@ ensure_dotnet() {
fi
export PATH="$install_dir:$PATH"
export DOTNET_ROOT="$install_dir"
ensure_dotnet_native_deps
}
# The .NET runtime is a native ELF binary that dynamically links libstdc++/libgcc.
# Bare/minimal images (e.g. the act hostexecutor container) may lack them entirely,
# which fails as an obscure symbol-relocation error rather than "command not found".
ensure_dotnet_native_deps() {
if ldconfig -p 2>/dev/null | grep -q 'libstdc++\.so\.6'; then
return 0
fi
log "libstdc++.so.6 missing; installing native runtime deps for dotnet"
if command -v apt-get > /dev/null 2>&1; then
local sudo_cmd=""
if [[ "$(id -u)" -ne 0 ]] && command -v sudo > /dev/null 2>&1; then
sudo_cmd="sudo"
fi
$sudo_cmd apt-get update -y
$sudo_cmd apt-get install -y --no-install-recommends libstdc++6 libgcc-s1 libicu-dev ca-certificates
else
fail "libstdc++.so.6 missing and apt-get unavailable; install a C++ runtime manually on this runner"
fi
}
# Installs Node.js into $CI_ROOT/.node from the official prebuilt tarball if