|
| 1 | +name: CI libgccjit 12 |
| 2 | + |
| 3 | +on: |
| 4 | + - push |
| 5 | + - pull_request |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + |
| 10 | +env: |
| 11 | + # Enable backtraces for easier debugging |
| 12 | + RUST_BACKTRACE: 1 |
| 13 | + TEST_FLAGS: "-Cpanic=abort -Zpanic-abort-tests" |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + runs-on: ubuntu-22.04 |
| 18 | + |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + commands: [ |
| 23 | + "--mini-tests", |
| 24 | + # TODO(antoyo): re-enable those commands when the build with libgccjit 12 is fixed. |
| 25 | + #"--std-tests", |
| 26 | + # FIXME: re-enable asm tests when GCC can emit in the right syntax. |
| 27 | + # "--asm-tests", |
| 28 | + #"--test-libcore", |
| 29 | + #"--extended-rand-tests", |
| 30 | + #"--extended-regex-example-tests", |
| 31 | + #"--extended-regex-tests", |
| 32 | + #"--test-successful-rustc --nb-parts 2 --current-part 0", |
| 33 | + #"--test-successful-rustc --nb-parts 2 --current-part 1", |
| 34 | + #"--test-failing-rustc", |
| 35 | + ] |
| 36 | + |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v3 |
| 39 | + |
| 40 | + - uses: actions/checkout@v3 |
| 41 | + with: |
| 42 | + repository: llvm/llvm-project |
| 43 | + path: llvm |
| 44 | + |
| 45 | + - name: Install packages |
| 46 | + # `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests. |
| 47 | + run: sudo apt-get install ninja-build ripgrep llvm-14-tools libgccjit-12-dev |
| 48 | + |
| 49 | + - name: Setup path to libgccjit |
| 50 | + run: echo /usr/lib/gcc/x86_64-linux-gnu/12 > gcc_path |
| 51 | + |
| 52 | + - name: Set env |
| 53 | + run: | |
| 54 | + echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV |
| 55 | + echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV |
| 56 | + echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV |
| 57 | +
|
| 58 | + - name: Set RUST_COMPILER_RT_ROOT |
| 59 | + run: echo "RUST_COMPILER_RT_ROOT="${{ env.workspace }}/llvm/compiler-rt >> $GITHUB_ENV |
| 60 | + |
| 61 | + - name: Cache cargo installed crates |
| 62 | + uses: actions/cache@v3 |
| 63 | + with: |
| 64 | + path: ~/.cargo/bin |
| 65 | + key: cargo-installed-crates2-ubuntu-latest |
| 66 | + |
| 67 | + - name: Cache cargo registry |
| 68 | + uses: actions/cache@v3 |
| 69 | + with: |
| 70 | + path: ~/.cargo/registry |
| 71 | + key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }} |
| 72 | + |
| 73 | + - name: Cache cargo index |
| 74 | + uses: actions/cache@v3 |
| 75 | + with: |
| 76 | + path: ~/.cargo/git |
| 77 | + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} |
| 78 | + |
| 79 | + - name: Cache cargo target dir |
| 80 | + uses: actions/cache@v3 |
| 81 | + with: |
| 82 | + path: target |
| 83 | + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }} |
| 84 | + |
| 85 | + #- name: Cache rust repository |
| 86 | + ## We only clone the rust repository for rustc tests |
| 87 | + #if: ${{ contains(matrix.commands, 'rustc') }} |
| 88 | + #uses: actions/cache@v3 |
| 89 | + #id: cache-rust-repository |
| 90 | + #with: |
| 91 | + #path: rust |
| 92 | + #key: ${{ runner.os }}-packages-${{ hashFiles('rust/.git/HEAD') }} |
| 93 | + |
| 94 | + - name: Build |
| 95 | + run: | |
| 96 | + ./y.sh prepare --only-libcore |
| 97 | + # TODO(antoyo): build the sysroot when the build with libgccjit 12 is fixed. |
| 98 | + #./y.sh build --no-default-features |
| 99 | + # TODO(antoyo): run the tests when we can build the sysroot with libgccjit 12. |
| 100 | + #cargo test --no-default-features |
| 101 | + ./clean_all.sh |
| 102 | +
|
| 103 | + - name: Prepare dependencies |
| 104 | + run: | |
| 105 | + git config --global user.email "[email protected]" |
| 106 | + git config --global user.name "User" |
| 107 | + ./y.sh prepare |
| 108 | +
|
| 109 | + # Compile is a separate step, as the actions-rs/cargo action supports error annotations |
| 110 | + - name: Compile |
| 111 | + uses: actions-rs/[email protected] |
| 112 | + with: |
| 113 | + command: build |
| 114 | + args: --release |
| 115 | + |
| 116 | + - name: Add more failing tests for GCC 12 |
| 117 | + run: cat failing-ui-tests12.txt >> failing-ui-tests.txt |
| 118 | + |
| 119 | + - name: Run tests |
| 120 | + run: | |
| 121 | + # TODO(antoyo): add --build-sysroot when the build with libgccjit 12 is fixed. |
| 122 | + # FIXME(antoyo): we need to set GCC_EXEC_PREFIX so that the linker can find the linker plugin. |
| 123 | + # Not sure why it's not found otherwise. |
| 124 | + GCC_EXEC_PREFIX=/usr/lib/gcc/ ./test.sh --release --clean ${{ matrix.commands }} --no-default-features |
0 commit comments