Skip to content

Commit a22e15b

Browse files
authored
Merge pull request rust-lang#143 from yvt/sysroot-profile
Add `--release-sysroot` flag to `build.sh`
2 parents 44c0204 + 842a5fb commit a22e15b

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

build.sh

+27-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@
33
#set -x
44
set -e
55

6+
codegen_channel=debug
7+
sysroot_channel=debug
8+
9+
while [[ $# -gt 0 ]]; do
10+
case $1 in
11+
--release)
12+
codegen_channel=release
13+
shift
14+
;;
15+
--release-sysroot)
16+
sysroot_channel=release
17+
shift
18+
;;
19+
*)
20+
echo "Unknown option $1"
21+
exit 1
22+
;;
23+
esac
24+
done
25+
626
if [ -f ./gcc_path ]; then
727
export GCC_PATH=$(cat gcc_path)
828
else
@@ -21,7 +41,7 @@ if [[ "$1" == "--features" ]]; then
2141
shift
2242
fi
2343

24-
if [[ "$1" == "--release" ]]; then
44+
if [[ "$codegen_channel" == "release" ]]; then
2545
export CHANNEL='release'
2646
CARGO_INCREMENTAL=1 cargo rustc --release $features
2747
else
@@ -36,4 +56,9 @@ rm -r target/out || true
3656
mkdir -p target/out/gccjit
3757

3858
echo "[BUILD] sysroot"
39-
time ./build_sysroot/build_sysroot.sh $CHANNEL
59+
if [[ "$sysroot_channel" == "release" ]]; then
60+
time ./build_sysroot/build_sysroot.sh --release
61+
else
62+
time ./build_sysroot/build_sysroot.sh
63+
fi
64+

0 commit comments

Comments
 (0)