Skip to content

Commit

Permalink
Build only things we are interested in
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum5 committed Sep 22, 2021
1 parent a37b22c commit 5ea3d18
Showing 1 changed file with 2 additions and 97 deletions.
99 changes: 2 additions & 97 deletions .github/workflows/clang-tools-amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,9 @@ jobs:
build:
strategy:
matrix:
clang-version: [ 3.9, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
os: [ linux, macosx, windows ]
clang-version: [ 12 ]
os: [ linux ]
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
- os: linux
Expand All @@ -41,96 +20,22 @@ jobs:
bindir: '/build/bin'
dotexe: ''
shacmd: 'sha512sum'
- os: macosx
runner: macos-latest
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 }}
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 }}
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
Expand Down

0 comments on commit 5ea3d18

Please sign in to comment.