Skip to content

Commit

Permalink
Try to improve build on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ppkarwasz committed Oct 11, 2024
1 parent 1c85ca3 commit fa8f4a7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/package_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand Down
25 changes: 11 additions & 14 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:'
Expand All @@ -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
Expand Down

0 comments on commit fa8f4a7

Please sign in to comment.