about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-09-16 16:46:02 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2020-09-16 16:46:02 +0200
commit7285c134d101d441cddb9b62d33d4791d1b87dc0 (patch)
treefa19d9f0a0229fa833437ca13385d3dbdd86f458
parent044470a7262e0b890181ba73c3ccf5160d2bff70 (diff)
downloadrust-7285c134d101d441cddb9b62d33d4791d1b87dc0.tar.gz
rust-7285c134d101d441cddb9b62d33d4791d1b87dc0.zip
Reorganize scripts
-rwxr-xr-xbuild_sysroot/build_sysroot.sh2
-rwxr-xr-xcargo.sh2
-rw-r--r--scripts/Readme.md2
-rw-r--r--scripts/config.sh (renamed from config.sh)1
-rwxr-xr-xscripts/filter_profile.rs (renamed from filter_profile.rs)6
-rwxr-xr-xscripts/rustup.sh (renamed from rustup.sh)0
-rwxr-xr-xtest.sh3
7 files changed, 10 insertions, 6 deletions
diff --git a/build_sysroot/build_sysroot.sh b/build_sysroot/build_sysroot.sh
index b4b7c5e5e01..4404fb49238 100755
--- a/build_sysroot/build_sysroot.sh
+++ b/build_sysroot/build_sysroot.sh
@@ -6,7 +6,7 @@ set -e
 cd $(dirname "$0")
 
 pushd ../ >/dev/null
-source ./config.sh
+source ./scripts/config.sh
 popd >/dev/null
 
 # Cleanup for previous run
diff --git a/cargo.sh b/cargo.sh
index d5be7773d34..ba4b7d6c942 100755
--- a/cargo.sh
+++ b/cargo.sh
@@ -5,7 +5,7 @@ export CHANNEL='release'
 fi
 
 pushd $(dirname "$0") >/dev/null
-source config.sh
+source scripts/config.sh
 
 # read nightly compiler from rust-toolchain file
 TOOLCHAIN=$(cat rust-toolchain)
diff --git a/scripts/Readme.md b/scripts/Readme.md
new file mode 100644
index 00000000000..83cec9c6f36
--- /dev/null
+++ b/scripts/Readme.md
@@ -0,0 +1,2 @@
+This directory is for scripts that are either never directly invoked or are not used very often.
+Scripts that are frequently used should be kept at the project root.
diff --git a/config.sh b/scripts/config.sh
index b47da434c64..93db4a54a56 100644
--- a/config.sh
+++ b/scripts/config.sh
@@ -38,7 +38,6 @@ if [[ `uname` == 'Darwin' ]]; then
    export RUSTFLAGS="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
 fi
 
-RUSTC="rustc $RUSTFLAGS -L crate=target/out --out-dir target/out"
 export RUSTC_LOG=warn # display metadata load errors
 
 export LD_LIBRARY_PATH="$(pwd)/target/out:$(pwd)/build_sysroot/sysroot/lib/rustlib/$TARGET_TRIPLE/lib"
diff --git a/filter_profile.rs b/scripts/filter_profile.rs
index 82bf53934b8..75f2f61b21a 100755
--- a/filter_profile.rs
+++ b/scripts/filter_profile.rs
@@ -2,8 +2,10 @@
 #![forbid(unsafe_code)]/* This line is ignored by bash
 # This block is ignored by rustc
 CHANNEL="release"
-source ./config.sh
-CG_CLIF_JIT=1 PROFILE=$1 OUTPUT=$2 exec $RUSTC $0 --crate-type bin -Cprefer-dynamic
+pushd $(dirname "$0")/../
+source scripts/config.sh
+popd
+CG_CLIF_JIT=1 PROFILE=$1 OUTPUT=$2 exec rustc $RUSTFLAGS $0 --crate-type bin -Cprefer-dynamic
 #*/
 
 //! This program filters away uninteresting samples and trims uninteresting frames for stackcollapse
diff --git a/rustup.sh b/scripts/rustup.sh
index b911320f7a0..b911320f7a0 100755
--- a/rustup.sh
+++ b/scripts/rustup.sh
diff --git a/test.sh b/test.sh
index 230e464d279..67dd4d3aa00 100755
--- a/test.sh
+++ b/test.sh
@@ -11,8 +11,9 @@ else
 fi
 
 # Config
-source config.sh
+source scripts/config.sh
 export CG_CLIF_INCR_CACHE_DISABLED=1
+RUSTC="rustc $RUSTFLAGS -L crate=target/out --out-dir target/out"
 
 # Cleanup
 rm -r target/out || true