Skip to content

Commit 7ca007b

Browse files
committed
[GHA: Stress test macOS jobs]
1 parent 6ebbf82 commit 7ca007b

File tree

2 files changed

+43
-169
lines changed

2 files changed

+43
-169
lines changed

.github/actions/7-package/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ runs:
170170
run: mv ../artifacts ./
171171

172172
- name: Upload artifact(s)
173+
if: runner.os != 'macOS'
173174
uses: actions/upload-artifact@v4
174175
with:
175176
name: ${{ env.ARTIFACT_NAME }}

.github/workflows/main.yml

Lines changed: 42 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -23,93 +23,75 @@ jobs:
2323
matrix:
2424
include:
2525

26-
- job_name: Linux x86_64 multilib
27-
os: ubuntu-22.04
26+
- job_name: macOS x86_64_1
27+
os: macos-13
2828
arch: x86_64
29-
# To improve portability of the generated binaries, link the C++ standard library statically.
29+
# https://github.com/ldc-developers/ldc/issues/4462:
30+
# When using LTO, we need to explicitly export ~all symbols for plugin support via `ld64 -exported_symbol '__*'`.
31+
# Additionally `-w` to suppress resulting linker warnings.
3032
extra_cmake_flags: >-
31-
-DMULTILIB=ON
32-
-DCMAKE_C_COMPILER=clang
33-
-DCMAKE_CXX_COMPILER=clang++
34-
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
35-
-DJITRT_EXTRA_LDFLAGS=-static-libstdc++
36-
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
33+
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
3734
-DEXTRA_CXXFLAGS=-flto=full
3835
with_pgo: true
39-
40-
- job_name: Linux aarch64
41-
os: ubuntu-22.04-arm
42-
arch: aarch64
36+
- job_name: macOS x86_64_2
37+
os: macos-13
38+
arch: x86_64
4339
extra_cmake_flags: >-
44-
-DCMAKE_C_COMPILER=clang
45-
-DCMAKE_CXX_COMPILER=clang++
46-
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
47-
-DJITRT_EXTRA_LDFLAGS=-static-libstdc++
48-
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
40+
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
4941
-DEXTRA_CXXFLAGS=-flto=full
5042
with_pgo: true
51-
52-
- job_name: Alpine musl x86_64
53-
os: ubuntu-latest
54-
container_image: alpine:3.21
43+
- job_name: macOS x86_64_3
44+
os: macos-13
5545
arch: x86_64
56-
base_cmake_flags: >-
57-
-DLDC_INSTALL_LLVM_RUNTIME_LIBS_ARCH=x86_64
58-
-DLLVM_IS_SHARED=OFF
59-
-DLDC_ENABLE_PLUGINS=OFF
60-
-DLDC_DYNAMIC_COMPILE=OFF
61-
# TSan and XRay do not work.
6246
extra_cmake_flags: >-
63-
-DTEST_COMPILER_RT_LIBRARIES="profile;lsan;asan;msan;fuzzer"
64-
-DLDC_INSTALL_LTOPLUGIN=OFF
65-
-DLDC_FULLY_STATIC=ON
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"
47+
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
7048
-DEXTRA_CXXFLAGS=-flto=full
7149
with_pgo: true
72-
73-
- job_name: macOS x86_64
50+
- job_name: macOS x86_64_4
51+
os: macos-13
52+
arch: x86_64
53+
extra_cmake_flags: >-
54+
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
55+
-DEXTRA_CXXFLAGS=-flto=full
56+
with_pgo: true
57+
- job_name: macOS x86_64_5
7458
os: macos-13
7559
arch: x86_64
76-
# https://github.com/ldc-developers/ldc/issues/4462:
77-
# When using LTO, we need to explicitly export ~all symbols for plugin support via `ld64 -exported_symbol '__*'`.
78-
# Additionally `-w` to suppress resulting linker warnings.
7960
extra_cmake_flags: >-
8061
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
8162
-DEXTRA_CXXFLAGS=-flto=full
8263
with_pgo: true
8364

84-
- job_name: macOS arm64
65+
- job_name: macOS arm64_1
8566
os: macos-14
8667
arch: arm64
8768
extra_cmake_flags: >-
8869
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
8970
# -DEXTRA_CXXFLAGS=-flto=full
9071
with_pgo: true
91-
92-
- job_name: Windows x64
93-
os: windows-2025
94-
arch: x64
95-
base_cmake_flags: >-
96-
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
72+
- job_name: macOS arm64_2
73+
os: macos-14
74+
arch: arm64
9775
extra_cmake_flags: >-
98-
"-DD_COMPILER_FLAGS=-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
99-
-DEXTRA_CXXFLAGS=-flto=full
76+
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
10077
with_pgo: true
101-
102-
- job_name: Windows x86
103-
os: windows-2025
104-
arch: x86
105-
base_cmake_flags: >-
106-
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
107-
# `RT_CFLAGS=-m32` needed to make 64-bit clang-cl output 32-bit code for druntime integration tests
78+
- job_name: macOS arm64_3
79+
os: macos-14
80+
arch: arm64
10881
extra_cmake_flags: >-
109-
-DRT_CFLAGS=-m32
110-
# Undefined symbol errors with FullLTO; ThinLTO used to work, but apparently miscompiles a lexer.d:138 assertion since v1.33.
111-
# "-DD_COMPILER_FLAGS=-O -flto=thin -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
112-
# -DEXTRA_CXXFLAGS=-flto=thin
82+
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
83+
with_pgo: true
84+
- job_name: macOS arm64_4
85+
os: macos-14
86+
arch: arm64
87+
extra_cmake_flags: >-
88+
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
89+
with_pgo: true
90+
- job_name: macOS arm64_5
91+
os: macos-14
92+
arch: arm64
93+
extra_cmake_flags: >-
94+
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
11395
with_pgo: true
11496

11597
name: ${{ matrix.job_name }}
@@ -225,112 +207,3 @@ jobs:
225207
with:
226208
arch: ${{ matrix.arch }}
227209
os: ${{ startsWith(matrix.container_image, 'alpine') && 'alpine' || '' }}
228-
229-
230-
# Cross-compilation jobs for non-native targets.
231-
# druntime/Phobos/LDC unittests aren't built; all test stages are skipped.
232-
build-cross:
233-
strategy:
234-
fail-fast: false
235-
matrix:
236-
include:
237-
238-
- job_name: Android armv7a
239-
host_os: ubuntu-22.04
240-
os: android
241-
arch: armv7a
242-
android_x86_arch: i686
243-
244-
- job_name: Android aarch64
245-
host_os: ubuntu-22.04
246-
os: android
247-
arch: aarch64
248-
android_x86_arch: x86_64
249-
extra_cmake_flags: >-
250-
-DLDC_INSTALL_LLVM_RUNTIME_LIBS_ARCH=aarch64-android
251-
252-
name: ${{ matrix.job_name }}
253-
runs-on: ${{ matrix.host_os }}
254-
timeout-minutes: 60
255-
steps:
256-
- uses: actions/checkout@v4
257-
with:
258-
submodules: true
259-
fetch-depth: 50
260-
- name: Install prerequisites
261-
uses: ./.github/actions/1-setup
262-
with:
263-
llvm_version: ${{ env.LLVM_VERSION }}
264-
arch: x86_64
265-
- name: Build bootstrap LDC
266-
uses: ./.github/actions/2-build-bootstrap
267-
- name: Build LDC with PGO instrumentation & gather profile from compiling default libs
268-
if: matrix.with_pgo
269-
uses: ./.github/actions/2a-build-pgo
270-
- name: Cross-compile LDC to ${{ matrix.os }}-${{ matrix.arch }}
271-
uses: ./.github/actions/3-build-cross
272-
with:
273-
arch: ${{ matrix.arch }}
274-
os: ${{ matrix.os }}
275-
llvm_version: ${{ env.LLVM_VERSION }}
276-
cmake_flags: ${{ matrix.extra_cmake_flags }}
277-
with_pgo: ${{ matrix.with_pgo }}
278-
279-
- name: Install LDC & make portable
280-
uses: ./.github/actions/5-install
281-
with:
282-
cross_compiling: true
283-
- name: 'Android: Cross-compile ${{ matrix.android_x86_arch }} libraries & copy to install dir'
284-
if: matrix.os == 'android'
285-
uses: ./.github/actions/5a-android-x86
286-
with:
287-
arch: ${{ matrix.android_x86_arch }}
288-
289-
- name: Create package & upload artifact(s)
290-
uses: ./.github/actions/7-package
291-
with:
292-
arch: ${{ matrix.arch }}
293-
os: ${{ matrix.os }}
294-
cross_target_triple: ${{ env.CROSS_TRIPLE }}
295-
296-
297-
merge-macos:
298-
name: macOS universal
299-
runs-on: macos-latest
300-
timeout-minutes: 30
301-
needs: build-native
302-
steps:
303-
- uses: actions/checkout@v4
304-
- name: Merge x86_64 & arm64 packages to universal one
305-
uses: ./.github/actions/merge-macos
306-
307-
merge-windows:
308-
name: Windows multilib
309-
runs-on: windows-2025
310-
timeout-minutes: 30
311-
needs: build-native
312-
steps:
313-
- uses: actions/checkout@v4
314-
with:
315-
submodules: true
316-
fetch-depth: 50
317-
- name: Merge x64 & x86 packages to multilib one & build installer
318-
uses: ./.github/actions/merge-windows
319-
320-
321-
upload-to-github:
322-
name: Upload to GitHub
323-
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
324-
runs-on: ubuntu-latest
325-
timeout-minutes: 30
326-
needs:
327-
- build-native
328-
- build-cross
329-
- merge-macos
330-
- merge-windows
331-
permissions:
332-
contents: write
333-
steps:
334-
- uses: actions/checkout@v4
335-
- name: Upload all artifacts to GitHub release
336-
uses: ./.github/actions/upload-to-github

0 commit comments

Comments
 (0)