From 0f43ec8ff79472d91acfe73717ddfc07ce1b5dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 30 Jan 2023 13:59:16 +0100 Subject: [PATCH] Revert "packaging: Don't build runtime-rs if no RUST_VERSION is provided" This reverts commit 299829aec09a1f237b85bc6cebd49980766ef33f, as we'll start adding TDX support for the runtime-rs. --- .../local-build/kata-deploy-binaries.sh | 2 ++ tools/packaging/static-build/shim-v2/build.sh | 22 +++++++++---------- .../static-build/shim-v2/install_go_rust.sh | 12 +++++----- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh index 5dd3f0968a..94ccb105ec 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh @@ -344,7 +344,9 @@ install_cc_shimv2() { && return 0 GO_VERSION="$(yq r ${versions_yaml} languages.golang.meta.newest-version)" + RUST_VERSION="$(yq r ${versions_yaml} languages.rust.meta.newest-version)" export GO_VERSION + export RUST_VERSION export REMOVE_VMM_CONFIGS="acrn fc" extra_opts="DEFSERVICEOFFLOAD=true" diff --git a/tools/packaging/static-build/shim-v2/build.sh b/tools/packaging/static-build/shim-v2/build.sh index bedf55d92c..10df1a0b30 100755 --- a/tools/packaging/static-build/shim-v2/build.sh +++ b/tools/packaging/static-build/shim-v2/build.sh @@ -15,7 +15,7 @@ source "${script_dir}/../../scripts/lib.sh" readonly kernel_builder="${repo_root_dir}/tools/packaging/kernel/build-kernel.sh" GO_VERSION=${GO_VERSION} -RUST_VERSION=${RUST_VERSION:-} +RUST_VERSION=${RUST_VERSION} DESTDIR=${DESTDIR:-${PWD}} PREFIX=${PREFIX:-/opt/kata} @@ -38,18 +38,16 @@ if [ ${arch} = "ppc64le" ]; then arch="ppc64" fi -if [ -n "${RUST_VERSION}" ]; then - sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ - -w "${repo_root_dir}/src/runtime-rs" \ - "${container_image}" \ - bash -c "git config --global --add safe.directory ${repo_root_dir} && make PREFIX=${PREFIX} QEMUCMD=qemu-system-${arch}" - - sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ - -w "${repo_root_dir}/src/runtime-rs" \ - "${container_image}" \ - bash -c "git config --global --add safe.directory ${repo_root_dir} && make PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" install" -fi +sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ + -w "${repo_root_dir}/src/runtime-rs" \ + "${container_image}" \ + bash -c "git config --global --add safe.directory ${repo_root_dir} && make PREFIX=${PREFIX} QEMUCMD=qemu-system-${arch}" +sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ + -w "${repo_root_dir}/src/runtime-rs" \ + "${container_image}" \ + bash -c "git config --global --add safe.directory ${repo_root_dir} && make PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" install" + sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ -w "${repo_root_dir}/src/runtime" \ "${container_image}" \ diff --git a/tools/packaging/static-build/shim-v2/install_go_rust.sh b/tools/packaging/static-build/shim-v2/install_go_rust.sh index 1ad638ab37..db192f673b 100755 --- a/tools/packaging/static-build/shim-v2/install_go_rust.sh +++ b/tools/packaging/static-build/shim-v2/install_go_rust.sh @@ -51,13 +51,11 @@ EOF trap finish EXIT rust_version=${2:-} -if [ -n "${rust_version}" ]; then - ARCH=${ARCH:-$(uname -m)} - LIBC=${LIBC:-musl} - curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSLf | sh -s -- -y --default-toolchain ${rust_version} -t ${ARCH}-unknown-linux-${LIBC} - source /root/.cargo/env - rustup target add x86_64-unknown-linux-musl -fi +ARCH=${ARCH:-$(uname -m)} +LIBC=${LIBC:-musl} +curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSLf | sh -s -- -y --default-toolchain ${rust_version} -t ${ARCH}-unknown-linux-${LIBC} +source /root/.cargo/env +rustup target add x86_64-unknown-linux-musl pushd "${tmp_dir}"