From fa8f4a7787c0c35618cb8b214794efba2643a37e Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Fri, 11 Oct 2024 17:41:58 +0200 Subject: [PATCH] Try to improve build on MacOS --- .github/workflows/package_code.yml | 17 +++++++---------- package.sh | 25 +++++++++++-------------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/.github/workflows/package_code.yml b/.github/workflows/package_code.yml index 86984f25d..1c7416195 100644 --- a/.github/workflows/package_code.yml +++ b/.github/workflows/package_code.yml @@ -63,7 +63,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ macos-latest, ubuntu-latest, windows-latest ] + os: [ macos-latest, ubuntu-latest ] steps: - name: Checkout repository @@ -92,19 +92,16 @@ jobs: current=CMakeFiles/dist/apache-log4cxx-$VERSION reference=CMakeFiles/reference/apache-log4cxx-$VERSION for format in tar.gz zip; do - for hash in sha256 sha512; do - if ! cmp --silent "$reference.$format.$hash" "$current.$format.$hash"; then - echo Files apache-log4cxx-$VERSION.$format differ\! >& 2 - cat $reference.$format.$hash >& 2 - cat $current.$format.$hash >& 2 - exit 1 - fi - done + if ! cmp --silent "$reference.$format" "$current.$format"; then + echo Files apache-log4cxx-$VERSION.$format differ\! >& 2 + exit 1 + fi done - name: Upload reproducibility results uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # 4.4.3 - if: ${{ failure() && steps.check.conclusion == 'failure' }} + if: ${{ always() }} + #if: ${{ failure() && steps.check.conclusion == 'failure' }} with: name: apache-log4cxx-reproducibility-${{ matrix.os }} path: | diff --git a/package.sh b/package.sh index f6259f85b..e0cd37586 100755 --- a/package.sh +++ b/package.sh @@ -22,12 +22,8 @@ fi # build=CMakeFiles -# Directory containing the distribution archives -# -dist="$build/dist" - # Create source directory -mkdir -p "$dist" +mkdir -p "$build/dist" OUTPUT_DIR="$build/apache-log4cxx-$VERSION" if [ -f "$OUTPUT_DIR" ]; then if [ ! -d "$OUTPUT_DIR" ]; then @@ -58,7 +54,7 @@ rm -r "$OUTPUT_DIR"/src/main/abi-symbols # Create TAR file # # See https://reproducible-builds.org/docs/archives/ for reproducibility tips -TAR_ARCHIVE="$dist/apache-log4cxx-$VERSION.tar.gz" +TAR_ARCHIVE="$build/dist/apache-log4cxx-$VERSION.tar.gz" echo 'Tar version:' tar --version | sed -e 's/^/\t/' echo 'Gzip version:' @@ -68,20 +64,21 @@ if [ -f "$TAR_ARCHIVE" ]; then exit 1 fi -tar --transform="s!^$OUTPUT_DIR!apache-log4cxx-$VERSION!" \ - --mtime="$OUTPUT_TIMESTAMP" \ - --owner=0 --group=0 --numeric-owner \ - --sort=name \ - --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \ - --create --gzip --file "$TAR_ARCHIVE" "$OUTPUT_DIR" - +( + cd "$build" + tar --mtime="$OUTPUT_TIMESTAMP" \ + --owner=0 --group=0 --numeric-owner \ + --sort=name \ + --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \ + --create --gzip --file "dist/apache-log4cxx-$VERSION.tar.gz" "$OUTPUT_DIR" +) echo -e Tar archive: "$TAR_ARCHIVE" # Create ZIP file # # See https://reproducible-builds.org/docs/archives/ for reproducibility tips # Change the mtime of all files -ZIP_ARCHIVE="$dist/apache-log4cxx-$VERSION.zip" +ZIP_ARCHIVE="$build/dist/apache-log4cxx-$VERSION.zip" echo 'Zip version:' zip --version | sed 's/^/\t/' if [ -f "$ZIP_ARCHIVE" ]; then