From ec6bb389021b73833ba23535acd288682b0c659d Mon Sep 17 00:00:00 2001 From: James Wampler Date: Sat, 4 Jul 2026 18:16:39 -0700 Subject: [PATCH] Add apk fallback for native dotnet deps on musl/Alpine runners dotnet-install.sh silently picks the linux-musl-x64 SDK on this runner, which has no apt-get - only apk - so the previous apt-only fix still failed. --- scripts/ci/lib.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/ci/lib.sh b/scripts/ci/lib.sh index 82d082b..612b0de 100755 --- a/scripts/ci/lib.sh +++ b/scripts/ci/lib.sh @@ -65,15 +65,20 @@ ensure_dotnet_native_deps() { fi log "libstdc++.so.6 missing; installing native runtime deps for dotnet" + local sudo_cmd="" + if [[ "$(id -u)" -ne 0 ]] && command -v sudo > /dev/null 2>&1; then + sudo_cmd="sudo" + fi + 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 + elif command -v apk > /dev/null 2>&1; then + # Alpine/musl runner - dotnet-install.sh falls back to the linux-musl-x64 SDK + # here, which still wants a real libstdc++/libgcc (not just gcompat). + $sudo_cmd apk add --no-cache libstdc++ libgcc icu-libs ca-certificates else - fail "libstdc++.so.6 missing and apt-get unavailable; install a C++ runtime manually on this runner" + fail "libstdc++.so.6 missing and neither apt-get nor apk is available; install a C++ runtime manually on this runner" fi }