Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .evergreen/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ for arg; do
if [ $arg == "rust" ]; then
curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path $DEFAULT_HOST_OPTIONS

# Cygwin has a bug with reporting symlink paths that breaks rustup; see
# https://github.com/rust-lang/rustup/issues/4239. This works around it by replacing the
# symlinks with copies.
if [ "Windows_NT" == "$OS" ]; then
pushd ${CARGO_HOME}/bin
python3 ../../.evergreen/unsymlink.py
popd
fi

# 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
Expand Down
19 changes: 19 additions & 0 deletions .evergreen/unsymlink.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os
import shutil

found = []
for entry in os.scandir():
if not entry.is_symlink():
print(f"Skipping {entry.name}: not a symlink")
continue
target = os.readlink(entry.name)
if target != "rustup.exe":
print(f"Skipping {entry.name}: not rustup.exe")
continue
print(f"Found {entry.name}")
found.append(entry.name)

for name in found:
print(f"Replacing {name} symlink with copy")
os.remove(name)
shutil.copy2("rustup.exe", name)