rootfs: Install Rust only when necessary

For docker-based builds only install Rust when necessary.
Further, execute the detect Rust version check only when
intending to install Rust.
As of today, this is the case when we intend to build the
agent during rootfs build.

Signed-off-by: Manuel Huber <mahuber@microsoft.com>
This commit is contained in:
Manuel Huber
2024-06-13 22:48:34 +00:00
parent 62fd84dfd8
commit 4b2e725d03
2 changed files with 11 additions and 8 deletions

View File

@@ -385,12 +385,6 @@ build_rootfs_distro()
mkdir -p ${ROOTFS_DIR}
fi
# need to detect rustc's version too?
detect_rust_version ||
die "Could not detect the required rust version for AGENT_VERSION='${AGENT_VERSION:-main}'."
echo "Required rust version: $RUST_VERSION"
if [ "${SELINUX}" == "yes" ]; then
if [ "${AGENT_INIT}" == "yes" ]; then
die "Guest SELinux with the agent init is not supported yet"