From 5e19d594a9788f289821e892f20b7eca908b2e62 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Fri, 6 Jun 2025 11:54:23 +0200 Subject: [PATCH 1/3] CI: Add Alpine aarch64 job/package --- .github/workflows/main.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d291ba3d48..e56f3550ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,6 +70,26 @@ jobs: -DEXTRA_CXXFLAGS=-flto=full with_pgo: true + - job_name: Alpine musl aarch64 + os: ubuntu-24.04-arm + container_image: alpine:3.21 + arch: aarch64 + base_cmake_flags: >- + -DLDC_INSTALL_LLVM_RUNTIME_LIBS_ARCH=aarch64 + -DLLVM_IS_SHARED=OFF + -DLDC_ENABLE_PLUGINS=OFF + -DLDC_DYNAMIC_COMPILE=OFF + extra_cmake_flags: >- + -DTEST_COMPILER_RT_LIBRARIES="profile;lsan;asan;msan;fuzzer" + -DLDC_INSTALL_LTOPLUGIN=OFF + -DLDC_FULLY_STATIC=ON + -DCMAKE_C_COMPILER=clang + -DCMAKE_CXX_COMPILER=clang++ + -DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++ + -DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto" + -DEXTRA_CXXFLAGS=-flto=full + with_pgo: true + - job_name: macOS x86_64 os: macos-13 arch: x86_64 @@ -138,7 +158,7 @@ jobs: # create missing 7za symlink ln -s 7z /usr/bin/7za # make lld the default linker (note: /usr/bin/ld seems unused) - ln -sf /usr/bin/ld.lld /usr/x86_64-alpine-linux-musl/bin/ld + ln -sf /usr/bin/ld.lld /usr/${{ matrix.arch }}-alpine-linux-musl/bin/ld # create ../llvm symlink to distro LLVM (no prebuilt LDC-LLVM for musl) ln -s /usr/lib/llvm19 $(dirname $(pwd))/llvm ../llvm/bin/llvm-config --version From 60eec9ca2943bc119f9fa655ed94031af54a8c95 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Fri, 6 Jun 2025 12:58:32 +0200 Subject: [PATCH 2/3] [try pretty wild workaround] --- .github/workflows/main.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e56f3550ce..d7eafabb76 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -136,7 +136,10 @@ jobs: name: ${{ matrix.job_name }} runs-on: ${{ matrix.os }} - container: ${{ matrix.container_image }} + container: + image: ${{ matrix.container_image }} + volumes: # needed for Alpine aarch64 job: https://github.com/actions/runner/issues/801#issuecomment-2394425757 + - /:/host timeout-minutes: 90 env: MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch == 'arm64' && '11.0' || '10.12' }} @@ -162,6 +165,16 @@ jobs: # create ../llvm symlink to distro LLVM (no prebuilt LDC-LLVM for musl) ln -s /usr/lib/llvm19 $(dirname $(pwd))/llvm ../llvm/bin/llvm-config --version + + # see https://github.com/actions/runner/issues/801#issuecomment-2394425757 + if [[ '${{ matrix.arch }}' == aarch64 ]]; then + apk add nodejs + sed -i "s:ID=alpine:ID=NotpineForGHA:" /etc/os-release + cd /host/home/runner/runners/*/externals/ + rm -rf node20/* + mkdir node20/bin + ln -s /usr/bin/node node20/bin/node + fi fi - uses: actions/checkout@v4 with: From b71717df4c92ff64df262e4596336fa835f7a8c7 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Fri, 3 Oct 2025 16:57:23 +0200 Subject: [PATCH 3/3] [try newer workaround] --- .github/workflows/main.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d7eafabb76..f26360b8ab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -138,8 +138,9 @@ jobs: runs-on: ${{ matrix.os }} container: image: ${{ matrix.container_image }} - volumes: # needed for Alpine aarch64 job: https://github.com/actions/runner/issues/801#issuecomment-2394425757 - - /:/host + volumes: # needed for Alpine aarch64 job: https://github.com/actions/runner/issues/801#issuecomment-2976165281 + - /opt:/opt:rw,rshared + - /opt:/__e/node20:ro,rshared timeout-minutes: 90 env: MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch == 'arm64' && '11.0' || '10.12' }} @@ -166,14 +167,12 @@ jobs: ln -s /usr/lib/llvm19 $(dirname $(pwd))/llvm ../llvm/bin/llvm-config --version - # see https://github.com/actions/runner/issues/801#issuecomment-2394425757 + # see https://github.com/actions/runner/issues/801#issuecomment-2976165281 if [[ '${{ matrix.arch }}' == aarch64 ]]; then - apk add nodejs - sed -i "s:ID=alpine:ID=NotpineForGHA:" /etc/os-release - cd /host/home/runner/runners/*/externals/ - rm -rf node20/* - mkdir node20/bin - ln -s /usr/bin/node node20/bin/node + sed -i "/^ID=/s/alpine/NotpineForGHA/" /etc/os-release + apk add nodejs --update-cache + mkdir /opt/bin + ln -s /usr/bin/node /opt/bin/node fi fi - uses: actions/checkout@v4