From 7d4a19c4401814d65be86fecb2d2cac437c7fc71 Mon Sep 17 00:00:00 2001 From: Guy Shimko Date: Wed, 15 Jan 2025 22:58:34 +0200 Subject: [PATCH 1/3] build: always download and extract tars This caused failures in our ci-cd. Always downloading & extracting the tars makes sure we will redownload them & extract if the previous download / extraction was faulty. --- src/compilation/download_packages.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/compilation/download_packages.sh b/src/compilation/download_packages.sh index 429250f..585878e 100755 --- a/src/compilation/download_packages.sh +++ b/src/compilation/download_packages.sh @@ -64,11 +64,6 @@ function download_package() { local url="$1" local output="$2" - if [[ -f "$output" ]]; then - >&2 echo "Skipping download: $output already exists" - return 0 - fi - wget "$url" -O "$output" if [[ $? -ne 0 ]]; then >&2 echo "Error: failed to download $url" @@ -98,11 +93,6 @@ function extract_package() { return 1 fi - if [[ -d "$output_dir" ]]; then - >&2 echo "Skipping extraction: $output_dir already exists" - return 0 - fi - pushd "$temp_dir" > /dev/null unpack_tarball "$tarball_realpath" From 0971bfc7684df556b2d156881082426276a65c59 Mon Sep 17 00:00:00 2001 From: Guy Shimko Date: Wed, 15 Jan 2025 23:09:50 +0200 Subject: [PATCH 2/3] build: delete package dir before redownloading it --- src/compilation/download_packages.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compilation/download_packages.sh b/src/compilation/download_packages.sh index 585878e..ff630cb 100755 --- a/src/compilation/download_packages.sh +++ b/src/compilation/download_packages.sh @@ -103,6 +103,10 @@ function extract_package() { popd > /dev/null + # Make sure output dir is empty, so we could move content into it. + # The directory might not exist, so we need to pass || true so that set -e won't fail us. + rm -rf "$output_dir" || true + mv "$temp_dir/$package_dir" "$output_dir" if [[ $? -ne 0 ]]; then return 1 From 45e3ba25cde0940d45943d3396c02294dd9d94ee Mon Sep 17 00:00:00 2001 From: Guy Shimko Date: Wed, 15 Jan 2025 23:20:47 +0200 Subject: [PATCH 3/3] build: Build `make build` and `make pack` sequentially Building multiple targets in parallel may cause docker race conditions. --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 12abc94..5791380 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,8 @@ BUILD_PACKAGES_DIR := "build/packages" .PHONY: clean help download_packages build build-docker-image $(ALL_TARGETS) $(ALL_PACK_TARGETS) +.NOTPARALLEL: build pack + help: @echo "Usage:" @echo " make build"