Skip to content

CI: Add Alpine aarch64 job/package #4943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -116,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' }}
Expand All @@ -138,10 +161,20 @@ 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

# 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:
Expand Down
Loading