Skip to content

Commit

Permalink
mkrelease: explicitly use gzip for tarball generation
Browse files Browse the repository at this point in the history
Since git v2.38.0 git archive tar.gz format default has changed from
invoking gzip to an internal gzip compressor implementation. However,
the output bitstream is not identical, meaning the resulting tar.gz
archive's checksum is different. This causes problems for PGP signing.

In order to avoid this issue for both old and new archive generation
alike manually invoke gzip in mkrelease script, bypassing git archive's
internal compression logic completely regardless of version.

GitHub and others presumably use a similar method to deal with this
change to keep old tag archive checksums from changing.

* git/git@4f4be00
* https://github.blog/changelog/2023-01-30-git-archive-checksums-may-change/
* https://github.com/orgs/community/discussions/45830
* bazel-contrib/SIG-rules-authors#11
  • Loading branch information
vermeeren committed Mar 31, 2023
1 parent bf020a8 commit 68e9dc4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mkrelease
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ pack()
mkdir -- mkrelease_tmp

git archive \
--format=tar.gz \
--format=tar \
--prefix="breathe-$version/" \
-o "mkrelease_tmp/breathe-$version.tar.gz" \
-- "v$version" \
| gzip -cn \
>"mkrelease_tmp/breathe-$version.tar.gz"

cd -- mkrelease_tmp
tar -xf "breathe-$version.tar.gz"
Expand Down

0 comments on commit 68e9dc4

Please sign in to comment.