about summary refs log tree commit diff
path: root/build_sysroot/prepare_sysroot_src.sh
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2018-12-14 13:58:33 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2018-12-15 16:18:03 +0100
commit1e5c6bc5b86c4ff61ef3de63a9748789d5b369b0 (patch)
tree3b534c853745f053ca9557e3da48922b91466c20 /build_sysroot/prepare_sysroot_src.sh
parent9351f1d0c7763ee8564e096eaa3ed607f089e5db (diff)
downloadrust-1e5c6bc5b86c4ff61ef3de63a9748789d5b369b0.tar.gz
rust-1e5c6bc5b86c4ff61ef3de63a9748789d5b369b0.zip
Stop using xargo for building the sysroot
It is currently broken. (see https://github.com/japaric/xargo/issues/227)

This makes it easier to for example patch whole crates away.
Diffstat (limited to 'build_sysroot/prepare_sysroot_src.sh')
-rwxr-xr-xbuild_sysroot/prepare_sysroot_src.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/build_sysroot/prepare_sysroot_src.sh b/build_sysroot/prepare_sysroot_src.sh
new file mode 100755
index 00000000000..fceccdb4dea
--- /dev/null
+++ b/build_sysroot/prepare_sysroot_src.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+set -e
+cd $(dirname "$0")
+
+SRC_DIR=$(dirname $(rustup which rustc))"/../lib/rustlib/src/rust/"
+DST_DIR="sysroot_src"
+
+if [ ! -e $SRC_DIR ]; then
+    echo "Please install rust-src component"
+    exit 1
+fi
+
+rm -rf $DST_DIR
+mkdir -p $DST_DIR/src
+cp -r $SRC_DIR/src $DST_DIR/
+
+pushd $DST_DIR
+echo "[GIT] init"
+git init
+echo "[GIT] add"
+git add .
+echo "[GIT] commit"
+git commit -m "Initial commit" -q
+for file in $(ls ../../patches/ | grep -v patcha); do
+echo "[GIT] apply" $file
+git apply ../../patches/$file
+git commit -am "Patch $file"
+done
+popd
+
+echo "Successfully prepared libcore for building"