-
Notifications
You must be signed in to change notification settings - Fork 58
197 lines (193 loc) · 9.17 KB
/
clang-tools-amd64.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
190
191
192
193
194
195
196
197
name: clang-tools-static-amd64
#on:
# push:
# branches: [ master ]
jobs:
build:
strategy:
matrix:
clang-version: [ 3.9, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12.0.1, 13, 14, 15, 16, 17, 18 ]
os: [ linux, macosx, windows ]
include:
- clang-version: 3.9
release: llvm-project-3.9.1
- clang-version: 4
release: llvm-project-4.0.1
- clang-version: 5
release: llvm-project-5.0.2
- clang-version: 6
release: llvm-project-6.0.1
- clang-version: 7
release: llvm-project-7.1.0
- clang-version: 8
release: llvm-project-8.0.1
extra-cmake-args: '-DCLANG_ANALYZER_ENABLE_Z3_SOLVER=OFF'
- clang-version: 9
release: llvm-project-9.0.1
extra-cmake-args: '-DLLVM_ENABLE_Z3_SOLVER=OFF'
- clang-version: 10
release: llvm-project-10.0.1
extra-cmake-args: '-DLLVM_ENABLE_Z3_SOLVER=OFF'
- clang-version: 11
release: llvm-project-11.1.0.src
- clang-version: 12
release: llvm-project-12.0.0.src
- clang-version: 12.0.1
release: llvm-project-12.0.1.src
- clang-version: 13
release: llvm-project-13.0.0.src
- clang-version: 14
release: llvm-project-14.0.0.src
- clang-version: 15
release: llvm-project-15.0.2.src
- clang-version: 16
release: llvm-project-16.0.3.src
- clang-version: 17
release: llvm-project-17.0.4.src
- clang-version: 18
release: llvm-project-18.1.3.src
- os: linux
runner: ubuntu-20.04
os-cmake-args: '-DLLVM_BUILD_STATIC=ON -DCMAKE_CXX_FLAGS="-s -flto" ${POSIX_CMAKE_ARGS}'
build-args: '-j$(nproc)'
bindir: '/build/bin'
dotexe: ''
shacmd: 'sha512sum'
- os: macosx
runner: macos-11
os-cmake-args: '-DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++ -flto" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 ${POSIX_CMAKE_ARGS}'
build-args: '-j$(sysctl -n hw.ncpu)'
bindir: '/build/bin'
dotexe: ''
shacmd: 'shasum -a512'
- os: windows
runner: windows-latest
os-cmake-args: '-Thost=x64 -DCMAKE_CXX_FLAGS="/MP /std:c++14" -DLLVM_USE_CRT_MINSIZEREL="MT"'
build-args: '--config MinSizeRel'
bindir: '/build/MinSizeRel/bin'
dotexe: '.exe'
shacmd: 'sha512sum.exe'
extra-tar-args: '--exclude=${RELEASE}/clang/test/Driver/Inputs/* --exclude=${RELEASE}/libcxx/test/std/input.output/filesystems/Inputs/static_test_env/* --exclude=${RELEASE}/libclc/amdgcn-mesa3d'
extra-tar-args-cfe: '--exclude=cfe-${version}.src/test/Driver/Inputs/*'
runs-on: ${{ matrix.runner }}
env:
COMMON_CMAKE_ARGS: '-DBUILD_SHARED_LIBS=OFF -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra"'
POSIX_CMAKE_ARGS: '-DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_CXX_COMPILER=g++-10 -DCMAKE_C_COMPILER=gcc-10'
RELEASE: '${{ matrix.release }}'
suffix: '${{ matrix.clang-version }}_${{ matrix.os }}-amd64'
steps:
- name: download patches
# we download a tarball of this repo, as the presence of a .git directory leaks
# the commit hash of this repository into the clang binaries
shell: bash
run: curl -L https://github.com/${{ github.repository }}/archive/${{ github.ref }}.tar.gz | tar xvz --strip 1
- name: get llvm-project
if: ${{ matrix.clang-version < 7 }}
shell: bash
run: |
version=${RELEASE##llvm-project-}
curl -LO https://releases.llvm.org/${version}/llvm-${version}.src.tar.xz
curl -LO https://releases.llvm.org/${version}/cfe-${version}.src.tar.xz
curl -LO https://releases.llvm.org/${version}/clang-tools-extra-${version}.src.tar.xz
- name: get llvm-project
if: ${{ matrix.clang-version == 7 || matrix.clang-version == 8 }}
shell: bash
run: |
version=${RELEASE##llvm-project-}
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-${version}.src.tar.xz
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/cfe-${version}.src.tar.xz
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/clang-tools-extra-${version}.src.tar.xz
- name: get llvm-project
if: ${{ matrix.clang-version >= 9 || matrix.clang-version == '12.0.1' }}
shell: bash
run: |
version=${RELEASE##llvm-project-}; version=${version%.src}
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${{ matrix.release }}.tar.xz
- name: unpack llvm-project
if: ${{ matrix.clang-version < 9 }}
shell: bash
run: |
version=${RELEASE##llvm-project-}
tar xf llvm-${version}.src.tar.xz
tar xf cfe-${version}.src.tar.xz ${{ matrix.extra-tar-args-cfe }}
tar xf clang-tools-extra-${version}.src.tar.xz
mkdir ${{ matrix.release }}
mv llvm-${version}.src ${{ matrix.release }}/llvm
mv cfe-${version}.src ${{ matrix.release }}/clang
mv clang-tools-extra-${version}.src ${{ matrix.release }}/clang-tools-extra
- name: move clang 3.9 sources
if: ${{ matrix.clang-version == 3.9 }}
run: |
mv ${{ matrix.release }}/clang ${{ matrix.release }}/llvm/tools/clang
mv ${{ matrix.release }}/clang-tools-extra ${{ matrix.release }}/llvm/tools/clang/tools/extra
- name: unpack llvm-project
if: ${{ matrix.clang-version >= 9 || matrix.clang-version == '12.0.1' }}
shell: bash
run: |
tar xf ${{ matrix.release }}.tar.xz ${{ matrix.extra-tar-args }}
- name: patch clang-3.9 constify operator
if: ${{ matrix.clang-version == 3.9 && matrix.os == 'windows' }}
shell: bash
run: patch ${{ matrix.release }}/llvm/utils/TableGen/AsmWriterEmitter.cpp windows-clang-3.9_constify-operator.patch
- name: patch clang-8 includes
if: ${{ matrix.clang-version == 8 }}
shell: bash
run: patch ${{ matrix.release }}/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h include-cstdint-string-prior-to-using-uint8_t.patch
- name: patch trivially-copyable clang 9/10
if: ${{ ( matrix.clang-version == 9 || matrix.clang-version == 10 ) && matrix.os == 'windows' }}
shell: bash
run: patch ${{ matrix.release }}/llvm/cmake/config-ix.cmake windows-clang-9-10-trivially-copyable-mismatch.patch
- name: patch cmake implicit link libraries on macosx
if: ${{ matrix.os == 'macosx' }}
shell: bash
run: sed -i.backup 's/gcc_eh.\*|/gcc_eh.*|gcc_ext.*|/g' $(find /usr/local/Cellar -name CMakeParseImplicitLinkInfo.cmake)
- name: cmake
run: cmake -S ${{ matrix.release }}/llvm -B ${{ matrix.release }}/build ${{ env.COMMON_CMAKE_ARGS }} ${{ matrix.os-cmake-args }} ${{ matrix.extra-cmake-args }}
- name: build
run: cmake --build ${{ matrix.release }}/build ${{ matrix.build-args }} --target clang-format clang-query clang-tidy clang-apply-replacements
- name: print dependencies
if: ${{ matrix.os == 'macosx' }}
run: otool -L ${{ matrix.release }}/build/bin/clang-format
- name: rename output binary
run: |
cd ${{ matrix.release }}${{ matrix.bindir }}
mv clang-format${{ matrix.dotexe }} clang-format-${{ env.suffix }}${{ matrix.dotexe }}
mv clang-query${{ matrix.dotexe }} clang-query-${{ env.suffix }}${{ matrix.dotexe }}
mv clang-tidy${{ matrix.dotexe }} clang-tidy-${{ env.suffix }}${{ matrix.dotexe }}
mv clang-apply-replacements${{ matrix.dotexe }} clang-apply-replacements-${{ env.suffix }}${{ matrix.dotexe }}
- name: create and print sha512sum
shell: bash
run: |
cd ${{ matrix.release }}${{ matrix.bindir }}
${{ matrix.shacmd }} clang-format-${{ env.suffix }} > clang-format-${{ env.suffix }}.sha512sum
${{ matrix.shacmd }} clang-query-${{ env.suffix }} > clang-query-${{ env.suffix }}.sha512sum
${{ matrix.shacmd }} clang-tidy-${{ env.suffix }} > clang-tidy-${{ env.suffix }}.sha512sum
${{ matrix.shacmd }} clang-apply-replacements-${{ env.suffix }} > clang-apply-replacements-${{ env.suffix }}.sha512sum
echo "Checksums are: "
cat clang-format-${{ env.suffix }}.sha512sum
cat clang-query-${{ env.suffix }}.sha512sum
cat clang-tidy-${{ env.suffix }}.sha512sum
cat clang-apply-replacements-${{ env.suffix }}.sha512sum
- name: upload artifacts
uses: actions/upload-artifact@v2
with:
name: clang-tools
path: "${{ matrix.release }}${{ matrix.bindir }}/clang-*-${{ env.suffix }}*"
retention-days: 1
draft-release:
runs-on: ubuntu-20.04
needs: build
steps:
- name: download artifacts
uses: actions/download-artifact@v2
with:
name: clang-tools
- name: list files
run: ls -laR .
- name: draft release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "clang-*"
draft: true