Skip to content

Commit 9496999

Browse files
committed
Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_clif-2022-12-14
2 parents ba64ba8 + 2bb3996 commit 9496999

Some content is hidden

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

53 files changed

+1691
-1028
lines changed

compiler/rustc_codegen_cranelift/.cirrus.yml

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ task:
1212
folder: target
1313
prepare_script:
1414
- . $HOME/.cargo/env
15-
- git config --global user.email "user@example.com"
16-
- git config --global user.name "User"
1715
- ./y.rs prepare
1816
test_script:
1917
- . $HOME/.cargo/env

compiler/rustc_codegen_cranelift/.github/workflows/main.yml

+29-23
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- name: Rustfmt
2020
run: |
2121
cargo fmt --check
22+
rustfmt --check build_system/mod.rs
2223
2324
build:
2425
runs-on: ${{ matrix.os }}
@@ -28,7 +29,7 @@ jobs:
2829
fail-fast: false
2930
matrix:
3031
include:
31-
- os: ubuntu-latest
32+
- os: ubuntu-20.04 # FIXME switch to ubuntu-22.04 once #1303 is fixed
3233
env:
3334
TARGET_TRIPLE: x86_64-unknown-linux-gnu
3435
- os: macos-latest
@@ -41,28 +42,32 @@ jobs:
4142
- os: ubuntu-latest
4243
env:
4344
TARGET_TRIPLE: aarch64-unknown-linux-gnu
45+
# s390x requires QEMU 6.1 or greater, we could build it from source, but ubuntu 22.04 comes with 6.2 by default
46+
- os: ubuntu-latest
47+
env:
48+
TARGET_TRIPLE: s390x-unknown-linux-gnu
4449

4550
steps:
4651
- uses: actions/checkout@v3
4752

4853
- name: Cache cargo installed crates
49-
uses: actions/cache@v2
54+
uses: actions/cache@v3
5055
with:
5156
path: ~/.cargo/bin
5257
key: ${{ runner.os }}-cargo-installed-crates
5358

5459
- name: Cache cargo registry and index
55-
uses: actions/cache@v2
60+
uses: actions/cache@v3
5661
with:
5762
path: |
5863
~/.cargo/registry
5964
~/.cargo/git
6065
key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
6166

6267
- name: Cache cargo target dir
63-
uses: actions/cache@v2
68+
uses: actions/cache@v3
6469
with:
65-
path: target
70+
path: build/cg_clif
6671
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
6772

6873
- name: Install MinGW toolchain and wine
@@ -78,11 +83,14 @@ jobs:
7883
sudo apt-get update
7984
sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user
8085
81-
- name: Prepare dependencies
86+
- name: Install s390x toolchain and qemu
87+
if: matrix.env.TARGET_TRIPLE == 's390x-unknown-linux-gnu'
8288
run: |
83-
git config --global user.email "user@example.com"
84-
git config --global user.name "User"
85-
./y.rs prepare
89+
sudo apt-get update
90+
sudo apt-get install -y gcc-s390x-linux-gnu qemu-user
91+
92+
- name: Prepare dependencies
93+
run: ./y.rs prepare
8694

8795
- name: Build without unstable features
8896
env:
@@ -110,7 +118,7 @@ jobs:
110118
./y.rs test
111119
112120
- name: Package prebuilt cg_clif
113-
run: tar cvfJ cg_clif.tar.xz build
121+
run: tar cvfJ cg_clif.tar.xz dist
114122

115123
- name: Upload prebuilt cg_clif
116124
if: matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
@@ -121,7 +129,7 @@ jobs:
121129

122130
- name: Upload prebuilt cg_clif (cross compile)
123131
if: matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
124-
uses: actions/upload-artifact@v2
132+
uses: actions/upload-artifact@v3
125133
with:
126134
name: cg_clif-${{ runner.os }}-cross-x86_64-mingw
127135
path: cg_clif.tar.xz
@@ -147,23 +155,23 @@ jobs:
147155
- uses: actions/checkout@v3
148156

149157
- name: Cache cargo installed crates
150-
uses: actions/cache@v2
158+
uses: actions/cache@v3
151159
with:
152160
path: ~/.cargo/bin
153161
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-installed-crates
154162

155163
- name: Cache cargo registry and index
156-
uses: actions/cache@v2
164+
uses: actions/cache@v3
157165
with:
158166
path: |
159167
~/.cargo/registry
160168
~/.cargo/git
161169
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
162170

163171
- name: Cache cargo target dir
164-
uses: actions/cache@v2
172+
uses: actions/cache@v3
165173
with:
166-
path: target
174+
path: build/cg_clif
167175
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
168176

169177
- name: Set MinGW as the default toolchain
@@ -172,8 +180,6 @@ jobs:
172180

173181
- name: Prepare dependencies
174182
run: |
175-
git config --global user.email "user@example.com"
176-
git config --global user.name "User"
177183
git config --global core.autocrlf false
178184
rustc y.rs -o y.exe -g
179185
./y.exe prepare
@@ -198,24 +204,24 @@ jobs:
198204
199205
# Enable extra checks
200206
$Env:CG_CLIF_ENABLE_VERIFIER=1
201-
207+
202208
# WIP Disable some tests
203-
209+
204210
# This fails due to some weird argument handling by hyperfine, not an actual regression
205211
# more of a build system issue
206212
(Get-Content config.txt) -replace '(bench.simple-raytracer)', '# $1' | Out-File config.txt
207-
208-
# This fails with a different output than expected
213+
214+
# This fails with a different output than expected
209215
(Get-Content config.txt) -replace '(test.regex-shootout-regex-dna)', '# $1' | Out-File config.txt
210216
211217
./y.exe test
212218
213219
- name: Package prebuilt cg_clif
214220
# don't use compression as xzip isn't supported by tar on windows and bzip2 hangs
215-
run: tar cvf cg_clif.tar build
221+
run: tar cvf cg_clif.tar dist
216222

217223
- name: Upload prebuilt cg_clif
218-
uses: actions/upload-artifact@v2
224+
uses: actions/upload-artifact@v3
219225
with:
220226
name: cg_clif-${{ matrix.env.TARGET_TRIPLE }}
221227
path: cg_clif.tar

compiler/rustc_codegen_cranelift/.github/workflows/nightly-cranelift.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v3
1515

1616
- name: Cache cargo installed crates
17-
uses: actions/cache@v2
17+
uses: actions/cache@v3
1818
with:
1919
path: ~/.cargo/bin
2020
key: ubuntu-latest-cargo-installed-crates

compiler/rustc_codegen_cranelift/.github/workflows/rustc.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ jobs:
1111
- uses: actions/checkout@v3
1212

1313
- name: Cache cargo installed crates
14-
uses: actions/cache@v2
14+
uses: actions/cache@v3
1515
with:
1616
path: ~/.cargo/bin
1717
key: ${{ runner.os }}-cargo-installed-crates
1818

1919
- name: Cache cargo registry and index
20-
uses: actions/cache@v2
20+
uses: actions/cache@v3
2121
with:
2222
path: |
2323
~/.cargo/registry
2424
~/.cargo/git
2525
key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
2626

2727
- name: Cache cargo target dir
28-
uses: actions/cache@v2
28+
uses: actions/cache@v3
2929
with:
30-
path: target
30+
path: build/cg_clif
3131
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
3232

3333
- name: Prepare dependencies
@@ -49,23 +49,23 @@ jobs:
4949
- uses: actions/checkout@v3
5050

5151
- name: Cache cargo installed crates
52-
uses: actions/cache@v2
52+
uses: actions/cache@v3
5353
with:
5454
path: ~/.cargo/bin
5555
key: ${{ runner.os }}-cargo-installed-crates
5656

5757
- name: Cache cargo registry and index
58-
uses: actions/cache@v2
58+
uses: actions/cache@v3
5959
with:
6060
path: |
6161
~/.cargo/registry
6262
~/.cargo/git
6363
key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
6464

6565
- name: Cache cargo target dir
66-
uses: actions/cache@v2
66+
uses: actions/cache@v3
6767
with:
68-
path: target
68+
path: build/cg_clif
6969
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
7070

7171
- name: Prepare dependencies

compiler/rustc_codegen_cranelift/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ perf.data.old
1414
/build_sysroot/sysroot_src
1515
/build_sysroot/compiler-builtins
1616
/build_sysroot/rustc_version
17+
/dist
1718
/rust
1819
/download

compiler/rustc_codegen_cranelift/.vscode/settings.json

+3-32
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@
44
"rust-analyzer.imports.granularity.enforce": true,
55
"rust-analyzer.imports.granularity.group": "module",
66
"rust-analyzer.imports.prefix": "crate",
7-
"rust-analyzer.cargo.features": ["unstable-features"],
7+
"rust-analyzer.cargo.features": ["unstable-features", "__check_build_system_using_ra"],
88
"rust-analyzer.linkedProjects": [
99
"./Cargo.toml",
10-
//"./build_sysroot/sysroot_src/library/std/Cargo.toml",
1110
{
12-
"roots": [
13-
"./example/mini_core.rs",
14-
"./example/mini_core_hello_world.rs",
15-
"./example/mod_bench.rs"
16-
],
1711
"crates": [
1812
{
1913
"root_module": "./example/mini_core.rs",
@@ -36,34 +30,11 @@
3630
]
3731
},
3832
{
39-
"roots": ["./example/std_example.rs"],
33+
"sysroot_src": "./build_sysroot/sysroot_src/library",
4034
"crates": [
4135
{
4236
"root_module": "./example/std_example.rs",
43-
"edition": "2018",
44-
"deps": [{ "crate": 1, "name": "std" }],
45-
"cfg": [],
46-
},
47-
{
48-
"root_module": "./build_sysroot/sysroot_src/library/std/src/lib.rs",
49-
"edition": "2018",
50-
"deps": [],
51-
"cfg": [],
52-
},
53-
]
54-
},
55-
{
56-
"roots": ["./y.rs"],
57-
"crates": [
58-
{
59-
"root_module": "./y.rs",
60-
"edition": "2018",
61-
"deps": [{ "crate": 1, "name": "std" }],
62-
"cfg": [],
63-
},
64-
{
65-
"root_module": "./build_sysroot/sysroot_src/library/std/src/lib.rs",
66-
"edition": "2018",
37+
"edition": "2015",
6738
"deps": [],
6839
"cfg": [],
6940
},

0 commit comments

Comments
 (0)