osbuilder: Source .cargo/env before checking Rust

We install Rust in the build containers, but we also install Rust in
`rootfs.sh` if it is missing. It makes sense to install Rust in the build
containers so it does not have to be installed every time, but for that check
to work on non-login shells, we should source `.cargo/env` before running it.

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
This commit is contained in:
Jakob Naucke 2021-12-22 19:06:26 +01:00
parent 8f80dffead
commit f10642c82b
No known key found for this signature in database
GPG Key ID: 45FA1C7D310C0EBE

View File

@ -554,6 +554,7 @@ EOT
echo "WARNING: Forcing LIBC=gnu because $ARCH has no musl Rust target"
fi
[ "$LIBC" == "musl" ] && bash ${script_dir}/../../../ci/install_musl.sh
test -r "${HOME}/.cargo/env" && source "${HOME}/.cargo/env"
# rust agent needs ${arch}-unknown-linux-${LIBC}
if ! (rustup show | grep -v linux-${LIBC} > /dev/null); then
if [ "$RUST_VERSION" == "null" ]; then