about summary refs log tree commit diff
diff options
context:
space:
mode:
authorantoyo <antoyo@users.noreply.github.com>2022-03-23 12:11:28 -0400
committerGitHub <noreply@github.com>2022-03-23 12:11:28 -0400
commita22e15b954d2be638ab0b15cee6e93cf301dc159 (patch)
tree84de12469f6ee462e9dc5819c5877faacd5208c6
parent44c0204af3ac285474a779f777f0adc158a8344b (diff)
parent842a5fba1ce9c82389f529ca88bb586749308f5c (diff)
downloadrust-a22e15b954d2be638ab0b15cee6e93cf301dc159.tar.gz
rust-a22e15b954d2be638ab0b15cee6e93cf301dc159.zip
Merge pull request #143 from yvt/sysroot-profile
Add `--release-sysroot` flag to `build.sh`
-rwxr-xr-xbuild.sh29
1 files changed, 27 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 8a621e12b04..230ab7b6d42 100755
--- a/build.sh
+++ b/build.sh
@@ -3,6 +3,26 @@
 #set -x
 set -e
 
+codegen_channel=debug
+sysroot_channel=debug
+
+while [[ $# -gt 0 ]]; do
+    case $1 in
+        --release)
+            codegen_channel=release
+            shift
+            ;;
+        --release-sysroot)
+            sysroot_channel=release
+            shift
+            ;;
+        *)
+            echo "Unknown option $1"
+            exit 1
+            ;;
+    esac
+done
+
 if [ -f ./gcc_path ]; then
     export GCC_PATH=$(cat gcc_path)
 else
@@ -21,7 +41,7 @@ if [[ "$1" == "--features" ]]; then
     shift
 fi
 
-if [[ "$1" == "--release" ]]; then
+if [[ "$codegen_channel" == "release" ]]; then
     export CHANNEL='release'
     CARGO_INCREMENTAL=1 cargo rustc --release $features
 else
@@ -36,4 +56,9 @@ rm -r target/out || true
 mkdir -p target/out/gccjit
 
 echo "[BUILD] sysroot"
-time ./build_sysroot/build_sysroot.sh $CHANNEL
+if [[ "$sysroot_channel" == "release" ]]; then
+    time ./build_sysroot/build_sysroot.sh --release
+else
+    time ./build_sysroot/build_sysroot.sh
+fi
+