From 3da682a95141ff731665c19eb0fd917ce97c2948 Mon Sep 17 00:00:00 2001 From: George Rogers Date: Wed, 16 Jan 2019 12:57:58 -0600 Subject: [PATCH 1/9] update --- bin/compile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/compile b/bin/compile index 2405025..835659a 100755 --- a/bin/compile +++ b/bin/compile @@ -79,7 +79,7 @@ fi # Record our Rust build environment configuration in an export file, in # case another buildpack needs it to build Ruby gems that use Rust or # something like that. -cat < $BP_DIR/export + # Our rustup installation. export RUSTUP_HOME="$CACHE_DIR/multirust" @@ -89,10 +89,8 @@ export CARGO_HOME="$CACHE_DIR/cargo" # Include binaries installed by cargo and rustup in our path. PATH="\$CARGO_HOME/bin:\$PATH" -EOF # Read our build environment back in and evaluate it so that we can use it. -. $BP_DIR/export # Switch to our cache directory. mkdir -p "$CACHE_DIR" From 340ea6f248fe1e6e98df820c48908bea91d7852e Mon Sep 17 00:00:00 2001 From: George Rogers Date: Wed, 16 Jan 2019 12:59:47 -0600 Subject: [PATCH 2/9] update --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 835659a..adc68a8 100755 --- a/bin/compile +++ b/bin/compile @@ -88,7 +88,7 @@ export RUSTUP_HOME="$CACHE_DIR/multirust" export CARGO_HOME="$CACHE_DIR/cargo" # Include binaries installed by cargo and rustup in our path. -PATH="\$CARGO_HOME/bin:\$PATH" +PATH="$CARGO_HOME/bin:$PATH" # Read our build environment back in and evaluate it so that we can use it. From 6f34656976ea595e9c5a74bf84821550a4bcdef8 Mon Sep 17 00:00:00 2001 From: George Rogers Date: Wed, 16 Jan 2019 13:01:42 -0600 Subject: [PATCH 3/9] update --- bin/compile | 45 +++++++-------------------------------------- 1 file changed, 7 insertions(+), 38 deletions(-) diff --git a/bin/compile b/bin/compile index adc68a8..1caa064 100755 --- a/bin/compile +++ b/bin/compile @@ -52,30 +52,6 @@ if [ -z ${VERSION+x} ]; then exit 1 fi -# Notify users running old, unstable versions of Rust about how to deploy -# successfully. -if [ $RUST_SKIP_BUILD -ne 1 ] && ( [ ! -z ${CARGO_URL+x} ] || [ ! -f "$BUILD_DIR/$BUILD_PATH/Cargo.toml" ] ); then - >&2 cat <&2 cat < Checking for new releases of Rust $VERSION channel" - # It's possible that $VERSION has changed, or the `stable` channel has updated. - rustup self update - rustup update "$VERSION" - rustup default "$VERSION" -else - echo "-----> Downloading rustup" - curl https://sh.rustup.rs -sSf > rustup.sh - chmod u+x rustup.sh - echo "-----> Using rustup to install Rust channel $VERSION" - ./rustup.sh -y --default-toolchain "$VERSION" - rm rustup.sh -fi +echo "-----> Downloading rustup" +curl https://sh.rustup.rs -sSf > rustup.sh +chmod u+x rustup.sh +echo "-----> Using rustup to install Rust channel $VERSION" +./rustup.sh -y --default-toolchain "$VERSION" +rm rustup.sh + if [ ! -x "$CARGO_HOME/bin/rustc" ]; then echo "failed: Cannot find Rust binaries at $CARGO_HOME" exit 1 From 18edc39123bdc5189b4b5835f2ee5061fd622dcc Mon Sep 17 00:00:00 2001 From: George Rogers Date: Wed, 16 Jan 2019 13:05:03 -0600 Subject: [PATCH 4/9] update --- bin/compile | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/bin/compile b/bin/compile index 1caa064..2c0c4fd 100755 --- a/bin/compile +++ b/bin/compile @@ -72,13 +72,18 @@ PATH="$CARGO_HOME/bin:$PATH" mkdir -p "$CACHE_DIR" cd "$CACHE_DIR" -# Make sure we have an appropriate Rust toolchain installed. -echo "-----> Downloading rustup" -curl https://sh.rustup.rs -sSf > rustup.sh -chmod u+x rustup.sh -echo "-----> Using rustup to install Rust channel $VERSION" -./rustup.sh -y --default-toolchain "$VERSION" -rm rustup.sh +if $(which rustup); then + rustup self update + rustup update +else + # Make sure we have an appropriate Rust toolchain installed. + echo "-----> Downloading rustup" + curl https://sh.rustup.rs -sSf > rustup.sh + chmod u+x rustup.sh + echo "-----> Using rustup to install Rust channel $VERSION" + ./rustup.sh -y --default-toolchain "$VERSION" + rm rustup.sh +fi if [ ! -x "$CARGO_HOME/bin/rustc" ]; then echo "failed: Cannot find Rust binaries at $CARGO_HOME" From 9b01f13cadc5f66668f9e473eb85e52cf32c8031 Mon Sep 17 00:00:00 2001 From: George Rogers Date: Wed, 16 Jan 2019 13:19:46 -0600 Subject: [PATCH 5/9] update --- bin/compile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index 2c0c4fd..0c6e1eb 100755 --- a/bin/compile +++ b/bin/compile @@ -59,14 +59,18 @@ fi # Our rustup installation. export RUSTUP_HOME="$CACHE_DIR/multirust" +cat < $BP_DIR/export +# Our rustup installation. +export RUSTUP_HOME="$CACHE_DIR/multirust" # Our cargo installation. We implicitly trust Rustup and Cargo # to do the right thing when new versions are released. export CARGO_HOME="$CACHE_DIR/cargo" - # Include binaries installed by cargo and rustup in our path. -PATH="$CARGO_HOME/bin:$PATH" +PATH="\$CARGO_HOME/bin:\$PATH" +EOF # Read our build environment back in and evaluate it so that we can use it. +. $BP_DIR/export # Switch to our cache directory. mkdir -p "$CACHE_DIR" From a8b565e7c5fbaf2ce18d1a059e921638655be34a Mon Sep 17 00:00:00 2001 From: George Rogers Date: Wed, 16 Jan 2019 13:47:19 -0600 Subject: [PATCH 6/9] update --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 0c6e1eb..f8b581e 100755 --- a/bin/compile +++ b/bin/compile @@ -76,7 +76,7 @@ EOF mkdir -p "$CACHE_DIR" cd "$CACHE_DIR" -if $(which rustup); then +if which rustup; then rustup self update rustup update else From 84eabbcd8699854c092f1613452fad21110fef35 Mon Sep 17 00:00:00 2001 From: George Rogers Date: Wed, 16 Jan 2019 14:27:46 -0600 Subject: [PATCH 7/9] update --- bin/compile | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/bin/compile b/bin/compile index f8b581e..dd72f03 100755 --- a/bin/compile +++ b/bin/compile @@ -52,7 +52,43 @@ if [ -z ${VERSION+x} ]; then exit 1 fi + +# Notify users running old, unstable versions of Rust about how to deploy +# successfully. +if [ $RUST_SKIP_BUILD -ne 1 ] && ( [ ! -z ${CARGO_URL+x} ] || [ ! -f "$BUILD_DIR/$BUILD_PATH/Cargo.toml" ] ); then + >&2 cat <&2 cat < $BP_DIR/export +# Our rustup installation. +export RUSTUP_HOME="$CACHE_DIR/multirust" +# Our cargo installation. We implicitly trust Rustup and Cargo +# to do the right thing when new versions are released. +export CARGO_HOME="$CACHE_DIR/cargo" +# Include binaries installed by cargo and rustup in our path. +PATH="\$CARGO_HOME/bin:\$PATH" +EOF + # case another buildpack needs it to build Ruby gems that use Rust or # something like that. From 3ac6a23810b0d2c10fa179cb675aff9dbeda8227 Mon Sep 17 00:00:00 2001 From: George Rogers Date: Wed, 16 Jan 2019 14:29:33 -0600 Subject: [PATCH 8/9] update --- bin/compile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index dd72f03..bc78023 100755 --- a/bin/compile +++ b/bin/compile @@ -76,8 +76,6 @@ EOF exit 1 fi -# Read our build environment back in and evaluate it so that we can use it. -. $BP_DIR/export # Record our Rust build environment configuration in an export file, in cat < $BP_DIR/export # Our rustup installation. @@ -89,6 +87,8 @@ export CARGO_HOME="$CACHE_DIR/cargo" PATH="\$CARGO_HOME/bin:\$PATH" EOF +# Read our build environment back in and evaluate it so that we can use it. +. $BP_DIR/export # case another buildpack needs it to build Ruby gems that use Rust or # something like that. From 82f8c24d04b9d000ed7429ca924be93ea0e480d7 Mon Sep 17 00:00:00 2001 From: George Rogers Date: Wed, 16 Jan 2019 14:31:49 -0600 Subject: [PATCH 9/9] update --- bin/compile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index bc78023..6a3e2d7 100755 --- a/bin/compile +++ b/bin/compile @@ -113,8 +113,11 @@ mkdir -p "$CACHE_DIR" cd "$CACHE_DIR" if which rustup; then + echo "-----> Checking for new releases of Rust $VERSION channel" + # It's possible that $VERSION has changed, or the `stable` channel has updated. rustup self update - rustup update + rustup update "$VERSION" + rustup default "$VERSION" else # Make sure we have an appropriate Rust toolchain installed. echo "-----> Downloading rustup"