|
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 |
15 | 17 | strategy:
|
16 | 18 | fail-fast: false
|
17 | 19 | matrix:
|
18 |
| - osversion: [ubuntu-22.04] |
| 20 | + arch: [x64, arm64] |
19 | 21 | stdlib: [libc++, stdlibc++]
|
20 | 22 | sanitizer: [null, 'Address', 'Thread', 'Undefined']
|
| 23 | + runs-on: [self-hosted, linux, "${{ matrix.arch }}", dep-builder] |
21 | 24 | steps:
|
22 | 25 | - uses: AutoModality/action-clean@v1
|
23 |
| - - uses: actions/checkout@v2 |
| 26 | + - uses: actions/checkout@v4 |
24 | 27 | with:
|
25 | 28 | 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 | 29 | - name: Build Clang
|
| 30 | + shell: bash |
34 | 31 | id: installdeps
|
35 | 32 | 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++] |
72 |
| - sanitizer: [null, 'Address', 'Thread', 'Undefined'] |
73 |
| - steps: |
74 |
| - - uses: AutoModality/action-clean@v1 |
75 |
| - - uses: actions/checkout@v2 |
76 |
| - with: |
77 |
| - 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 |
| - - name: Build Clang |
86 |
| - id: installdeps |
87 |
| - 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 |
| 33 | + if [[ "${{ matrix.stdlib }}" == "libc++" ]]; then |
| 34 | + CXX_FLAGS="-stdlib=libc++ -std=c++20" |
| 35 | + LINKER_FLAGS="-lc++" |
| 36 | + elif [[ "${{ matrix.stdlib }}" == "stdlibc++" ]]; then |
| 37 | + CXX_FLAGS="-std=c++20" |
| 38 | + LINKER_FLAGS="" |
| 39 | + fi |
| 40 | +
|
| 41 | + if [[ ! -z "${{ matrix.sanitizer || '' }}" ]]; then |
| 42 | + ADDITIONAL_FLAGS="${ADDITIONAL_FLAGS} -DLLVM_USE_SANITIZER=${ENABLE_SANITIZER}" |
| 43 | + fi |
| 44 | +
|
| 45 | + export CXXFLAGS=${CXX_FLAGS} |
| 46 | + export LDFLAGS="${LINKER_FLAGS} -fuse-ld=mold" |
| 47 | +
|
| 48 | + cmake -G Ninja -S llvm-project/llvm -B build -DCMAKE_BUILD_TYPE=Release \ |
| 49 | + -DLLVM_ENABLE_PROJECTS="mlir" \ |
| 50 | + -DBOOTSTRAP_LLVM_ENABLE_LTO=ON \ |
| 51 | + -DLLVM_INCLUDE_EXAMPLES=OFF \ |
| 52 | + -DLLVM_INCLUDE_TESTS=OFF \ |
| 53 | + -DLLVM_INCLUDE_BENCHMARKS=OFF \ |
| 54 | + -DLLVM_BUILD_EXAMPLES=OFF \ |
| 55 | + -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ |
| 56 | + -DLLVM_OPTIMIZED_TABLEGEN=ON \ |
| 57 | + -DCMAKE_INSTALL_PREFIX="/build_dir/clang" \ |
| 58 | + -DLLVM_TARGETS_TO_BUILD="X86, AArch64" \ |
| 59 | + -DLLVM_BUILD_TOOLS=ON \ |
| 60 | + -DLLVM_ENABLE_TERMINFO=OFF \ |
| 61 | + -DLLVM_ENABLE_Z3_SOLVER=OFF \ |
| 62 | + ${ADDITIONAL_FLAGS} |
| 63 | +
|
| 64 | + cmake --build build --target install -j$(nproc) |
| 65 | + 7z a nes-clang-18-${{ matrix.stdlib }}-X64-${{ matrix.sanitizer || 'None' }}.7z /build_dir/clang -mx9 -aoa |
94 | 66 | - name: Release
|
95 | 67 | uses: softprops/action-gh-release@v1
|
96 | 68 | id: createrelease
|
97 | 69 | with:
|
98 | 70 | 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 |
| 71 | + nes-clang-18-${{ matrix.stdlib }}-X64-${{ matrix.sanitizer || 'None' }}.7z |
114 | 72 |
|
0 commit comments