-
-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add musl libc CI using Alpine Linux container on Ubuntu GHA (#4650)
* Add musl libc CI on Alpine Linux * Fix gdb detection. The pipe through `head` meant that error code was always 0, even when gdb is absent. * Try a little harder to find compiler-rt libs, by also searching directory structure with major llvm version instead of x.y.z version. * Add compiler-rt package * TSan and XRay do not work on Alpine * Add correct statvfs_t for Musl (upstreamed)
- Loading branch information
1 parent
09e1822
commit 5fa8e0d
Showing
4 changed files
with
163 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Alpine Linux (musl libc) | ||
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 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-depth: 50 | ||
|
||
- name: Setup latest Alpine Linux | ||
uses: jirutka/setup-alpine@v1 | ||
with: | ||
branch: v3.20 | ||
packages: ldc git g++ cmake ninja llvm-dev llvm-static compiler-rt libunwind-static libxml2-static zstd-static zlib-static bash grep diffutils make | ||
|
||
- name: Build LDC bootstrap | ||
shell: alpine.sh {0} | ||
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 | ||
shell: alpine.sh {0} | ||
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() | ||
shell: alpine.sh {0} | ||
run: ctest --output-on-failure -R "ldc2-unittest" | ||
|
||
- name: Run LIT testsuite | ||
if: success() || failure() | ||
shell: alpine.sh {0} | ||
run: | | ||
set -eux | ||
ctest -V -R "lit-tests" | ||
- name: Run DMD testsuite | ||
if: success() || failure() | ||
shell: alpine.sh {0} | ||
run: ctest -V -R "dmd-testsuite" | ||
|
||
- name: Run defaultlib unittests & druntime integration tests | ||
if: success() || failure() | ||
shell: alpine.sh {0} | ||
run: | | ||
set -eux | ||
ctest -j$(nproc) --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters