Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f2895f3

Browse files
authored
Merge pull request rust-lang#1357 from bjorn3/build_system_rework6
Support testing of cg_clif in rust's CI
2 parents 45781e1 + e9bd63a commit f2895f3

35 files changed

+1602
-258
lines changed

.cirrus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ task:
1010
folder: target
1111
prepare_script:
1212
- . $HOME/.cargo/env
13-
- ./y.rs prepare
13+
- ./y.sh prepare
1414
test_script:
1515
- . $HOME/.cargo/env
16-
- ./y.rs test
16+
- ./y.sh test

.github/workflows/abi-cafe.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ jobs:
4646
run: rustup set default-host x86_64-pc-windows-gnu
4747

4848
- name: Prepare dependencies
49-
run: ./y.rs prepare
49+
run: ./y.sh prepare
5050

5151
- name: Build
52-
run: ./y.rs build --sysroot none
52+
run: ./y.sh build --sysroot none
5353

5454
- name: Test abi-cafe
5555
env:
5656
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
57-
run: ./y.rs abi-cafe
57+
run: ./y.sh abi-cafe

.github/workflows/main.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Rustfmt
2020
run: |
2121
cargo fmt --check
22-
rustfmt --check build_system/mod.rs
22+
rustfmt --check build_system/main.rs
2323
rustfmt --check example/*
2424
2525
@@ -91,15 +91,15 @@ jobs:
9191
sudo apt-get install -y gcc-s390x-linux-gnu qemu-user
9292
9393
- name: Prepare dependencies
94-
run: ./y.rs prepare
94+
run: ./y.sh prepare
9595

9696
- name: Build
97-
run: ./y.rs build --sysroot none
97+
run: ./y.sh build --sysroot none
9898

9999
- name: Test
100100
env:
101101
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
102-
run: ./y.rs test
102+
run: ./y.sh test
103103

104104
- name: Install LLVM standard library
105105
run: rustup target add ${{ matrix.env.TARGET_TRIPLE }}
@@ -111,7 +111,7 @@ jobs:
111111
if: matrix.os != 'windows-latest' || matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
112112
env:
113113
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
114-
run: ./y.rs test --sysroot llvm --no-unstable-features
114+
run: ./y.sh test --sysroot llvm --no-unstable-features
115115

116116

117117
# This job doesn't use cg_clif in any way. It checks that all cg_clif tests work with cg_llvm too.
@@ -165,13 +165,13 @@ jobs:
165165
run: cargo install hyperfine || true
166166

167167
- name: Prepare dependencies
168-
run: ./y.rs prepare
168+
run: ./y.sh prepare
169169

170170
- name: Build
171-
run: CI_OPT=1 ./y.rs build --sysroot none
171+
run: CI_OPT=1 ./y.sh build --sysroot none
172172

173173
- name: Benchmark
174-
run: CI_OPT=1 ./y.rs bench
174+
run: CI_OPT=1 ./y.sh bench
175175

176176

177177
dist:
@@ -224,13 +224,13 @@ jobs:
224224
sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
225225
226226
- name: Prepare dependencies
227-
run: ./y.rs prepare
227+
run: ./y.sh prepare
228228

229229
- name: Build backend
230-
run: CI_OPT=1 ./y.rs build --sysroot none
230+
run: CI_OPT=1 ./y.sh build --sysroot none
231231

232232
- name: Build sysroot
233-
run: CI_OPT=1 ./y.rs build
233+
run: CI_OPT=1 ./y.sh build
234234

235235
- name: Package prebuilt cg_clif
236236
run: tar cvfJ cg_clif.tar.xz dist

.github/workflows/rustc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
1919

2020
- name: Prepare dependencies
21-
run: ./y.rs prepare
21+
run: ./y.sh prepare
2222

2323
- name: Test
2424
run: ./scripts/test_bootstrap.sh
@@ -38,7 +38,7 @@ jobs:
3838
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
3939

4040
- name: Prepare dependencies
41-
run: ./y.rs prepare
41+
run: ./y.sh prepare
4242

4343
- name: Test
4444
run: ./scripts/test_rustc_tests.sh

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/target
2+
/build_system/target
23
**/*.rs.bk
34
*.rlib
45
*.o

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
"rust-analyzer.imports.granularity.enforce": true,
77
"rust-analyzer.imports.granularity.group": "module",
88
"rust-analyzer.imports.prefix": "crate",
9-
"rust-analyzer.cargo.features": ["unstable-features", "__check_build_system_using_ra"],
9+
"rust-analyzer.cargo.features": ["unstable-features"],
1010
"rust-analyzer.linkedProjects": [
1111
"./Cargo.toml",
12+
"./build_system/Cargo.toml",
1213
{
1314
"crates": [
1415
{

Cargo.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ name = "rustc_codegen_cranelift"
33
version = "0.1.0"
44
edition = "2021"
55

6-
[[bin]]
7-
# This is used just to teach rust-analyzer how to check the build system. required-features is used
8-
# to disable it for regular builds.
9-
name = "y"
10-
path = "./y.rs"
11-
required-features = ["__check_build_system_using_ra"]
12-
136
[lib]
147
crate-type = ["dylib"]
158

@@ -45,7 +38,6 @@ smallvec = "1.8.1"
4538
unstable-features = ["jit", "inline_asm"]
4639
jit = ["cranelift-jit", "libloading"]
4740
inline_asm = []
48-
__check_build_system_using_ra = []
4941

5042
[package.metadata.rust-analyzer]
5143
rustc_private = true

Readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ If not please open an issue.
1010
```bash
1111
$ git clone https://github.com/bjorn3/rustc_codegen_cranelift
1212
$ cd rustc_codegen_cranelift
13-
$ ./y.rs prepare
14-
$ ./y.rs build
13+
$ ./y.sh prepare
14+
$ ./y.sh build
1515
```
1616

1717
To run the test suite replace the last command with:
@@ -20,7 +20,7 @@ To run the test suite replace the last command with:
2020
$ ./test.sh
2121
```
2222

23-
For more docs on how to build and test see [build_system/usage.txt](build_system/usage.txt) or the help message of `./y.rs`.
23+
For more docs on how to build and test see [build_system/usage.txt](build_system/usage.txt) or the help message of `./y.sh`.
2424

2525
## Precompiled builds
2626

@@ -35,7 +35,7 @@ If you want to use `cargo clif build` instead of having to specify the full path
3535

3636
rustc_codegen_cranelift can be used as a near-drop-in replacement for `cargo build` or `cargo run` for existing projects.
3737

38-
Assuming `$cg_clif_dir` is the directory you cloned this repo into and you followed the instructions (`y.rs prepare` and `y.rs build` or `test.sh`).
38+
Assuming `$cg_clif_dir` is the directory you cloned this repo into and you followed the instructions (`y.sh prepare` and `y.sh build` or `test.sh`).
3939

4040
In the directory with your project (where you can do the usual `cargo build`), run:
4141

build_sysroot/Cargo.toml

Lines changed: 0 additions & 36 deletions
This file was deleted.

build_sysroot/src/lib.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)