compiler/rustc_codegen_gcc/.github/workflows/release.yml YAML 126 lines View on github.com → Search inside
1name: CI with sysroot compiled in release mode23on:4  push:5    branches:6      - master7  pull_request:89permissions:10  contents: read1112env:13  # Enable backtraces for easier debugging14  RUST_BACKTRACE: 115  # For the run-make tests.16  LLVM_BIN_DIR: /usr/bin1718jobs:19  build:20    runs-on: ubuntu-24.042122    strategy:23      fail-fast: false24      matrix:25        commands: [26          "--test-successful-rustc --nb-parts 2 --current-part 0",27          "--test-successful-rustc --nb-parts 2 --current-part 1",28        ]2930    steps:31    - uses: actions/checkout@v43233    # `rustup show` installs from rust-toolchain.toml34    - name: Setup rust toolchain35      run: rustup show3637    - name: Setup rust cache38      uses: Swatinem/rust-cache@v23940    - name: Install packages41      # `llvm-14-tools` is needed to install the `FileCheck` binary which is used for run-make tests.42      run: sudo apt-get install ninja-build ripgrep llvm-14-tools llvm4344    - name: Download artifact45      run: curl -LO https://github.com/rust-lang/gcc/releases/latest/download/gcc-15.deb4647    - name: Setup path to libgccjit48      run: |49          sudo dpkg --force-overwrite -i gcc-15.deb50          echo 'gcc-path = "/usr/lib/"' > config.toml5152    # Some run-make tests fail if we use our forked GCC because it doesn't53    # bundle libstdc++, so we switch to gcc-14 to have a GCC that has54    # libstdc++.55    - name: Set default GCC to gcc-1456      run: sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 305758    - name: Set env59      run: |60        echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV6162    - name: Build63      run: |64        ./y.sh prepare --only-libcore65        ./y.sh build --sysroot --release --release-sysroot66        ./y.sh test --cargo-tests67        ./y.sh clean all6869    - name: Prepare dependencies70      run: |71        git config --global user.email "user@example.com"72        git config --global user.name "User"73        ./y.sh prepare7475    - name: Add more failing tests (some panic and debuginfo tests fail)76      run: cat tests/failing-lto-tests.txt >> tests/failing-ui-tests.txt7778    - name: Run tests79      run: |80        # FIXME(antoyo): we cannot enable LTO for stdarch tests currently because of some failing LTO tests using proc-macros.81        CG_RUSTFLAGS="-Cembed-bitcode=yes" ./y.sh test --release --clean --release-sysroot --build-sysroot --keep-lto-tests ${{ matrix.commands }}8283    - name: LTO test84      run: |85        CHANNEL="release" ./y.sh cargo build --release --manifest-path tests/hello-world/Cargo.toml86        call_found=$(objdump -dj .text tests/hello-world/target/release/hello_world | grep -c "call .*mylib.*my_func" ) ||:87        if [ $call_found -gt 0 ]; then88          echo "ERROR: call my_func found in asm"89          echo "Test is done with LTO enabled, hence inlining should occur across crates"90          exit 191        fi9293    - name: Cross-language LTO test94      run: |95        pushd tests/cross_lang_lto96        gcc -c -flto add.c -masm=intel -fPIC -O397        ar rcs libadd.a add.o98        popd99100        CHANNEL="release" CG_RUSTFLAGS="-L native=. -Clinker-plugin-lto -Clinker=gcc" ./y.sh cargo build --release --manifest-path tests/cross_lang_lto/Cargo.toml101        call_found=$(objdump -dj .text tests/cross_lang_lto/target/release/cross_lang_lto | grep -c "call .*my_add" ) ||:102        if [ $call_found -gt 0 ]; then103          echo "ERROR: call my_add found in asm"104          echo "Test is done with cross-language LTO enabled, hence inlining should occur across object files"105          exit 1106        fi107108  # Summary job for the merge queue.109  # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!110  success_release:111    needs: [build]112    # We need to ensure this job does *not* get skipped if its dependencies fail,113    # because a skipped job is considered a success by GitHub. So we have to114    # overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run115    # when the workflow is canceled manually.116    if: ${{ !cancelled() }}117    runs-on: ubuntu-latest118    steps:119      # Manually check the status of all dependencies. `if: failure()` does not work.120      - name: Conclusion121        run: |122          # Print the dependent jobs to see them in the CI log123          jq -C <<< '${{ toJson(needs) }}'124          # Check if all jobs that we depend on (in the needs array) were successful.125          jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.