Skip to content

Commit 17659c7

Browse files
committed
Auto merge of #117253 - antoyo:subtree-update_cg_gcc_2023-10-25, r=bjorn3,GuillaumeGomez
subtree update cg_gcc 2023/10/25
2 parents 20952db + f0aaf2f commit 17659c7

Some content is hidden

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

48 files changed

+2759
-557
lines changed

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

+5-29
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
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" }
22+
- { gcc: "libgccjit.so", artifacts_branch: "master" }
23+
- { gcc: "libgccjit_without_int128.so", artifacts_branch: "master-without-128bit-integers" }
2524
commands: [
2625
"--mini-tests",
2726
"--std-tests",
@@ -33,27 +32,16 @@ jobs:
3332
"--extended-regex-tests",
3433
"--test-successful-rustc --nb-parts 2 --current-part 0",
3534
"--test-successful-rustc --nb-parts 2 --current-part 1",
36-
"--test-failing-rustc",
3735
]
3836

3937
steps:
4038
- uses: actions/checkout@v3
4139

42-
- uses: actions/checkout@v3
43-
with:
44-
repository: llvm/llvm-project
45-
path: llvm
46-
4740
- name: Install packages
4841
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests.
4942
run: sudo apt-get install ninja-build ripgrep llvm-14-tools
5043

51-
- name: Install libgccjit12
52-
if: matrix.libgccjit_version.gcc == 'libgccjit12.so'
53-
run: sudo apt-get install libgccjit-12-dev
54-
5544
- name: Download artifact
56-
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
5745
uses: dawidd6/action-download-artifact@v2
5846
with:
5947
workflow: main.yml
@@ -65,11 +53,6 @@ jobs:
6553
search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts.
6654

6755
- 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'
7356
run: |
7457
sudo dpkg --force-overwrite -i gcc-13/gcc-13.deb
7558
echo /usr/lib/ > gcc_path
@@ -80,9 +63,6 @@ jobs:
8063
echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
8164
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
8265
83-
- name: Set RUST_COMPILER_RT_ROOT
84-
run: echo "RUST_COMPILER_RT_ROOT="${{ env.workspace }}/llvm/compiler-rt >> $GITHUB_ENV
85-
8666
- name: Cache cargo installed crates
8767
uses: actions/cache@v3
8868
with:
@@ -119,8 +99,8 @@ jobs:
11999
- name: Build
120100
run: |
121101
./y.sh prepare --only-libcore
122-
${{ matrix.libgccjit_version.env_extra }} ./y.sh build ${{ matrix.libgccjit_version.extra }}
123-
${{ matrix.libgccjit_version.env_extra }} cargo test ${{ matrix.libgccjit_version.extra }}
102+
./y.sh build
103+
cargo test
124104
./clean_all.sh
125105
126106
- name: Prepare dependencies
@@ -136,16 +116,12 @@ jobs:
136116
command: build
137117
args: --release
138118

139-
- name: Add more failing tests for GCC 12
140-
if: ${{ matrix.libgccjit_version.gcc == 'libgccjit12.so' }}
141-
run: cat failing-ui-tests12.txt >> failing-ui-tests.txt
142-
143119
- name: Add more failing tests because the sysroot is not compiled with LTO
144120
run: cat failing-non-lto-tests.txt >> failing-ui-tests.txt
145121

146122
- name: Run tests
147123
run: |
148-
${{ matrix.libgccjit_version.env_extra }} ./test.sh --release --clean --build-sysroot ${{ matrix.commands }} ${{ matrix.libgccjit_version.extra }}
124+
./test.sh --release --clean --build-sysroot ${{ matrix.commands }}
149125
150126
duplicates:
151127
runs-on: ubuntu-latest
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# TODO: refactor to avoid duplication with the ci.yml file.
2+
name: Failures
3+
4+
on:
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-22.04
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
libgccjit_version:
22+
- gcc: "libgccjit.so"
23+
artifacts_branch: "master"
24+
- gcc: "libgccjit_without_int128.so"
25+
artifacts_branch: "master-without-128bit-integers"
26+
- gcc: "libgccjit12.so"
27+
artifacts_branch: "gcc12"
28+
extra: "--no-default-features"
29+
# FIXME(antoyo): we need to set GCC_EXEC_PREFIX so that the linker can find the linker plugin.
30+
# Not sure why it's not found otherwise.
31+
env_extra: "TEST_FLAGS='-Cpanic=abort -Zpanic-abort-tests' GCC_EXEC_PREFIX=/usr/lib/gcc/"
32+
33+
steps:
34+
- uses: actions/checkout@v3
35+
36+
- name: Install packages
37+
run: sudo apt-get install ninja-build ripgrep
38+
39+
- name: Install libgccjit12
40+
if: matrix.libgccjit_version.gcc == 'libgccjit12.so'
41+
run: sudo apt-get install libgccjit-12-dev
42+
43+
- name: Setup path to libgccjit
44+
if: matrix.libgccjit_version.gcc == 'libgccjit12.so'
45+
run: echo /usr/lib/gcc/x86_64-linux-gnu/12 > gcc_path
46+
47+
- name: Download artifact
48+
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
49+
uses: dawidd6/action-download-artifact@v2
50+
with:
51+
workflow: main.yml
52+
name: gcc-13
53+
path: gcc-13
54+
repo: antoyo/gcc
55+
branch: ${{ matrix.libgccjit_version.artifacts_branch }}
56+
event: push
57+
search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts.
58+
59+
- name: Setup path to libgccjit
60+
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
61+
run: |
62+
sudo dpkg --force-overwrite -i gcc-13/gcc-13.deb
63+
echo /usr/lib/ > gcc_path
64+
65+
- name: Set env
66+
run: |
67+
echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
68+
echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
69+
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
70+
71+
- name: Cache cargo installed crates
72+
uses: actions/cache@v3
73+
with:
74+
path: ~/.cargo/bin
75+
key: cargo-installed-crates2-ubuntu-latest
76+
77+
- name: Cache cargo registry
78+
uses: actions/cache@v3
79+
with:
80+
path: ~/.cargo/registry
81+
key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
82+
83+
- name: Cache cargo index
84+
uses: actions/cache@v3
85+
with:
86+
path: ~/.cargo/git
87+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
88+
89+
- name: Cache cargo target dir
90+
uses: actions/cache@v3
91+
with:
92+
path: target
93+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
94+
95+
#- name: Cache rust repository
96+
#uses: actions/cache@v3
97+
#id: cache-rust-repository
98+
#with:
99+
#path: rust
100+
#key: ${{ runner.os }}-packages-${{ hashFiles('rust/.git/HEAD') }}
101+
102+
- name: Git config
103+
run: |
104+
git config --global user.email "user@example.com"
105+
git config --global user.name "User"
106+
107+
- name: Prepare dependencies
108+
if: matrix.libgccjit_version.gcc == 'libgccjit12.so'
109+
run: ./y.sh prepare --libgccjit12-patches
110+
111+
- name: Prepare dependencies
112+
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
113+
run: ./y.sh prepare
114+
115+
# Compile is a separate step, as the actions-rs/cargo action supports error annotations
116+
- name: Compile
117+
uses: actions-rs/cargo@v1.0.3
118+
with:
119+
command: build
120+
args: --release
121+
122+
- name: Add more failing tests because the sysroot is not compiled with LTO
123+
run: cat failing-non-lto-tests.txt >> failing-ui-tests.txt
124+
125+
- name: Run tests
126+
id: tests
127+
run: |
128+
${{ matrix.libgccjit_version.env_extra }} ./test.sh --release --clean --build-sysroot --test-failing-rustc ${{ matrix.libgccjit_version.extra }} | tee output_log
129+
rg --text "test result" output_log >> $GITHUB_STEP_SUMMARY
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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+
# FIXME(antoyo): we need to set GCC_EXEC_PREFIX so that the linker can find the linker plugin.
15+
# Not sure why it's not found otherwise.
16+
GCC_EXEC_PREFIX: /usr/lib/gcc/
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-22.04
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
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+
]
37+
38+
steps:
39+
- uses: actions/checkout@v3
40+
41+
- name: Install packages
42+
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests.
43+
run: sudo apt-get install ninja-build ripgrep llvm-14-tools libgccjit-12-dev
44+
45+
- name: Setup path to libgccjit
46+
run: echo /usr/lib/gcc/x86_64-linux-gnu/12 > gcc_path
47+
48+
- name: Set env
49+
run: |
50+
echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
51+
echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
52+
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
53+
54+
- name: Cache cargo installed crates
55+
uses: actions/cache@v3
56+
with:
57+
path: ~/.cargo/bin
58+
key: cargo-installed-crates2-ubuntu-latest
59+
60+
- name: Cache cargo registry
61+
uses: actions/cache@v3
62+
with:
63+
path: ~/.cargo/registry
64+
key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
65+
66+
- name: Cache cargo index
67+
uses: actions/cache@v3
68+
with:
69+
path: ~/.cargo/git
70+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
71+
72+
- name: Cache cargo target dir
73+
uses: actions/cache@v3
74+
with:
75+
path: target
76+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
77+
78+
#- name: Cache rust repository
79+
## We only clone the rust repository for rustc tests
80+
#if: ${{ contains(matrix.commands, 'rustc') }}
81+
#uses: actions/cache@v3
82+
#id: cache-rust-repository
83+
#with:
84+
#path: rust
85+
#key: ${{ runner.os }}-packages-${{ hashFiles('rust/.git/HEAD') }}
86+
87+
- name: Build
88+
run: |
89+
./y.sh prepare --only-libcore --libgccjit12-patches
90+
./y.sh build --no-default-features --sysroot-panic-abort
91+
cargo test --no-default-features
92+
./clean_all.sh
93+
94+
- name: Prepare dependencies
95+
run: |
96+
git config --global user.email "user@example.com"
97+
git config --global user.name "User"
98+
./y.sh prepare --libgccjit12-patches
99+
100+
# Compile is a separate step, as the actions-rs/cargo action supports error annotations
101+
- name: Compile
102+
uses: actions-rs/cargo@v1.0.3
103+
with:
104+
command: build
105+
args: --release
106+
107+
- name: Add more failing tests for GCC 12
108+
run: cat failing-ui-tests12.txt >> failing-ui-tests.txt
109+
110+
- name: Add more failing tests because the sysroot is not compiled with LTO
111+
run: cat failing-non-lto-tests.txt >> failing-ui-tests.txt
112+
113+
- name: Run tests
114+
run: |
115+
./test.sh --release --clean --build-sysroot ${{ matrix.commands }} --no-default-features

0 commit comments

Comments
 (0)