0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 12:02:18 +02:00

Swift: Add an error message for missing rust-src when using xargo

xargo does print a reasonably nice error for this, but it doesn't
mention which toolchain to install rust-src for. Check ourselves so
that CocoaPods clients don't have to do something weird like "cd into
the package and run rustup there".
This commit is contained in:
Jordan Rose 2021-09-24 15:58:29 -07:00
parent d2c34f0f46
commit 5d99e87e2c

View File

@ -99,6 +99,13 @@ if [[ -n "${USE_XARGO:-}" ]]; then
printf "\n\t%s\n\n" "cargo install xargo" >&2
exit 1
fi
RUSTUP_TOOLCHAIN=${RUSTUP_TOOLCHAIN:-$(cat ./rust-toolchain)}
if ! rustup "+${RUSTUP_TOOLCHAIN}" component list --installed | grep -q rust-src; then
echo 'error: rust-src component not installed' >&2
echo 'note: get it by running' >&2
printf "\n\t%s\n\n" "rustup +${RUSTUP_TOOLCHAIN} component add rust-src" >&2
exit 1
fi
BUILD_CMD=xargo
fi