Skip to content

Commit 402ce58

Browse files
committed
Main CI: Switch macOS x86_64 job to Homebrew clang 21 too
Don't just use Homebrew clang 21 for macOS arm64, but x86_64 too, as LDC-LLVM uses it consistently too now. Also bump the macOS x86_64 image from macos-13 to macos-15-intel (while using macos-15 for macOS arm64). The Homebrew clang 21 apparently needs 2 tweaks: * use in combination with the Command Line Tools, not Xcode * remove the bundled libc++ headers, using the macOS ones instead (matching the *linked* libc++)
1 parent 158a8f0 commit 402ce58

File tree

3 files changed

+29
-11
lines changed

3 files changed

+29
-11
lines changed

.github/actions/1-setup/action.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,19 @@ runs:
4949
sudo ln -sf $tool-21 /usr/bin/$tool
5050
$tool --version
5151
done
52-
- name: 'macOS arm64: Install Homebrew clang 21' # see mimalloc comment in ../3-build-native/action.yml
53-
if: runner.os == 'macOS' && inputs.arch == 'arm64'
52+
- name: 'macOS: Install Homebrew clang and lld 21' # see mimalloc comment in ../3-build-native/action.yml
53+
if: runner.os == 'macOS'
5454
shell: bash
55-
run: brew install llvm@21
55+
run: |
56+
set -eux
57+
brew install llvm@21 lld@21
58+
# https://github.com/llvm/llvm-project/issues/155531#issuecomment-3229499205
59+
if [[ '${{ inputs.arch }}' == arm64 ]]; then
60+
prefix="/opt/homebrew/opt/llvm"
61+
else
62+
prefix="/usr/local/opt/llvm"
63+
fi
64+
rm -rf "$prefix/include/c++/v1"
5665
- name: 'Windows: Install clang v21.1.5 from GitHub'
5766
if: runner.os == 'Windows'
5867
shell: bash
@@ -133,7 +142,7 @@ runs:
133142
run: |
134143
set -euxo pipefail
135144
python3 --version
136-
if [[ '${{ runner.os }}-${{ inputs.arch }}' == 'macOS-arm64' ]]; then
145+
if [[ '${{ runner.os }}' == 'macOS' ]]; then
137146
brew install lit
138147
else
139148
python3 -m pip install --user lit psutil

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ runs:
3333
if [[ '${{ runner.os }}' == macOS ]]; then
3434
# FIXME: https://github.com/dlang/phobos/issues/10730
3535
excludes+='|^std.experimental.allocator.building_blocks.allocator_list'
36+
if [[ '${{ inputs.arch }}' == x86_64 ]]; then
37+
# FIXME: regressed with image bump from macos-13 to macos-15-intel, apparently wrt. getpwnam_r() setting unexpected errno
38+
excludes+='|^std.path'
39+
fi
3640
fi
3741
3842
ctest -j$N --output-on-failure -E "$excludes" --timeout 120

.github/workflows/main.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
env:
17-
LLVM_VERSION: c922a5f9
17+
LLVM_VERSION: 0b762af9
1818

1919
jobs:
2020
build-native:
@@ -71,12 +71,16 @@ jobs:
7171
with_pgo: true
7272

7373
- job_name: macOS x86_64
74-
os: macos-13
74+
os: macos-15-intel
7575
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.
76+
# * CMAKE_OSX_SYSROOT: Homebrew clang apparently requires the Command Line Tools instead of Xcode: https://github.com/actions/runner-images/issues/10035#issue-2344536514
77+
# * https://github.com/ldc-developers/ldc/issues/4462:
78+
# When using LTO, we need to explicitly export ~all symbols for plugin support via `ld64 -exported_symbol '__*'`.
79+
# Additionally `-w` to suppress resulting linker warnings.
7980
extra_cmake_flags: >-
81+
-DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
82+
-DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang
83+
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++
8084
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
8185
-DEXTRA_CXXFLAGS=-flto=full
8286
with_pgo: true
@@ -85,8 +89,9 @@ jobs:
8589
os: macos-15
8690
arch: arm64
8791
extra_cmake_flags: >-
88-
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm@21/bin/clang
89-
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@21/bin/clang++
92+
-DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
93+
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang
94+
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++
9095
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
9196
-DEXTRA_CXXFLAGS=-flto=full
9297
with_pgo: true

0 commit comments

Comments
 (0)