-
-
Notifications
You must be signed in to change notification settings - Fork 264
84 lines (75 loc) · 3.15 KB
/
alpine_musl.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Alpine Linux, musl libc, vanilla LLVM
on:
- pull_request
- push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Alpine Linux (musl libc)
runs-on: ubuntu-latest
container: alpine:3.20
steps:
- name: Install prerequisites
run: apk add ldc git g++ cmake ninja llvm-dev llvm-static compiler-rt libxml2-static zstd-static zlib-static bash grep diffutils make
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 50
- name: Build LDC bootstrap
run: |
ninja --version
set -eux
mkdir bootstrap
cd bootstrap
cmake -G Ninja .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/opt/ldc2" \
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++ \
-DD_COMPILER_FLAGS=-link-defaultlib-shared=false \
-DBUILD_SHARED_LIBS=OFF
ninja obj/ldc2.o all
bin/ldc2 --version
cd ..
# TODO: Add '-DLLVM_IS_SHARED=OFF' when static linking is fully supported
# TSan and XRay do not work.
- name: Build LDC & LDC D unittests & defaultlib unittest runners
run: |
set -eux
cmake -G Ninja . \
-DD_COMPILER=./bootstrap/bin/ldmd2 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/opt/ldc2" \
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++ \
-DD_COMPILER_FLAGS=-link-defaultlib-shared=false \
-DBUILD_SHARED_LIBS=OFF \
-DTEST_COMPILER_RT_LIBRARIES="profile;lsan;asan;msan;fuzzer"
ninja obj/ldc2.o all ldc2-unittest all-test-runners
bin/ldc2 --version
ldd bin/ldc2
- name: Run LDC D unittests
if: success() || failure()
run: ctest --output-on-failure -R "ldc2-unittest"
- name: Run LIT testsuite
if: success() || failure()
run: |
set -eux
ctest -V -R "lit-tests"
- name: Run DMD testsuite
if: success() || failure()
run: |
# These two tests require extra flags "-link-defaultlib-debug -frame-pointer=all", https://github.com/ldc-developers/ldc/issues/4694.
# Run them separately with these flags, and then remove them before running the full testsuite.
bin/ldc2 -g -L-export-dynamic -link-defaultlib-debug -frame-pointer=all -run tests/dmd/runnable/test17559.d
bin/ldc2 -O -g -L-export-dynamic -link-defaultlib-debug -frame-pointer=all -run tests/dmd/runnable/test17559.d
bin/ldc2 -g -L-export-dynamic -link-defaultlib-debug -frame-pointer=all -run tests/dmd/runnable/test19086.d
bin/ldc2 -O -g -L-export-dynamic -link-defaultlib-debug -frame-pointer=all -run tests/dmd/runnable/test19086.d
rm tests/dmd/runnable/test17559.d
rm tests/dmd/runnable/test19086.d
ctest -V -R "dmd-testsuite"
- name: Run defaultlib unittests & druntime integration tests
if: success() || failure()
run: |
set -eux
ctest -j$(nproc) --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest"