From 8427e4c8a1f68a7c6b58d3e058074390d7a1047f Mon Sep 17 00:00:00 2001 From: James Wampler Date: Sat, 4 Jul 2026 18:12:15 -0700 Subject: [PATCH] Install native runtime deps for dotnet when missing on bare runners 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. --- scripts/ci/lib.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/ci/lib.sh b/scripts/ci/lib.sh index d2f661b..82d082b 100755 --- a/scripts/ci/lib.sh +++ b/scripts/ci/lib.sh @@ -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