mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-21 01:13:56 +00:00
packaging: Don't build runtime-rs if no RUST_VERSION is provided
As the CCv0 effort is not using the runtime-rs, let's add a mechanism to avoid building it. The easiest way to do so, is to simply *not* build the runtime-rs if the RUST_VERSION is not provided, and then not providing the RUST_VERSION as part of the cc-shim-v2-tarball target. Fixes: #5462 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
2ca6319f18
commit
299829aec0
@ -149,9 +149,7 @@ install_cc_qemu() {
|
|||||||
#Install all components that are not assets
|
#Install all components that are not assets
|
||||||
install_cc_shimv2() {
|
install_cc_shimv2() {
|
||||||
GO_VERSION="$(yq r ${versions_yaml} languages.golang.meta.newest-version)"
|
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 GO_VERSION
|
||||||
export RUST_VERSION
|
|
||||||
export REMOVE_VMM_CONFIGS="acrn fc"
|
export REMOVE_VMM_CONFIGS="acrn fc"
|
||||||
|
|
||||||
extra_opts="DEFSERVICEOFFLOAD=true"
|
extra_opts="DEFSERVICEOFFLOAD=true"
|
||||||
|
@ -14,7 +14,7 @@ readonly kernel_builder="${repo_root_dir}/tools/packaging/kernel/build-kernel.sh
|
|||||||
|
|
||||||
|
|
||||||
GO_VERSION=${GO_VERSION}
|
GO_VERSION=${GO_VERSION}
|
||||||
RUST_VERSION=${RUST_VERSION}
|
RUST_VERSION=${RUST_VERSION:-}
|
||||||
|
|
||||||
DESTDIR=${DESTDIR:-${PWD}}
|
DESTDIR=${DESTDIR:-${PWD}}
|
||||||
PREFIX=${PREFIX:-/opt/kata}
|
PREFIX=${PREFIX:-/opt/kata}
|
||||||
@ -30,15 +30,17 @@ if [ ${arch} = "ppc64le" ]; then
|
|||||||
arch="ppc64"
|
arch="ppc64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
if [ -n "${RUST_VERSION}" ]; then
|
||||||
-w "${repo_root_dir}/src/runtime-rs" \
|
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
||||||
"${container_image}" \
|
-w "${repo_root_dir}/src/runtime-rs" \
|
||||||
bash -c "git config --global --add safe.directory ${repo_root_dir} && make PREFIX=${PREFIX} QEMUCMD=qemu-system-${arch}"
|
"${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}" \
|
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
||||||
-w "${repo_root_dir}/src/runtime-rs" \
|
-w "${repo_root_dir}/src/runtime-rs" \
|
||||||
"${container_image}" \
|
"${container_image}" \
|
||||||
bash -c "git config --global --add safe.directory ${repo_root_dir} && make PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" install"
|
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}" \
|
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
||||||
-w "${repo_root_dir}/src/runtime" \
|
-w "${repo_root_dir}/src/runtime" \
|
||||||
|
@ -51,11 +51,13 @@ EOF
|
|||||||
trap finish EXIT
|
trap finish EXIT
|
||||||
|
|
||||||
rust_version=${2:-}
|
rust_version=${2:-}
|
||||||
ARCH=${ARCH:-$(uname -m)}
|
if [ -n "${rust_version}" ]; then
|
||||||
LIBC=${LIBC:-musl}
|
ARCH=${ARCH:-$(uname -m)}
|
||||||
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSLf | sh -s -- -y --default-toolchain ${rust_version} -t ${ARCH}-unknown-linux-${LIBC}
|
LIBC=${LIBC:-musl}
|
||||||
source /root/.cargo/env
|
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSLf | sh -s -- -y --default-toolchain ${rust_version} -t ${ARCH}-unknown-linux-${LIBC}
|
||||||
rustup target add x86_64-unknown-linux-musl
|
source /root/.cargo/env
|
||||||
|
rustup target add x86_64-unknown-linux-musl
|
||||||
|
fi
|
||||||
|
|
||||||
pushd "${tmp_dir}"
|
pushd "${tmp_dir}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user