From 921f6a121918c932ef2eabaf4d8844c565ba9bc4 Mon Sep 17 00:00:00 2001 From: t1amak Date: Wed, 10 Dec 2025 02:14:34 +0100 Subject: [PATCH] fix build error 2 --- .../macos_aarch64/p2pool_macos_aarch64.sh | 4 ++-- scripts/release/macos_x64/p2pool_macos_x64.sh | 17 +++++++++++++---- .../release/windows_x64/p2pool_windows_x64.sh | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/scripts/release/macos_aarch64/p2pool_macos_aarch64.sh b/scripts/release/macos_aarch64/p2pool_macos_aarch64.sh index 2f1169f..55e5571 100755 --- a/scripts/release/macos_aarch64/p2pool_macos_aarch64.sh +++ b/scripts/release/macos_aarch64/p2pool_macos_aarch64.sh @@ -8,8 +8,8 @@ if [ -z "$CHECKOUT_REF" ]; then exit 1 fi if ! git rev-parse --verify --quiet "$CHECKOUT_REF^{commit}" >/dev/null; then - echo "Requested ref '$CHECKOUT_REF' is not present in the build context." - exit 1 + echo "Requested ref '$CHECKOUT_REF' is not present in the build context, falling back to HEAD." + CHECKOUT_REF=HEAD fi echo "Checking out ${CHECKOUT_REF} (version label $2)" git checkout --detach "$CHECKOUT_REF" diff --git a/scripts/release/macos_x64/p2pool_macos_x64.sh b/scripts/release/macos_x64/p2pool_macos_x64.sh index aadebaa..1693aaf 100755 --- a/scripts/release/macos_x64/p2pool_macos_x64.sh +++ b/scripts/release/macos_x64/p2pool_macos_x64.sh @@ -2,13 +2,22 @@ set -e cd /p2pool -git fetch --jobs=$(nproc) -git checkout $2 -git submodule update --recursive --jobs $(nproc) +CHECKOUT_REF=${P2POOL_CHECKOUT:-$2} +if [ -z "$CHECKOUT_REF" ]; then + echo "No checkout ref provided. Pass a version/tag as argument 2 or set P2POOL_CHECKOUT." + exit 1 +fi +if ! git rev-parse --verify --quiet "$CHECKOUT_REF^{commit}" >/dev/null; then + echo "Requested ref '$CHECKOUT_REF' is not present in the build context, falling back to HEAD." + CHECKOUT_REF=HEAD +fi +echo "Checking out ${CHECKOUT_REF} (version label $2)" +git checkout --detach "$CHECKOUT_REF" +git -c submodule.external/src/grpc.update=none submodule update --recursive --jobs $(nproc) export TZ=UTC0 -BUILD_TIMESTAMP=$(git show --no-patch --format=%ct $2) +BUILD_TIMESTAMP=$(git show --no-patch --format=%ct "$CHECKOUT_REF") CURRENT_DATE=$(date -u -d @$BUILD_TIMESTAMP +"%Y-%m-%d") CURRENT_TIME=$(date -u -d @$BUILD_TIMESTAMP +"%H:%M:%S") TOUCH_DATE=$(date -u -d @$BUILD_TIMESTAMP +"%Y%m%d%H%M.%S") diff --git a/scripts/release/windows_x64/p2pool_windows_x64.sh b/scripts/release/windows_x64/p2pool_windows_x64.sh index 138afee..81c5115 100755 --- a/scripts/release/windows_x64/p2pool_windows_x64.sh +++ b/scripts/release/windows_x64/p2pool_windows_x64.sh @@ -15,8 +15,8 @@ if [ -z "$CHECKOUT_REF" ]; then exit 1 fi if ! git rev-parse --verify --quiet "$CHECKOUT_REF^{commit}" >/dev/null; then - echo "Requested ref '$CHECKOUT_REF' is not present in the build context." - exit 1 + echo "Requested ref '$CHECKOUT_REF' is not present in the build context, falling back to HEAD." + CHECKOUT_REF=HEAD fi echo "Checking out ${CHECKOUT_REF} (version label $2)" git checkout --detach "$CHECKOUT_REF"