This is an automated email from the ASF dual-hosted git repository. jdaugherty pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 3a85d8492ec22e01b0ceb0bf384d4ba5baf3bc08 Author: James Daugherty <[email protected]> AuthorDate: Fri May 30 16:59:05 2025 -0400 [skip ci] initial reproducibility rework --- etc/bin/verify-reproducible.sh | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/etc/bin/verify-reproducible.sh b/etc/bin/verify-reproducible.sh index 23855cd9bd..1aafb1ef5f 100755 --- a/etc/bin/verify-reproducible.sh +++ b/etc/bin/verify-reproducible.sh @@ -21,47 +21,50 @@ set -e export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) -CWD=$(pwd) +DOWNLOAD_LOCATION="${3:-downloads}" +DOWNLOAD_LOCATION=$(realpath "${DOWNLOAD_LOCATION}") SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -cd "${SCRIPT_DIR}/../.." -mkdir -p "${SCRIPT_DIR}/results" -if [[ -f "${SCRIPT_DIR}/results/PUBLISHED" ]]; then - echo "✓ File 'PUBLISHED' exists." +CWD=$(pwd) + +cd "${DOWNLOAD_LOCATION}" + +mkdir -p "${DOWNLOAD_LOCATION}/results" +if [[ -f "${DOWNLOAD_LOCATION}/results/PUBLISHED_ARTIFACTS" ]]; then + echo "✅ File 'PUBLISHED_ARTIFACTS' exists." else - echo "✗ File 'PUBLISHED' not found. Please place the PUBLISHED distribution file under ${SCRIPT_DIR}/results/PUBLISHED..." + echo "❌ File 'PUBLISHED_ARTIFACTS' not found. Please place the PUBLISHED_ARTIFACTS distribution file under ${DOWNLOAD_LOCATION}/results/PUBLISHED_ARTIFACTS..." exit 1 fi -if [[ -d "${SCRIPT_DIR}/results/published_artifacts" ]]; then - echo "✓ Directory 'published_artifacts' exists." +if [[ -d "${DOWNLOAD_LOCATION}/results/published" ]]; then + echo "✅ Directory 'published' exists." else - echo "✗ Directory 'published_artifacts' not found. Please place the PUBLISHED jar files under ${SCRIPT_DIR}/results/published_artifacts..." + echo "❌ Directory 'published' not found. Please place the PUBLISHED jar files under ${DOWNLOAD_LOCATION}/results/published..." exit 1 fi -git clean -xdf --exclude='etc/bin' --exclude='.idea' --exclude='.gradle' killall -e java || true cd grails-gradle ./gradlew build --rerun-tasks -PskipTests --no-build-cache cd .. ./gradlew build --rerun-tasks -PskipTests --no-build-cache -"${SCRIPT_DIR}/generate-build-artifact-hashes.groovy" > "${SCRIPT_DIR}/results/second.txt" -mkdir -p "${SCRIPT_DIR}/results/second" -find . -path ./etc -prune -o -type f -path '*/build/libs/*.jar' -exec cp -t "${SCRIPT_DIR}/results/second/" -- {} + +"${SCRIPT_DIR}/generate-build-artifact-hashes.groovy" > "${DOWNLOAD_LOCATION}/results/second.txt" +mkdir -p "${DOWNLOAD_LOCATION}/results/second" +find . -path ./etc -prune -o -type f -path '*/build/libs/*.jar' -exec cp -t "${DOWNLOAD_LOCATION}/results/second/" -- {} + -cd "${SCRIPT_DIR}/results" +cd "${DOWNLOAD_LOCATION}/results" -# diff -u PUBLISHED second.txt -DIFF_RESULTS=$(comm -3 PUBLISHED second.txt | cut -d' ' -f1 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | uniq | sort) +# diff -u PUBLISHED_ARTIFACTS second.txt +DIFF_RESULTS=$(comm -3 <(cut -d' ' -f1 PUBLISHED_ARTIFACTS | sort) <(sort second.txt) | cut -d' ' -f1 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | uniq | sort) echo "Differing artifacts:" echo "$DIFF_RESULTS" > diff.txt cat diff.txt printf '%s\n' "$DIFF_RESULTS" | sed 's|^etc/bin/results/||' > toPurge.txt -find published_artifacts -type f -name '*.jar' -print | sed 's|^published_artifacts/||' | grep -F -x -v -f toPurge.txt | +find published -type f -name '*.jar' -print | sed 's|^published/||' | grep -F -x -v -f toPurge.txt | while IFS= read -r f; do - rm -f "./published_artifacts/$f" + rm -f "./published/$f" done find second -type f -name '*.jar' -print | sed 's|^second/||' | grep -F -x -v -f toPurge.txt | while IFS= read -r f; do
