Skip to content

Commit 43b7f59

Browse files
authored
Merge pull request #4862 from kinke/bump_alpine
CI: Bump Alpine image to v3.21
2 parents 27c7914 + 5ebfff3 commit 43b7f59

File tree

4 files changed

+24
-39
lines changed

4 files changed

+24
-39
lines changed

.github/actions/2-build-bootstrap/action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ runs:
2323
host_dc: ldmd2
2424
cmake_flags: >-
2525
-DBUILD_SHARED_LIBS=OFF
26+
-DLDC_DYNAMIC_COMPILE=OFF
2627
${{ inputs.cmake_flags }}
2728
arch: ${{ inputs.arch }}
2829

.github/workflows/main.yml

+21-37
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ jobs:
2222
- job_name: Linux x86_64 multilib
2323
os: ubuntu-20.04
2424
arch: x86_64
25-
bootstrap_cmake_flags: -DBUILD_LTO_LIBS=ON
2625
# To improve portability of the generated binaries, link the C++ standard library statically.
2726
extra_cmake_flags: >-
2827
-DMULTILIB=ON
29-
-DBUILD_LTO_LIBS=ON
3028
-DCMAKE_C_COMPILER=clang
3129
-DCMAKE_CXX_COMPILER=clang++
3230
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
@@ -39,12 +37,9 @@ jobs:
3937
os: ubuntu-22.04-arm # Ubuntu 20 not natively supported
4038
container_image: ubuntu:20.04
4139
arch: aarch64
42-
bootstrap_cmake_flags: >-
43-
-DBUILD_LTO_LIBS=ON
40+
base_cmake_flags: >-
4441
-DCOMPILER_RT_LIBDIR_OS=aarch64-unknown-linux-gnu
4542
extra_cmake_flags: >-
46-
-DBUILD_LTO_LIBS=ON
47-
-DCOMPILER_RT_LIBDIR_OS=aarch64-unknown-linux-gnu
4843
-DCMAKE_C_COMPILER=clang
4944
-DCMAKE_CXX_COMPILER=clang++
5045
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
@@ -55,30 +50,29 @@ jobs:
5550

5651
- job_name: Alpine musl x86_64
5752
os: ubuntu-latest
58-
container_image: alpine:3.20
53+
container_image: alpine:3.21
5954
arch: x86_64
60-
bootstrap_cmake_flags: -DBUILD_LTO_LIBS=ON
61-
# TSan and XRay do not work.
62-
extra_cmake_flags: >-
63-
-DBUILD_LTO_LIBS=ON
55+
base_cmake_flags: >-
56+
-DCOMPILER_RT_LIBDIR_OS=linux
57+
-DLDC_INSTALL_LLVM_RUNTIME_LIBS_ARCH=x86_64
6458
-DLLVM_IS_SHARED=OFF
6559
-DLDC_ENABLE_PLUGINS=OFF
6660
-DLDC_DYNAMIC_COMPILE=OFF
67-
-DLDC_INSTALL_LTOPLUGIN=OFF
68-
-DCOMPILER_RT_LIBDIR_OS=linux
69-
-DLDC_INSTALL_LLVM_RUNTIME_LIBS_ARCH=x86_64
61+
# TSan and XRay do not work.
62+
extra_cmake_flags: >-
7063
-DTEST_COMPILER_RT_LIBRARIES="profile;lsan;asan;msan;fuzzer"
71-
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
64+
-DLDC_INSTALL_LTOPLUGIN=OFF
7265
-DLDC_FULLY_STATIC=ON
73-
-DD_COMPILER_FLAGS="-O -flto=full"
74-
# FIXME: -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
75-
with_pgo: false
66+
-DCMAKE_C_COMPILER=clang
67+
-DCMAKE_CXX_COMPILER=clang++
68+
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
69+
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
70+
-DEXTRA_CXXFLAGS=-flto=full
71+
with_pgo: true
7672

7773
- job_name: macOS x86_64
7874
os: macos-13
7975
arch: x86_64
80-
bootstrap_cmake_flags: >-
81-
-DBUILD_LTO_LIBS=ON
8276
# https://github.com/ldc-developers/ldc/issues/4462:
8377
# When using LTO, we need to explicitly export ~all symbols for plugin support via `ld64 -exported_symbol '__*'`.
8478
# Additionally `-w` to suppress resulting linker warnings.
@@ -87,39 +81,31 @@ jobs:
8781
# * Specify a macOS triple with OS version. And exclude LTO-able host druntime/Phobos because precompiled without OS version.
8882
# * Manually specify the path to the bundled libLTO.dylib (broken for *universal* packages for LDC <= v1.40.0).
8983
extra_cmake_flags: >-
90-
-DBUILD_LTO_LIBS=ON
9184
-DD_COMPILER_FLAGS="-O -flto=full -L-exported_symbol '-L__*' -L-w -flto-binary=$PWD/../bootstrap-ldc/lib-x86_64/libLTO.dylib -mtriple=x86_64-apple-macos$MACOSX_DEPLOYMENT_TARGET"
9285
-DEXTRA_CXXFLAGS=-flto=full
9386
with_pgo: true
9487

9588
- job_name: macOS arm64
9689
os: macos-15
9790
arch: arm64
98-
bootstrap_cmake_flags: >-
99-
-DBUILD_LTO_LIBS=ON
10091
extra_cmake_flags: >-
101-
-DBUILD_LTO_LIBS=ON
10292
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w -flto-binary=$PWD/../bootstrap-ldc/lib-arm64/libLTO.dylib"
10393
-DEXTRA_CXXFLAGS=-flto=full
10494
with_pgo: true
10595

10696
- job_name: Windows x64
10797
os: windows-2022
10898
arch: x64
109-
bootstrap_cmake_flags: -DBUILD_LTO_LIBS=ON
11099
extra_cmake_flags: >-
111-
-DBUILD_LTO_LIBS=ON
112100
"-DD_COMPILER_FLAGS=-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
113101
-DEXTRA_CXXFLAGS=-flto=full
114102
with_pgo: true
115103

116104
- job_name: Windows x86
117105
os: windows-2022
118106
arch: x86
119-
bootstrap_cmake_flags: -DBUILD_LTO_LIBS=ON
120107
# `RT_CFLAGS=-m32` needed to make 64-bit clang-cl output 32-bit code for druntime integration tests
121108
extra_cmake_flags: >-
122-
-DBUILD_LTO_LIBS=ON
123109
-DRT_CFLAGS=-m32
124110
# Undefined symbol errors with FullLTO; ThinLTO used to work, but apparently miscompiles a lexer.d:138 assertion since v1.33.
125111
# "-DD_COMPILER_FLAGS=-O -flto=thin -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
@@ -144,13 +130,15 @@ jobs:
144130
else
145131
# set up Alpine container
146132
apk add \
147-
git cmake ninja-is-really-ninja g++ ldc llvm-dev llvm-static compiler-rt \
133+
git cmake ninja-is-really-ninja g++ clang ldc lld llvm-dev llvm-static compiler-rt \
148134
libxml2-static zstd-static zlib-static \
149135
bash grep diffutils make curl 7zip perl
150136
# create missing 7za symlink
151137
ln -s 7z /usr/bin/7za
138+
# make lld the default linker (note: /usr/bin/ld seems unused)
139+
ln -sf /usr/bin/ld.lld /usr/x86_64-alpine-linux-musl/bin/ld
152140
# create ../llvm symlink to distro LLVM (no prebuilt LDC-LLVM for musl)
153-
ln -s /usr/lib/llvm17 $(dirname $(pwd))/llvm
141+
ln -s /usr/lib/llvm19 $(dirname $(pwd))/llvm
154142
../llvm/bin/llvm-config --version
155143
fi
156144
- uses: actions/checkout@v4
@@ -168,7 +156,7 @@ jobs:
168156
if: runner.os != 'macOS'
169157
uses: ./.github/actions/2-build-bootstrap
170158
with:
171-
cmake_flags: ${{ matrix.bootstrap_cmake_flags }}
159+
cmake_flags: -DBUILD_LTO_LIBS=ON ${{ matrix.base_cmake_flags }}
172160
arch: ${{ matrix.arch }}
173161
# FIXME: on macOS, mixing newer LLVM from bootstrap LDC with older LLVM from Xcode clang is problematic,
174162
# leading to sporadic 'libc++abi: Pure virtual function called!' compiler crashes etc.
@@ -184,12 +172,12 @@ jobs:
184172
if: matrix.with_pgo
185173
uses: ./.github/actions/2a-build-pgo
186174
with:
187-
cmake_flags: ${{ matrix.bootstrap_cmake_flags }}
175+
cmake_flags: ${{ matrix.base_cmake_flags }}
188176
arch: ${{ matrix.arch }}
189177
- name: Build LDC & LDC D unittests & defaultlib unittest runners
190178
uses: ./.github/actions/3-build-native
191179
with:
192-
cmake_flags: ${{ matrix.extra_cmake_flags }}
180+
cmake_flags: -DBUILD_LTO_LIBS=ON ${{ matrix.base_cmake_flags }} ${{ matrix.extra_cmake_flags }}
193181
arch: ${{ matrix.arch }}
194182
with_pgo: ${{ matrix.with_pgo }}
195183

@@ -280,13 +268,9 @@ jobs:
280268
arch: x86_64
281269
- name: Build bootstrap LDC
282270
uses: ./.github/actions/2-build-bootstrap
283-
with:
284-
cmake_flags: ${{ matrix.bootstrap_cmake_flags }}
285271
- name: Build LDC with PGO instrumentation & gather profile from compiling default libs
286272
if: matrix.with_pgo
287273
uses: ./.github/actions/2a-build-pgo
288-
with:
289-
cmake_flags: ${{ matrix.bootstrap_cmake_flags }}
290274
- name: Cross-compile LDC to ${{ matrix.os }}-${{ matrix.arch }}
291275
uses: ./.github/actions/3-build-cross
292276
with:

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#### Big news
44
- Latest frontend and druntime patches from DMD stable (v2.110.0-rc.1+). (#4854)
55
- LLVM for prebuilt packages bumped to v19.1.7. (#4822)
6-
- New prebuilt package for Alpine Linux x86_64 with musl libc. It's currently generated on Alpine v3.20, using its default LLVM 17. Most bundled executables are fully static and can be run on ~all distros. (#4826)
6+
- New prebuilt package for Alpine Linux x86_64 with musl libc. It's currently generated on Alpine v3.21, using its default LLVM 19. Most bundled executables are fully static and can be run on ~all distros. (#4826, #4862)
77
- Revived dynamic-compile (JIT) functionality (formerly unsupported since LLVM 12), supporting LLVM 18+ now. (#4774)
88
- ldc2.conf: `%%ldcversion%%` placeholder added, allowing to refer to version-specific directories.
99
- Windows: The prebuilt packages now bundle an official libcurl build (from https://curl.se/windows/), currently v8.12.1. The static library (`curl_a.lib`) isn't available anymore. (#4855)

tests/dmd/fail_compilation/needspkgmod.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/*
1010
TEST_OUTPUT:
1111
----
12-
$r:.+_D7imports9pkgmod3133mod3barFZv.*$
12+
$r:.+(_D7imports9pkgmod3133mod3barFZv|imports\.pkgmod313\.mod\.bar).*$
1313
Error: $r:.+$ failed with status: $n$
1414
----
1515
*/

0 commit comments

Comments
 (0)