Skip to content

Commit 0d359ef

Browse files
committedMar 5, 2024
Merge commit 'b385428e3ddf330805241e7758e773f933357c4b' into subtree-update_cg_gcc_2024-03-05
2 parents 7606c13 + b385428 commit 0d359ef

Some content is hidden

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

76 files changed

+7183
-4278
lines changed
 

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

+35-54
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
libgccjit_version:
22-
- { gcc: "libgccjit.so", artifacts_branch: "master" }
23-
- { gcc: "libgccjit_without_int128.so", artifacts_branch: "master-without-128bit-integers" }
22+
- { gcc: "gcc-13.deb" }
23+
- { gcc: "gcc-13-without-int128.deb" }
2424
commands: [
2525
"--mini-tests",
2626
"--std-tests",
@@ -32,60 +32,39 @@ jobs:
3232
"--extended-regex-tests",
3333
"--test-successful-rustc --nb-parts 2 --current-part 0",
3434
"--test-successful-rustc --nb-parts 2 --current-part 1",
35+
"--projects",
3536
]
3637

3738
steps:
3839
- uses: actions/checkout@v3
3940

41+
# `rustup show` installs from rust-toolchain.toml
42+
- name: Setup rust toolchain
43+
run: rustup show
44+
45+
- name: Setup rust cache
46+
uses: Swatinem/rust-cache@v2
47+
4048
- name: Install packages
4149
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests.
4250
run: sudo apt-get install ninja-build ripgrep llvm-14-tools
4351

52+
- name: Install rustfmt
53+
run: rustup component add rustfmt
54+
4455
- name: Download artifact
45-
uses: dawidd6/action-download-artifact@v2
46-
with:
47-
workflow: main.yml
48-
name: gcc-13
49-
path: gcc-13
50-
repo: antoyo/gcc
51-
branch: ${{ matrix.libgccjit_version.artifacts_branch }}
52-
event: push
53-
search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts.
56+
run: curl -LO https://github.com/antoyo/gcc/releases/latest/download/${{ matrix.libgccjit_version.gcc }}
5457

5558
- name: Setup path to libgccjit
5659
run: |
57-
sudo dpkg --force-overwrite -i gcc-13/gcc-13.deb
58-
echo /usr/lib/ > gcc_path
60+
sudo dpkg --force-overwrite -i ${{ matrix.libgccjit_version.gcc }}
61+
echo 'gcc-path = "/usr/lib/"' > config.toml
5962
6063
- name: Set env
6164
run: |
62-
echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
63-
echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
6465
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
65-
66-
- name: Cache cargo installed crates
67-
uses: actions/cache@v3
68-
with:
69-
path: ~/.cargo/bin
70-
key: cargo-installed-crates2-ubuntu-latest
71-
72-
- name: Cache cargo registry
73-
uses: actions/cache@v3
74-
with:
75-
path: ~/.cargo/registry
76-
key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
77-
78-
- name: Cache cargo index
79-
uses: actions/cache@v3
80-
with:
81-
path: ~/.cargo/git
82-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
83-
84-
- name: Cache cargo target dir
85-
uses: actions/cache@v3
86-
with:
87-
path: target
88-
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
66+
echo "LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
67+
echo "LD_LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
8968
9069
#- name: Cache rust repository
9170
## We only clone the rust repository for rustc tests
@@ -99,35 +78,37 @@ jobs:
9978
- name: Build
10079
run: |
10180
./y.sh prepare --only-libcore
102-
# TODO: remove --features master when it is back to the default.
103-
./y.sh build --features master
104-
# TODO: remove --features master when it is back to the default.
105-
cargo test --features master
106-
./clean_all.sh
81+
./y.sh build
82+
cargo test
83+
./y.sh clean all
10784
10885
- name: Prepare dependencies
10986
run: |
11087
git config --global user.email "user@example.com"
11188
git config --global user.name "User"
11289
./y.sh prepare
11390
114-
# Compile is a separate step, as the actions-rs/cargo action supports error annotations
115-
- name: Compile
116-
uses: actions-rs/cargo@v1.0.3
117-
with:
118-
command: build
119-
args: --release
120-
12191
- name: Add more failing tests because the sysroot is not compiled with LTO
122-
run: cat failing-non-lto-tests.txt >> failing-ui-tests.txt
92+
run: cat tests/failing-non-lto-tests.txt >> tests/failing-ui-tests.txt
12393

12494
- name: Run tests
12595
run: |
126-
# TODO: remove --features master when it is back to the default.
127-
./test.sh --features master --release --clean --build-sysroot ${{ matrix.commands }}
96+
./y.sh test --release --clean --build-sysroot ${{ matrix.commands }}
97+
98+
- name: Check formatting
99+
run: cargo fmt -- --check
128100

129101
duplicates:
130102
runs-on: ubuntu-latest
131103
steps:
132104
- uses: actions/checkout@v3
133105
- run: python tools/check_intrinsics_duplicates.py
106+
107+
build_system:
108+
runs-on: ubuntu-latest
109+
steps:
110+
- uses: actions/checkout@v3
111+
- name: Test build system
112+
run: |
113+
cd build_system
114+
cargo test

‎compiler/rustc_codegen_gcc/.github/workflows/failures.yml

+19-51
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,25 @@ jobs:
2121
libgccjit_version:
2222
- gcc: "libgccjit.so"
2323
artifacts_branch: "master"
24-
# TODO: switch back to --no-default-features in the case of libgccjit 12 when the default is to enable
25-
# master again.
26-
extra: "--features master"
2724
- gcc: "libgccjit_without_int128.so"
2825
artifacts_branch: "master-without-128bit-integers"
29-
extra: "--features master"
3026
- gcc: "libgccjit12.so"
3127
artifacts_branch: "gcc12"
28+
extra: "--no-default-features"
3229
# FIXME(antoyo): we need to set GCC_EXEC_PREFIX so that the linker can find the linker plugin.
3330
# Not sure why it's not found otherwise.
3431
env_extra: "TEST_FLAGS='-Cpanic=abort -Zpanic-abort-tests' GCC_EXEC_PREFIX=/usr/lib/gcc/"
3532

3633
steps:
3734
- uses: actions/checkout@v3
3835

36+
# `rustup show` installs from rust-toolchain.toml
37+
- name: Setup rust toolchain
38+
run: rustup show
39+
40+
- name: Setup rust cache
41+
uses: Swatinem/rust-cache@v2
42+
3943
- name: Install packages
4044
run: sudo apt-get install ninja-build ripgrep
4145

@@ -45,56 +49,27 @@ jobs:
4549

4650
- name: Setup path to libgccjit
4751
if: matrix.libgccjit_version.gcc == 'libgccjit12.so'
48-
run: echo /usr/lib/gcc/x86_64-linux-gnu/12 > gcc_path
52+
run: |
53+
echo 'gcc-path = "/usr/lib/gcc/x86_64-linux-gnu/12"' > config.toml
54+
echo "LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12" >> $GITHUB_ENV
55+
echo "LD_LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12" >> $GITHUB_ENV
4956
5057
- name: Download artifact
5158
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
52-
uses: dawidd6/action-download-artifact@v2
53-
with:
54-
workflow: main.yml
55-
name: gcc-13
56-
path: gcc-13
57-
repo: antoyo/gcc
58-
branch: ${{ matrix.libgccjit_version.artifacts_branch }}
59-
event: push
60-
search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts.
59+
run: curl -LO https://github.com/antoyo/gcc/releases/latest/download/gcc-13.deb
6160

6261
- name: Setup path to libgccjit
6362
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
6463
run: |
65-
sudo dpkg --force-overwrite -i gcc-13/gcc-13.deb
66-
echo /usr/lib/ > gcc_path
64+
sudo dpkg --force-overwrite -i gcc-13.deb
65+
echo 'gcc-path = "/usr/lib"' > config.toml
66+
echo "LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
67+
echo "LD_LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
6768
6869
- name: Set env
6970
run: |
70-
echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
71-
echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
7271
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
7372
74-
- name: Cache cargo installed crates
75-
uses: actions/cache@v3
76-
with:
77-
path: ~/.cargo/bin
78-
key: cargo-installed-crates2-ubuntu-latest
79-
80-
- name: Cache cargo registry
81-
uses: actions/cache@v3
82-
with:
83-
path: ~/.cargo/registry
84-
key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
85-
86-
- name: Cache cargo index
87-
uses: actions/cache@v3
88-
with:
89-
path: ~/.cargo/git
90-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
91-
92-
- name: Cache cargo target dir
93-
uses: actions/cache@v3
94-
with:
95-
path: target
96-
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
97-
9873
#- name: Cache rust repository
9974
#uses: actions/cache@v3
10075
#id: cache-rust-repository
@@ -115,18 +90,11 @@ jobs:
11590
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
11691
run: ./y.sh prepare
11792

118-
# Compile is a separate step, as the actions-rs/cargo action supports error annotations
119-
- name: Compile
120-
uses: actions-rs/cargo@v1.0.3
121-
with:
122-
command: build
123-
args: --release
124-
12593
- name: Add more failing tests because the sysroot is not compiled with LTO
126-
run: cat failing-non-lto-tests.txt >> failing-ui-tests.txt
94+
run: cat tests/failing-non-lto-tests.txt >> tests/failing-ui-tests.txt
12795

12896
- name: Run tests
12997
id: tests
13098
run: |
131-
${{ matrix.libgccjit_version.env_extra }} ./test.sh --release --clean --build-sysroot --test-failing-rustc ${{ matrix.libgccjit_version.extra }} | tee output_log
99+
${{ matrix.libgccjit_version.env_extra }} ./y.sh test --release --clean --build-sysroot --test-failing-rustc ${{ matrix.libgccjit_version.extra }} | tee output_log
132100
rg --text "test result" output_log >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)
Please sign in to comment.