Skip to content

Commit

Permalink
Merge pull request rust-lang#143 from yvt/sysroot-profile
Browse files Browse the repository at this point in the history
Add `--release-sysroot` flag to `build.sh`
  • Loading branch information
antoyo authored Mar 23, 2022
2 parents 44c0204 + 842a5fb commit a22e15b
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit a22e15b

Please sign in to comment.