From 0af353632838365372144e36b9676942b7f22f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 8 Jan 2025 13:43:00 +0100 Subject: [PATCH] packaging: virtiofsd: Allow building a specific commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Right now we've been only building releases from virtiofsd, but we'll need to pin a specific commit till v1.14.0 is out, thus let's add the needed machinery to do so. Signed-off-by: Fabiano FidĂȘncio --- .../static-build/virtiofsd/build-static-virtiofsd.sh | 11 +++++++++-- tools/packaging/static-build/virtiofsd/build.sh | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/packaging/static-build/virtiofsd/build-static-virtiofsd.sh b/tools/packaging/static-build/virtiofsd/build-static-virtiofsd.sh index 9e8ed239ad..468df12654 100755 --- a/tools/packaging/static-build/virtiofsd/build-static-virtiofsd.sh +++ b/tools/packaging/static-build/virtiofsd/build-static-virtiofsd.sh @@ -22,14 +22,19 @@ virtiofsd_zip="${virtiofsd_zip:-}" [ -n "$virtiofsd_repo" ] || die "failed to get virtiofsd repo" [ -n "$virtiofsd_version" ] || die "failed to get virtiofsd version" -[ -n "${virtiofsd_zip}" ] || die "failed to get virtiofsd binary URL" [ -d "virtiofsd" ] && rm -r virtiofsd pull_virtiofsd_released_binary() { + if [ -z "${virtiofsd_zip}" ]; then + info "failed to get virtiofsd binary URL" + return 1 + fi + if [ "${ARCH}" != "x86_64" ]; then info "Only x86_64 binaries are distributed as part of the virtiofsd releases" && return 1 fi + info "Download virtiofsd version: ${virtiofsd_version}" mkdir -p virtiofsd @@ -48,9 +53,11 @@ build_virtiofsd_from_source() { echo "build viriofsd from source" . /etc/profile.d/rust.sh - git clone --depth 1 --branch ${virtiofsd_version} ${virtiofsd_repo} virtiofsd + git clone --depth 1 --branch main ${virtiofsd_repo} virtiofsd pushd virtiofsd + git reset --hard ${virtiofsd_version} + export RUSTFLAGS='-C target-feature=+crt-static'${EXTRA_RUST_FLAGS} export LIBSECCOMP_LINK_TYPE=static export LIBSECCOMP_LIB_PATH=/usr/lib/${ARCH_LIBC} diff --git a/tools/packaging/static-build/virtiofsd/build.sh b/tools/packaging/static-build/virtiofsd/build.sh index d3a2565cda..6d52f7d408 100755 --- a/tools/packaging/static-build/virtiofsd/build.sh +++ b/tools/packaging/static-build/virtiofsd/build.sh @@ -31,7 +31,6 @@ package_output_dir="${package_output_dir:-}" [ -n "${virtiofsd_repo}" ] || die "Failed to get virtiofsd repo" [ -n "${virtiofsd_version}" ] || die "Failed to get virtiofsd version or commit" [ -n "${virtiofsd_toolchain}" ] || die "Failed to get the rust toolchain to build virtiofsd" -[ -n "${virtiofsd_zip}" ] || die "Failed to get virtiofsd binary URL" case ${ARCH} in "aarch64")