Skip to content

Commit 38b9655

Browse files
committed
Auto merge of rust-lang#108877 - matthiaskrgr:rollup-7gwgvgc, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#108460 (migrate `rustc_hir_analysis` to session diagnostic [Part Two]) - rust-lang#108581 (Add a new config flag, dist.include-mingw-linker.) - rust-lang#108583 (Account for binders correctly when adding default RPITIT method assumption) - rust-lang#108783 (Sync rustc_codegen_gcc 2023/03/04) - rust-lang#108793 (Append to existing `PYTHONPATH` in compiletest instead of overwriting) - rust-lang#108822 (Remove references to PassManagerBuilder) - rust-lang#108866 (Force to use the stage 2 compiler when config.download_rustc is set) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents e3dfeea + b0ec353 commit 38b9655

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+5893
-1161
lines changed

compiler/rustc_codegen_gcc/.github/workflows/ci.yml

+66-45
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,72 @@ on:
44
- push
55
- pull_request
66

7+
permissions:
8+
contents: read
9+
10+
env:
11+
# Enable backtraces for easier debugging
12+
RUST_BACKTRACE: 1
13+
714
jobs:
815
build:
9-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-22.04
1017

1118
strategy:
1219
fail-fast: false
1320
matrix:
14-
libgccjit_version: ["libgccjit.so", "libgccjit_without_int128.so", "libgccjit12.so"]
21+
libgccjit_version:
22+
- { gcc: "libgccjit.so", extra: "", env_extra: "", artifacts_branch: "master" }
23+
- { gcc: "libgccjit_without_int128.so", extra: "", env_extra: "", artifacts_branch: "master-without-128bit-integers" }
24+
- { gcc: "libgccjit12.so", extra: "--no-default-features", env_extra: "TEST_FLAGS='-Cpanic=abort -Zpanic-abort-tests'", artifacts_branch: "gcc12" }
25+
commands: [
26+
"--mini-tests",
27+
"--std-tests",
28+
# FIXME: re-enable asm tests when GCC can emit in the right syntax.
29+
# "--asm-tests",
30+
"--test-libcore",
31+
"--extended-rand-tests",
32+
"--extended-regex-example-tests",
33+
"--extended-regex-tests",
34+
"--test-successful-rustc --nb-parts 2 --current-part 0",
35+
"--test-successful-rustc --nb-parts 2 --current-part 1",
36+
"--test-failing-rustc",
37+
]
1538

1639
steps:
17-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v3
1841

19-
- uses: actions/checkout@v2
42+
- uses: actions/checkout@v3
2043
with:
2144
repository: llvm/llvm-project
2245
path: llvm
2346

2447
- name: Install packages
25-
run: sudo apt-get install ninja-build ripgrep
48+
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests.
49+
run: sudo apt-get install ninja-build ripgrep llvm-14-tools
50+
51+
- name: Install libgccjit12
52+
if: matrix.libgccjit_version.gcc == 'libgccjit12.so'
53+
run: sudo apt-get install libgccjit-12-dev
2654

2755
- name: Download artifact
56+
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
2857
uses: dawidd6/action-download-artifact@v2
2958
with:
3059
workflow: main.yml
31-
name: ${{ matrix.libgccjit_version }}
60+
name: ${{ matrix.libgccjit_version.gcc }}
3261
path: gcc-build
3362
repo: antoyo/gcc
63+
branch: ${{ matrix.libgccjit_version.artifacts_branch }}
64+
event: push
3465
search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts.
3566

3667
- name: Setup path to libgccjit
68+
if: matrix.libgccjit_version.gcc == 'libgccjit12.so'
69+
run: echo /usr/lib/gcc/x86_64-linux-gnu/12 > gcc_path
70+
71+
- name: Setup path to libgccjit
72+
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
3773
run: |
3874
echo $(readlink -f gcc-build) > gcc_path
3975
# NOTE: the filename is still libgccjit.so even when the artifact name is different.
@@ -48,49 +84,44 @@ jobs:
4884
- name: Set RUST_COMPILER_RT_ROOT
4985
run: echo "RUST_COMPILER_RT_ROOT="${{ env.workspace }}/llvm/compiler-rt >> $GITHUB_ENV
5086

51-
# https://github.com/actions/cache/issues/133
52-
- name: Fixup owner of ~/.cargo/
53-
# Don't remove the trailing /. It is necessary to follow the symlink.
54-
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
55-
5687
- name: Cache cargo installed crates
57-
uses: actions/cache@v1.1.2
88+
uses: actions/cache@v3
5889
with:
5990
path: ~/.cargo/bin
6091
key: cargo-installed-crates2-ubuntu-latest
6192

6293
- name: Cache cargo registry
63-
uses: actions/cache@v1
94+
uses: actions/cache@v3
6495
with:
6596
path: ~/.cargo/registry
6697
key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
6798

6899
- name: Cache cargo index
69-
uses: actions/cache@v1
100+
uses: actions/cache@v3
70101
with:
71102
path: ~/.cargo/git
72103
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
73104

74105
- name: Cache cargo target dir
75-
uses: actions/cache@v1.1.2
106+
uses: actions/cache@v3
76107
with:
77108
path: target
78109
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
79110

80-
- name: Build
81-
if: matrix.libgccjit_version != 'libgccjit12.so'
82-
run: |
83-
./prepare_build.sh
84-
./build.sh
85-
cargo test
86-
./clean_all.sh
111+
#- name: Cache rust repository
112+
## We only clone the rust repository for rustc tests
113+
#if: ${{ contains(matrix.commands, 'rustc') }}
114+
#uses: actions/cache@v3
115+
#id: cache-rust-repository
116+
#with:
117+
#path: rust
118+
#key: ${{ runner.os }}-packages-${{ hashFiles('rust/.git/HEAD') }}
87119

88120
- name: Build
89-
if: matrix.libgccjit_version == 'libgccjit12.so'
90121
run: |
91122
./prepare_build.sh
92-
./build.sh --no-default-features
93-
cargo test --no-default-features
123+
${{ matrix.libgccjit_version.env_extra }} ./build.sh ${{ matrix.libgccjit_version.extra }}
124+
${{ matrix.libgccjit_version.env_extra }} cargo test ${{ matrix.libgccjit_version.extra }}
94125
./clean_all.sh
95126
96127
- name: Prepare dependencies
@@ -106,26 +137,16 @@ jobs:
106137
command: build
107138
args: --release
108139

109-
- name: Test
110-
if: matrix.libgccjit_version != 'libgccjit12.so'
111-
run: |
112-
# Enable backtraces for easier debugging
113-
export RUST_BACKTRACE=1
114-
115-
# Reduce amount of benchmark runs as they are slow
116-
export COMPILE_RUNS=2
117-
export RUN_RUNS=2
140+
- name: Add more failing tests for GCC 12
141+
if: ${{ matrix.libgccjit_version.gcc == 'libgccjit12.so' }}
142+
run: cat failing-ui-tests12.txt >> failing-ui-tests.txt
118143

119-
./test.sh --release
120-
121-
- name: Test
122-
if: matrix.libgccjit_version == 'libgccjit12.so'
144+
- name: Run tests
123145
run: |
124-
# Enable backtraces for easier debugging
125-
export RUST_BACKTRACE=1
126-
127-
# Reduce amount of benchmark runs as they are slow
128-
export COMPILE_RUNS=2
129-
export RUN_RUNS=2
146+
${{ matrix.libgccjit_version.env_extra }} ./test.sh --release --clean --build-sysroot ${{ matrix.commands }} ${{ matrix.libgccjit_version.extra }}
130147
131-
./test.sh --release --no-default-features
148+
duplicates:
149+
runs-on: ubuntu-latest
150+
steps:
151+
- uses: actions/checkout@v3
152+
- run: python tools/check_intrinsics_duplicates.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: CI with sysroot compiled in release mode
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+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
libgccjit_version:
22+
- { gcc: "libgccjit.so", artifacts_branch: "master" }
23+
commands: [
24+
"--test-successful-rustc --nb-parts 2 --current-part 0",
25+
"--test-successful-rustc --nb-parts 2 --current-part 1",
26+
]
27+
28+
steps:
29+
- uses: actions/checkout@v3
30+
31+
- uses: actions/checkout@v3
32+
with:
33+
repository: llvm/llvm-project
34+
path: llvm
35+
36+
- name: Install packages
37+
run: sudo apt-get install ninja-build ripgrep
38+
39+
- name: Download artifact
40+
uses: dawidd6/action-download-artifact@v2
41+
with:
42+
workflow: main.yml
43+
name: ${{ matrix.libgccjit_version.gcc }}
44+
path: gcc-build
45+
repo: antoyo/gcc
46+
branch: ${{ matrix.libgccjit_version.artifacts_branch }}
47+
event: push
48+
search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts.
49+
50+
- name: Setup path to libgccjit
51+
run: |
52+
echo $(readlink -f gcc-build) > gcc_path
53+
# NOTE: the filename is still libgccjit.so even when the artifact name is different.
54+
ln gcc-build/libgccjit.so gcc-build/libgccjit.so.0
55+
56+
- name: Set env
57+
run: |
58+
echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
59+
echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
60+
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
61+
62+
- name: Set RUST_COMPILER_RT_ROOT
63+
run: echo "RUST_COMPILER_RT_ROOT="${{ env.workspace }}/llvm/compiler-rt >> $GITHUB_ENV
64+
65+
- name: Cache cargo installed crates
66+
uses: actions/cache@v3
67+
with:
68+
path: ~/.cargo/bin
69+
key: cargo-installed-crates2-ubuntu-latest
70+
71+
- name: Cache cargo registry
72+
uses: actions/cache@v3
73+
with:
74+
path: ~/.cargo/registry
75+
key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
76+
77+
- name: Cache cargo index
78+
uses: actions/cache@v3
79+
with:
80+
path: ~/.cargo/git
81+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
82+
83+
- name: Cache cargo target dir
84+
uses: actions/cache@v3
85+
with:
86+
path: target
87+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
88+
89+
- name: Build
90+
run: |
91+
./prepare_build.sh
92+
./build.sh --release --release-sysroot
93+
cargo test
94+
./clean_all.sh
95+
96+
- name: Prepare dependencies
97+
run: |
98+
git config --global user.email "user@example.com"
99+
git config --global user.name "User"
100+
./prepare.sh
101+
102+
# Compile is a separate step, as the actions-rs/cargo action supports error annotations
103+
- name: Compile
104+
uses: actions-rs/cargo@v1.0.3
105+
with:
106+
command: build
107+
args: --release
108+
109+
- name: Run tests
110+
run: |
111+
./test.sh --release --clean --release-sysroot --build-sysroot ${{ matrix.commands }}

0 commit comments

Comments
 (0)