about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-11-01 16:57:14 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2020-11-02 18:54:55 +0100
commit54b1d101efec3da791aee1f98fb26230e88b9a05 (patch)
treef766b683ac06d5d9cc912e1d59a4875693403e3f /scripts
parent646b00ff7710fb9f8a1a6de744f38bdcb1c932d7 (diff)
downloadrust-54b1d101efec3da791aee1f98fb26230e88b9a05.tar.gz
rust-54b1d101efec3da791aee1f98fb26230e88b9a05.zip
Test bootstrapping of rustc using cg_clif
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/test_bootstrap.sh65
1 files changed, 65 insertions, 0 deletions
diff --git a/scripts/test_bootstrap.sh b/scripts/test_bootstrap.sh
new file mode 100755
index 00000000000..7f43f81a6cd
--- /dev/null
+++ b/scripts/test_bootstrap.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+set -e
+
+cd $(dirname "$0")/../
+
+./build.sh
+source build/config.sh
+
+echo "[TEST] Bootstrap of rustc"
+git clone https://github.com/rust-lang/rust.git || true
+pushd rust
+git fetch
+git checkout -- .
+git checkout $(rustc -V | cut -d' ' -f3 | tr -d '(')
+
+git apply - <<EOF
+diff --git a/.gitmodules b/.gitmodules
+index 984113151de..c1e9d960d56 100644
+--- a/.gitmodules
++++ b/.gitmodules
+@@ -34,10 +34,6 @@
+ [submodule "src/doc/edition-guide"]
+ 	path = src/doc/edition-guide
+ 	url = https://github.com/rust-lang/edition-guide.git
+-[submodule "src/llvm-project"]
+-	path = src/llvm-project
+-	url = https://github.com/rust-lang/llvm-project.git
+-	branch = rustc/11.0-2020-10-12
+ [submodule "src/doc/embedded-book"]
+ 	path = src/doc/embedded-book
+ 	url = https://github.com/rust-embedded/book.git
+diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml
+index 23e689fcae7..5f077b765b6 100644
+--- a/compiler/rustc_data_structures/Cargo.toml
++++ b/compiler/rustc_data_structures/Cargo.toml
+@@ -32,7 +32,6 @@ tempfile = "3.0.5"
+
+ [dependencies.parking_lot]
+ version = "0.11"
+-features = ["nightly"]
+
+ [target.'cfg(windows)'.dependencies]
+ winapi = { version = "0.3", features = ["fileapi", "psapi"] }
+EOF
+
+cat > config.toml <<EOF
+[llvm]
+ninja = false
+
+[build]
+rustc = "$(pwd)/../build/cg_clif"
+cargo = "$(rustup which cargo)"
+full-bootstrap = true
+local-rebuild = true
+
+[rust]
+codegen-backends = ["cranelift"]
+EOF
+
+rm -r compiler/rustc_codegen_cranelift/{Cargo.*,src}
+cp ../Cargo.* compiler/rustc_codegen_cranelift/
+cp -r ../src compiler/rustc_codegen_cranelift/src
+
+./x.py build --stage 1 library/std
+popd