-
-
Notifications
You must be signed in to change notification settings - Fork 264
189 lines (177 loc) · 7.38 KB
/
supported_llvm_versions.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: Vanilla LLVM
on:
- pull_request
- push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
include:
- job_name: Ubuntu 20.04, LDC-LLVM 18, latest LDC beta
os: ubuntu-20.04
host_dc: ldc-beta
# FIXME: no usable official package available yet
llvm_version: https://github.com/ldc-developers/llvm-project/releases/download/ldc-v18.1.5/llvm-18.1.5-linux-x86_64.tar.xz
- job_name: macOS 14, LLVM 17, latest LDC beta
os: macos-14
host_dc: ldc-beta
llvm_version: 17.0.5
cmake_flags: -DBUILD_SHARED_LIBS=ON -DRT_SUPPORT_SANITIZERS=ON -DD_COMPILER_FLAGS=-gcc=/usr/bin/c++ -DCMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/opt/zstd/lib
- job_name: macOS 14, LLVM 16, latest LDC beta
os: macos-14
host_dc: ldc-beta
llvm_version: 16.0.5
cmake_flags: -DBUILD_SHARED_LIBS=OFF -DD_COMPILER_FLAGS=-gcc=/usr/bin/c++ -DCMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/opt/zstd/lib
- job_name: Ubuntu 20.04, LLVM 15, latest LDC beta
os: ubuntu-20.04
host_dc: ldc-beta
llvm_version: 15.0.6
- job_name: macOS 11, LLVM 14, latest DMD beta
os: macos-11
host_dc: dmd-beta
llvm_version: 14.0.6
cmake_flags: -DBUILD_SHARED_LIBS=ON -DRT_SUPPORT_SANITIZERS=ON -DLDC_LINK_MANUALLY=ON -DCMAKE_CXX_COMPILER=/usr/bin/c++ -DCMAKE_C_COMPILER=/usr/bin/cc
- job_name: Ubuntu 20.04, LLVM 13, latest LDC beta
os: ubuntu-20.04
host_dc: ldc-beta
llvm_version: 13.0.1
cmake_flags: -DRT_SUPPORT_SANITIZERS=ON
- job_name: Ubuntu 20.04, LLVM 12, bootstrap LDC
os: ubuntu-20.04
host_dc: ldc-1.19.0
llvm_version: 12.0.1
cmake_flags: -DBUILD_SHARED_LIBS=ON -DLIB_SUFFIX=64
- job_name: Ubuntu 20.04, LLVM 11, latest DMD beta
os: ubuntu-20.04
host_dc: dmd-beta
llvm_version: 11.1.0
cmake_flags: -DBUILD_SHARED_LIBS=OFF -DRT_SUPPORT_SANITIZERS=ON -DLDC_LINK_MANUALLY=ON
name: ${{ matrix.job_name }}
runs-on: ${{ matrix.os }}
env:
# silence `ld: warning: object file (…) was built for newer macOS version (…) than being linked (…)`
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-14' && '13.6' || '11.6' }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 50
- name: Install ninja
uses: symmetryinvestments/gha-setup-ninja@v2
- name: Install D host compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.host_dc }}
- name: Clear LD_LIBRARY_PATH to prevent loading host compiler libs
run: echo "LD_LIBRARY_PATH=" >> $GITHUB_ENV
- name: Install lit
run: |
set -euxo pipefail
if [[ '${{ matrix.os }}' == 'macos-14' ]]; then
brew install lit python-setuptools
else
python3 -m pip install --user setuptools wheel
python3 -m pip install --user lit
fi
python3 -c "import lit.main; lit.main.main();" --version . | head -n 1
- name: 'Linux: Install gdb, llvm-symbolizer and libzstd'
if: runner.os == 'Linux'
run: |
set -eux
sudo apt-get update
# Don't use latest gdb v10+ from Ubuntu toolchain PPA with regressions, use official v9
sudo apt-get install gdb=9.1-0ubuntu1 llvm libzstd-dev
- name: Try to restore cached LLVM
uses: actions/cache@v4
with:
path: llvm
key: llvm-${{ matrix.llvm_version }}-${{ runner.os }}
- name: Download & extract prebuilt vanilla LLVM ${{ matrix.llvm_version }}
run: |
set -eux
if [[ -d llvm ]]; then
echo "Already cached"
exit 0
fi
version='${{ matrix.llvm_version }}'
if [[ "$version" =~ ^https:// ]]; then
url="$version"
else
if [[ '${{ runner.os }}' == macOS ]]; then
if [[ "$version" =~ ^1[6-9]\. ]]; then
suffix='arm64-apple-darwin22.0'
else
suffix='x86_64-apple-darwin'
fi
elif [[ "$version" =~ ^1[7-9]\. ]]; then
suffix='x86_64-linux-gnu-ubuntu-22.04' # LLVM 17+
elif [[ "$version" =~ ^1[3-6]\. ]]; then
suffix='x86_64-linux-gnu-ubuntu-18.04' # LLVM 13.0.1+
else
suffix='x86_64-linux-gnu-ubuntu-16.04'
fi
url="https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/clang+llvm-$version-$suffix.tar.xz"
fi
curl -fL --retry 3 --max-time 300 -o llvm.tar.xz "$url"
mkdir llvm
tar -xf llvm.tar.xz --strip 1 -C llvm
rm llvm.tar.xz
# don't link lib{c++,unwind} libs from LLVM package, they'd need RPATH fiddling
if [[ '${{ runner.os }}' == macOS ]]; then
rm -f llvm/lib/lib{c++,unwind}.*
fi
- name: 'Linux: Make lld the default linker'
if: runner.os == 'Linux' && matrix.host_dc != 'ldc-1.9.0'
run: |
set -eux
echo "Using lld to work around sporadic failures"
sudo ln -sf "$PWD/llvm/bin/ld.lld" /usr/bin/ld
ld --version
- name: Build LDC & LDC D unittests & defaultlib unittest runners with extra '${{ matrix.cmake_flags }}'
run: |
set -eux
cmake -G Ninja . \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ROOT_DIR="$PWD/llvm" \
-DLDC_LINK_MANUALLY=OFF \
${{ matrix.cmake_flags }}
ninja obj/ldc2.o all ldc2-unittest all-test-runners
bin/ldc2 --version
- 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
# LLVM 14+ on Linux: don't use vanilla llvm-symbolizer (no support for zlib-compressed debug sections => failing ASan tests)
if [[ '${{ runner.os }}' == 'Linux' && ! '${{ matrix.llvm_version }}' =~ ^1[1-3]\. ]]; then
mv llvm/bin/llvm-symbolizer llvm/bin/llvm-symbolizer.bak
fi
ctest -V -R "lit-tests"
if [[ -f llvm/bin/llvm-symbolizer.bak ]]; then
mv llvm/bin/llvm-symbolizer.bak llvm/bin/llvm-symbolizer
fi
- name: Run DMD testsuite
if: success() || failure()
run: ctest -V -R "dmd-testsuite"
- name: Run defaultlib unittests & druntime integration tests
if: success() || failure()
run: |
set -eux
excludes='dmd-testsuite|lit-tests|ldc2-unittest'
if [[ '${{ runner.os }}' == macOS ]]; then
N=$(sysctl -n hw.logicalcpu)
if [[ '${{ matrix.os }}' == macos-14 ]]; then
# FIXME: crashes frequently with enabled optimizations on M1 runners
excludes+='|^std.internal.math.gammafunction(-shared)?$'
fi
else
N=$(nproc)
fi
ctest -j$N --output-on-failure -E "$excludes"