forked from mongodb-labs/drivers-evergreen-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Rust Installer (mongodb-labs#499)
- Loading branch information
1 parent
bdbaa6d
commit 1729095
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) | ||
. $SCRIPT_DIR/handle-paths.sh | ||
pushd $SCRIPT_DIR | ||
|
||
export RUSTUP_HOME="${RUSTUP_HOME:-"${DRIVERS_TOOLS}/.rustup"}" | ||
export CARGO_HOME="${CARGO_HOME:-"${DRIVERS_TOOLS}/.cargo"}" | ||
export PATH="${RUSTUP_HOME}/bin:${CARGO_HOME}/bin:$PATH" | ||
|
||
# Make sure to use msvc toolchain rather than gnu, which is the default for cygwin | ||
if [ "Windows_NT" == "${OS:-}" ]; then | ||
export DEFAULT_HOST_OPTIONS='--default-host x86_64-pc-windows-msvc' | ||
# rustup/cargo need the native Windows paths | ||
RUSTUP_HOME=$(cygpath ${RUSTUP_HOME} --windows) | ||
CARGO_HOME=$(cygpath ${CARGO_HOME} --windows) | ||
fi | ||
|
||
curl --retry 8 https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path ${DEFAULT_HOST_OPTIONS:-} | ||
|
||
if [ "Windows_NT" == "${OS:-}" ]; then | ||
# This file is not created by default on Windows | ||
echo 'export PATH="$PATH:${CARGO_HOME}/bin"' >>${CARGO_HOME}/env | ||
echo "export CARGO_NET_GIT_FETCH_WITH_CLI=true" >>${CARGO_HOME}/env | ||
fi | ||
|
||
echo "cargo location: $(which cargo)" | ||
echo "cargo version: $(cargo --version)" | ||
echo "rustc location: $(which rustc)" | ||
echo "rustc version: $(rustc --version)" | ||
|
||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,6 +118,8 @@ mo-expansion.sh | |
.env | ||
.bin | ||
.kube | ||
.cargo | ||
.rustup | ||
|
||
# Azure functions. | ||
.python_packages/ | ||
|