Skip to content

Commit 091a6e9

Browse files
authored
Merge pull request #4943 from kinke/gha_alpine_aarch64
CI: Add Alpine aarch64 job/package
2 parents 1be6940 + 83f619d commit 091a6e9

7 files changed

Lines changed: 58 additions & 7 deletions

File tree

.github/actions/4b-test-lit/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ runs:
1616
# FIXME: the following tests fail
1717
rm tests/debuginfo/nested_gdb.d
1818
rm tests/sanitizers/fuzz_basic.d
19+
if type -P apk &>/dev/null; then
20+
# FIXME: empty exception backtrace on musl AArch64
21+
rm tests/codegen/exception_stack_trace.d
22+
fi
1923
fi
2024
2125
cd ../build

.github/actions/4c-test-dmd/action.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
name: Run DMD testsuite
22
inputs:
33
arch:
4-
required: false # Windows only
4+
required: true
55
runs:
66
using: composite
77
steps:
88

99
- name: 'Posix: Run DMD testsuite'
1010
if: runner.os != 'Windows'
1111
shell: bash
12-
run: cd ../build && ctest -V -R "dmd-testsuite"
12+
run: |
13+
set -eux
14+
15+
if [[ '${{ inputs.arch }}' == aarch64 ]] && type -P apk &>/dev/null; then
16+
# FIXME: empty exception backtraces on musl AArch64 with enabled optimizations
17+
rm tests/dmd/runnable/test19086.d
18+
rm tests/dmd/runnable/test17559.d
19+
fi
20+
21+
cd ../build
22+
ctest -V -R "dmd-testsuite"
1323
1424
- name: 'Windows: Run DMD testsuite'
1525
if: runner.os == 'Windows'

.github/actions/4d-test-libs/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ runs:
2525
elif [[ '${{ runner.os }}-${{ inputs.arch }}' == Linux-aarch64 ]]; then
2626
# FIXME: sporadically hanging
2727
excludes+='|^core.thread-shared$'
28+
if type -P apk &>/dev/null; then
29+
# FIXME: empty exception backtraces on musl AArch64 with enabled optimizations
30+
excludes+='|^druntime-test-exceptions-release$'
31+
fi
2832
fi
2933
if [[ '${{ runner.os }}' == macOS ]]; then
3034
# FIXME: https://github.com/dlang/phobos/issues/10730

.github/workflows/main.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,26 @@ jobs:
7070
-DEXTRA_CXXFLAGS=-flto=full
7171
with_pgo: true
7272

73+
- job_name: Alpine musl aarch64
74+
os: ubuntu-24.04-arm
75+
container_image: alpine:3.21
76+
arch: aarch64
77+
base_cmake_flags: >-
78+
-DLDC_INSTALL_LLVM_RUNTIME_LIBS_ARCH=aarch64
79+
-DLLVM_IS_SHARED=OFF
80+
-DLDC_ENABLE_PLUGINS=OFF
81+
-DLDC_DYNAMIC_COMPILE=OFF
82+
extra_cmake_flags: >-
83+
-DTEST_COMPILER_RT_LIBRARIES="profile;lsan;asan;msan;fuzzer"
84+
-DLDC_INSTALL_LTOPLUGIN=OFF
85+
-DLDC_FULLY_STATIC=ON
86+
-DCMAKE_C_COMPILER=clang
87+
-DCMAKE_CXX_COMPILER=clang++
88+
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
89+
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
90+
-DEXTRA_CXXFLAGS=-flto=full
91+
with_pgo: true
92+
7393
- job_name: macOS x86_64
7494
os: macos-15-intel
7595
arch: x86_64
@@ -116,7 +136,11 @@ jobs:
116136

117137
name: ${{ matrix.job_name }}
118138
runs-on: ${{ matrix.os }}
119-
container: ${{ matrix.container_image }}
139+
container:
140+
image: ${{ matrix.container_image }}
141+
volumes: # needed for Alpine aarch64 job: https://github.com/actions/runner/issues/801#issuecomment-2976165281
142+
- /opt:/opt:rw,rshared
143+
- /opt:/__e/node20:ro,rshared
120144
timeout-minutes: 90
121145
env:
122146
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch == 'arm64' && '11.0' || '10.12' }}
@@ -138,10 +162,18 @@ jobs:
138162
# create missing 7za symlink
139163
ln -s 7z /usr/bin/7za
140164
# make lld the default linker (note: /usr/bin/ld seems unused)
141-
ln -sf /usr/bin/ld.lld /usr/x86_64-alpine-linux-musl/bin/ld
165+
ln -sf /usr/bin/ld.lld /usr/${{ matrix.arch }}-alpine-linux-musl/bin/ld
142166
# create ../llvm symlink to distro LLVM (no prebuilt LDC-LLVM for musl)
143167
ln -s /usr/lib/llvm19 $(dirname $(pwd))/llvm
144168
../llvm/bin/llvm-config --version
169+
170+
# see https://github.com/actions/runner/issues/801#issuecomment-2976165281
171+
if [[ '${{ matrix.arch }}' == aarch64 ]]; then
172+
sed -i "/^ID=/s/alpine/NotpineForGHA/" /etc/os-release
173+
apk add nodejs --update-cache
174+
mkdir /opt/bin
175+
ln -s /usr/bin/node /opt/bin/node
176+
fi
145177
fi
146178
- uses: actions/checkout@v4
147179
with:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#### Big news
44
- Frontend, druntime and Phobos are at version ~[2.112.0](https://dlang.org/changelog/2.112.0.html), incl. new command-line options `-extI`, `-dllimport=externalOnly` and `-edition`. (#4949, #4962, #4988, #5029)
55
- Support for [LLVM 21](https://releases.llvm.org/21.1.0/docs/ReleaseNotes.html). Beware that patch versions before v21.1.8 seem to misoptimize `std.json`. (#4950, #5033)
6+
- New prebuilt package for Alpine Linux aarch64 with musl libc, analogous to the existing x86_64 package. (#4943)
67
- **Breaking change for dcompute**: The special `@kernel` UDA is now a function and _**requires**_ parentheses as in `@kernel() void foo(){}`. Optionally you can provide launch dimensions, `@kernel([2,4,8])`, to specify to the compute runtime how the kernel is intended to be launched.
78
- ldc2.conf can now be a directory. All the files inside it, ordered naturally, will be concatenated and treated like a big config. (#4954)
89
- Running `ldc-build-runtime --installWithSuffix` now includes installing a target-specific .conf file to that directory. (#4978)

runtime/druntime/src/rt/dwarfeh.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ extern (C) _Unwind_Reason_Code _d_eh_personality_common(_Unwind_Action actions,
564564
{
565565
auto eh = ExceptionHeader.toExceptionHeader(exceptionObject);
566566
for (auto ehx = eh; ehx; ehx = ehx.next)
567-
writeln(" eh: %p next=%014p lsda=%p '%.*s'", ehx, ehx.next, ehx.languageSpecificData, ehx.object.msg.length, ehx.object.msg.ptr);
567+
writeln(" eh: %p next=%014p lsda=%p '%.*s'", ehx, ehx.next, ehx.languageSpecificData, cast(int) ehx.object.msg.length, ehx.object.msg.ptr);
568568
}
569569
}
570570

@@ -657,7 +657,7 @@ extern (C) _Unwind_Reason_Code _d_eh_personality_common(_Unwind_Action actions,
657657
if (exceptionClass == dmdExceptionClass)
658658
{
659659
auto eh = ExceptionHeader.toExceptionHeader(exceptionObject);
660-
debug (EH_personality) writeln(" '%.*s' next = %p", eh.object.msg.length, eh.object.msg.ptr, eh.next);
660+
debug (EH_personality) writeln(" '%.*s' next = %p", cast(int) eh.object.msg.length, eh.object.msg.ptr, eh.next);
661661
auto currentLsd = language_specific_data;
662662
bool bypassed = false;
663663
while (eh.next)

tests/codegen/exception_stack_trace.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void main()
2121
{
2222
import core.stdc.stdio;
2323
auto s = e.toString();
24-
printf("%.*s\n", s.length, s.ptr);
24+
printf("%.*s\n", cast(int) s.length, s.ptr);
2525
}
2626
}
2727

0 commit comments

Comments
 (0)