]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh
Rollup merge of #97101 - coolreader18:exitcode-method-issue, r=yaahc
[rust.git] / compiler / rustc_codegen_cranelift / scripts / setup_rust_fork.sh
1 #!/usr/bin/env bash
2 set -e
3
4 ./y.rs build --no-unstable-features
5
6 echo "[SETUP] Rust fork"
7 git clone https://github.com/rust-lang/rust.git || true
8 pushd rust
9 git fetch
10 git checkout -- .
11 git checkout "$(rustc -V | cut -d' ' -f3 | tr -d '(')"
12
13 git apply - <<EOF
14 diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml
15 index d95b5b7f17f..00b6f0e3635 100644
16 --- a/library/alloc/Cargo.toml
17 +++ b/library/alloc/Cargo.toml
18 @@ -8,7 +8,7 @@ edition = "2018"
19
20  [dependencies]
21  core = { path = "../core" }
22 -compiler_builtins = { version = "0.1.40", features = ['rustc-dep-of-std'] }
23 +compiler_builtins = { version = "0.1.66", features = ['rustc-dep-of-std', 'no-asm'] }
24
25  [dev-dependencies]
26  rand = "0.7"
27  rand_xorshift = "0.2"
28 diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
29 index 8431aa7b818..a3ff7e68ce5 100644
30 --- a/src/tools/compiletest/src/runtest.rs
31 +++ b/src/tools/compiletest/src/runtest.rs
32 @@ -3489,11 +3489,7 @@ fn normalize_output(&self, output: &str, custom_rules: &[(String, String)]) -> S
33              .join("library");
34          normalize_path(&src_dir, "$(echo '$SRC_DIR')");
35
36 -        if let Some(virtual_rust_source_base_dir) =
37 -            option_env!("CFG_VIRTUAL_RUST_SOURCE_BASE_DIR").map(PathBuf::from)
38 -        {
39 -            normalize_path(&virtual_rust_source_base_dir.join("library"), "$(echo '$SRC_DIR')");
40 -        }
41 +        normalize_path(&Path::new("$(cd ../build_sysroot/sysroot_src/library; pwd)"), "$(echo '$SRC_DIR')");
42
43          // Paths into the build directory
44          let test_build_dir = &self.config.build_base;
45 EOF
46
47 cat > config.toml <<EOF
48 changelog-seen = 2
49
50 [llvm]
51 ninja = false
52
53 [build]
54 rustc = "$(pwd)/../build/rustc-clif"
55 cargo = "$(rustup which cargo)"
56 full-bootstrap = true
57 local-rebuild = true
58
59 [rust]
60 codegen-backends = ["cranelift"]
61 deny-warnings = false
62 verbose-tests = false
63 EOF
64 popd