2021-10-23 02:53:59 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-10-28 10:46:45 +02:00
|
|
|
# Put our vendored version of cargo on the path. Can be helpful if you need
|
|
|
|
# quick access to cargo on a machine that does not have Rust installed
|
|
|
|
# separately, or want to run a quick check. Eg:
|
2021-10-23 02:53:59 +02:00
|
|
|
|
|
|
|
# $ . scripts/cargo-env
|
|
|
|
# $ (cd rslib && cargo check)
|
|
|
|
|
2021-10-28 10:46:45 +02:00
|
|
|
BAZEL_EXTERNAL=$(bazel info output_base --ui_event_filters=-INFO)/external
|
2021-10-23 02:53:59 +02:00
|
|
|
|
|
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
|
|
if [ "$(arch)" == "i386" ]; then
|
|
|
|
export PATH="$BAZEL_EXTERNAL/rust_darwin_x86_64/bin:$PATH"
|
|
|
|
else
|
2021-12-04 08:03:03 +01:00
|
|
|
export PATH="$BAZEL_EXTERNAL/rust_darwin_aarch64/bin:$PATH"
|
2021-10-23 02:53:59 +02:00
|
|
|
fi
|
|
|
|
else
|
2021-10-28 10:46:45 +02:00
|
|
|
if [ "$(arch)" == "aarch64" ]; then
|
|
|
|
export PATH="$BAZEL_EXTERNAL/rust_linux_aarch64/bin:$PATH"
|
|
|
|
else
|
2021-10-23 02:53:59 +02:00
|
|
|
export PATH="$BAZEL_EXTERNAL/rust_linux_x86_64/bin:$PATH"
|
2021-10-28 10:46:45 +02:00
|
|
|
fi
|
2021-10-23 02:53:59 +02:00
|
|
|
fi
|