|
5 | 5 | tags:
|
6 | 6 | - 'v*'
|
7 | 7 |
|
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
8 | 12 | jobs:
|
9 |
| - build-x64-linux: |
| 13 | + build-linux: |
10 | 14 | timeout-minutes: 360
|
11 |
| - env: |
12 |
| - VCPKG_DEP_LIST: x64-linux |
13 |
| - VCPKG_FEATURE_FLAGS: -binarycaching |
14 |
| - runs-on: [self-hosted, linux, X64, dep-builder] |
| 15 | + container: |
| 16 | + image: nebulastream/nes-development-base:latest |
| 17 | + volumes: |
| 18 | + - ccache:/ccache |
| 19 | + env: |
| 20 | + CCACHE_DIR: /ccache |
| 21 | + MOLD_JOBS: 1 |
| 22 | + options: --user root |
15 | 23 | strategy:
|
16 | 24 | fail-fast: false
|
17 | 25 | matrix:
|
18 |
| - osversion: [ubuntu-22.04] |
19 |
| - stdlib: [libc++, stdlibc++] |
20 |
| - sanitizer: [null, 'Address', 'Thread', 'Undefined'] |
21 |
| - steps: |
22 |
| - - uses: AutoModality/action-clean@v1 |
23 |
| - - uses: actions/checkout@v2 |
24 |
| - with: |
25 |
| - submodules: 'recursive' |
26 |
| - - name: Set output vars to the actual tag name |
27 |
| - id: vars |
28 |
| - run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} |
29 |
| - - name: Build Docker |
30 |
| - id: builddocker |
31 |
| - working-directory: ${{ github.workspace }}/docker/ |
32 |
| - run: docker build -t nes_clang_build_${{ matrix.osversion }} -f Dockerfile-${{ matrix.osversion }} . |
33 |
| - - name: Build Clang |
34 |
| - id: installdeps |
35 |
| - run: | |
36 |
| - echo "${{ matrix.stdlib }}" |
37 |
| - docker run -v ${{ github.workspace }}:/build_dir -e ENABLE_SANITIZER=${{ matrix.sanitizer || '' }} -e STDLIB=${{ matrix.stdlib }} --rm nes_clang_build_${{ matrix.osversion }} \ |
38 |
| - ./build_dir/build_ubuntu-x64.sh |
39 |
| - - name: Compress artifacts |
40 |
| - id: compressdeps |
41 |
| - run: | |
42 |
| - 7z a nes-clang-18-${{ matrix.osversion }}-${{ matrix.stdlib }}-X64-${{ matrix.sanitizer || 'None' }}.7z clang -mx9 -aoa |
43 |
| - - name: Release |
44 |
| - uses: softprops/action-gh-release@v1 |
45 |
| - id: createrelease |
46 |
| - with: |
47 |
| - files: | |
48 |
| - nes-clang-18-${{ matrix.osversion }}-${{ matrix.stdlib }}-X64-${{ matrix.sanitizer || 'None' }}.7z |
49 |
| - - name: Clean build artifacts |
50 |
| - id: cleanbuildartifacts |
51 |
| - if: always() |
52 |
| - run: | |
53 |
| - rm -rf llvm-project |
54 |
| - rm -rf .git |
55 |
| - rm -rf clang |
56 |
| - - name: Remove docker image |
57 |
| - id: removedockerimage |
58 |
| - if: always() |
59 |
| - run: | |
60 |
| - test -n "$(docker image ls -q nes_clang_build_${{ matrix.osversion }})" && \ |
61 |
| - docker image rm $(docker image ls -q nes_clang_build_${{ matrix.osversion }}) || \ |
62 |
| - true |
63 |
| - build-arm-linux: |
64 |
| - env: |
65 |
| - VCPKG_DEP_LIST: arm64-linux |
66 |
| - VCPKG_FEATURE_FLAGS: -binarycaching |
67 |
| - runs-on: [self-hosted, linux, ARM64, dep-builder] |
68 |
| - strategy: |
69 |
| - matrix: |
70 |
| - osversion: [ubuntu-22.04] |
71 |
| - stdlib: [libc++, stdlibc++] |
| 26 | + arch: [x64, arm64] |
| 27 | + stdlib: [libcxx, libstdcxx] |
72 | 28 | sanitizer: [null, 'Address', 'Thread', 'Undefined']
|
| 29 | + exclude: |
| 30 | + - arch: arm64 |
| 31 | + stdlib: libstdcxx |
| 32 | + runs-on: [self-hosted, linux, "${{ matrix.arch }}", dep-builder] |
73 | 33 | steps:
|
74 | 34 | - uses: AutoModality/action-clean@v1
|
75 |
| - - uses: actions/checkout@v2 |
| 35 | + - uses: actions/checkout@v4 |
76 | 36 | with:
|
77 | 37 | submodules: 'recursive'
|
78 |
| - - name: Set output vars to the actual tag name |
79 |
| - id: vars |
80 |
| - run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} |
81 |
| - - name: Build Docker |
82 |
| - id: builddocker |
83 |
| - working-directory: ${{ github.workspace }}/docker/ |
84 |
| - run: docker build -t nes_clang_build_${{ matrix.osversion }} -f Dockerfile-${{ matrix.osversion }} . |
85 | 38 | - name: Build Clang
|
| 39 | + shell: bash |
86 | 40 | id: installdeps
|
87 | 41 | run: |
|
88 |
| - docker run -v ${{ github.workspace }}:/build_dir -e ENABLE_SANITIZER=${{ matrix.sanitizer || '' }} -e STDLIB=${{ matrix.stdlib }} --rm nes_clang_build_${{ matrix.osversion }} \ |
89 |
| - ./build_dir/build_ubuntu-arm64.sh |
90 |
| - - name: Compress artifacts |
91 |
| - id: compressdeps |
92 |
| - run: | |
93 |
| - 7z a nes-clang-18-${{ matrix.osversion }}-${{ matrix.stdlib }}-arm64-${{ matrix.sanitizer || 'None' }}.7z clang -mx9 -aoa |
| 42 | + if [[ "${{ matrix.stdlib }}" == "libcxx" ]]; then |
| 43 | + CXX_FLAGS="-stdlib=libc++ -std=c++20" |
| 44 | + LINKER_FLAGS="-lc++" |
| 45 | + elif [[ "${{ matrix.stdlib }}" == "libstdcxx" ]]; then |
| 46 | + CXX_FLAGS="-std=c++20" |
| 47 | + LINKER_FLAGS="" |
| 48 | + fi |
| 49 | +
|
| 50 | + if [[ ! -z "${{ matrix.sanitizer || '' }}" ]]; then |
| 51 | + ADDITIONAL_FLAGS="${ADDITIONAL_FLAGS} -DLLVM_USE_SANITIZER=${ENABLE_SANITIZER}" |
| 52 | + fi |
| 53 | +
|
| 54 | + export CXXFLAGS=${CXX_FLAGS} |
| 55 | + export LDFLAGS="${LINKER_FLAGS} -fuse-ld=mold" |
| 56 | +
|
| 57 | + cmake -G Ninja -S llvm-project/llvm -B build -DCMAKE_BUILD_TYPE=Release \ |
| 58 | + -DLLVM_ENABLE_PROJECTS="mlir" \ |
| 59 | + -DBOOTSTRAP_LLVM_ENABLE_LTO=ON \ |
| 60 | + -DLLVM_INCLUDE_EXAMPLES=OFF \ |
| 61 | + -DLLVM_INCLUDE_TESTS=OFF \ |
| 62 | + -DLLVM_INCLUDE_BENCHMARKS=OFF \ |
| 63 | + -DLLVM_BUILD_EXAMPLES=OFF \ |
| 64 | + -DLLVM_CCACHE_BUILD=ON \ |
| 65 | + -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ |
| 66 | + -DLLVM_OPTIMIZED_TABLEGEN=ON \ |
| 67 | + -DCMAKE_INSTALL_PREFIX="/build_dir/clang" \ |
| 68 | + -DLLVM_TARGETS_TO_BUILD="X86;AArch64" \ |
| 69 | + -DLLVM_BUILD_TOOLS=ON \ |
| 70 | + -DLLVM_ENABLE_TERMINFO=OFF \ |
| 71 | + -DLLVM_ENABLE_Z3_SOLVER=OFF \ |
| 72 | + ${ADDITIONAL_FLAGS} |
| 73 | +
|
| 74 | + cmake --build build --target install -j$(nproc) |
| 75 | + cd /build_dir/ |
| 76 | + tar -czvf nes-clang-18-${{ matrix.stdlib }}-${{ matrix.arch }}-${{ matrix.sanitizer || 'None' }}.tar.gz clang |
94 | 77 | - name: Release
|
95 | 78 | uses: softprops/action-gh-release@v1
|
96 | 79 | id: createrelease
|
97 | 80 | with:
|
98 | 81 | files: |
|
99 |
| - nes-clang-18-${{ matrix.osversion }}-${{ matrix.stdlib }}-arm64-${{ matrix.sanitizer || 'None' }}.7z |
100 |
| - - name: Clean build artifacts |
101 |
| - id: cleanbuildartifacts |
102 |
| - if: always() |
103 |
| - run: | |
104 |
| - rm -rf clang |
105 |
| - rm -rf llvm-project |
106 |
| - rm -rf .git |
107 |
| - - name: Remove docker image |
108 |
| - id: removedockerimage |
109 |
| - if: always() |
110 |
| - run: | |
111 |
| - test -n "$(docker image ls -q nes_clang_build_${{ matrix.osversion }})" && \ |
112 |
| - docker image rm $(docker image ls -q nes_clang_build_${{ matrix.osversion }}) || \ |
113 |
| - true |
| 82 | + /build_dir/nes-clang-18-${{ matrix.stdlib }}-${{ matrix.arch }}-${{ matrix.sanitizer || 'None' }}.tar.gz |
114 | 83 |
|
0 commit comments