Skip to content

Support byte for byte identical compression - #360

Closed
mattviasat wants to merge 2 commits into
megastep:masterfrom
mattviasat:master
Closed

mattviasat wants to merge 2 commits into
megastep:masterfrom
mattviasat:master

Conversation

@mattviasat

Copy link
Copy Markdown
Contributor

GZIP_CMD now passes --no-name to gzip, so it stops embedding a fresh timestamp in the compressed archive's header on every packaging run.

With this change, we will always see the same output if we receive the same input. This helps when diffing the output of makeself.

Identical input data should produce identical output date.
Comment thread test/datetest
startSkipping
# GNU tar supports --tar-extra's --mtime option used below.
# bsdtar (Mac/BSD) does not.
tar --version 2>/dev/null | grep -q GNU || startSkipping

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can enable this test when we are using GNU tar now.

Mac /opt/homebrew/bin/gtar

bash datetest -- testByteforbyte # /opt/homebrew/bin/gtar
testByteforbyte
Header is 772 lines long

About to compress 4 KB of data...
Adding files to archive named "src.sh"...
/opt/homebrew/bin/gtar: Option --mtime: Treating date '20160303' as 2016-03-03 00:00:00
./startup.sh
CRC: 1520247960
MD5: 21a99f115e4b3125a76fef4d4d203432

Self-extractable archive "src.sh" successfully created.
Header is 772 lines long

About to compress 4 KB of data...
Adding files to archive named "src.sh"...
/opt/homebrew/bin/gtar: Option --mtime: Treating date '20160303' as 2016-03-03 00:00:00
./startup.sh
CRC: 1520247960
MD5: 21a99f115e4b3125a76fef4d4d203432

Self-extractable archive "src.sh" successfully created.

Ran 1 test.

OK

It still does not work on bsdtar.

Mac /usr/bin/bsdtar

bash datetest -- testByteforbyte
testByteforbyte
Header is 772 lines long

About to compress 4 KB of data...
Adding files to archive named "src.sh"...
bsdtar: Option --mtime is not supported
Usage:
  List:    bsdtar -tf <archive-filename>
  Extract: bsdtar -xf <archive-filename>
  Create:  bsdtar -cf <archive-filename> [filenames...]
  Help:    bsdtar --help
ERROR: failed to create temporary archive: /var/folders/2x/mv56x8w15pb0lv1ql29c99lm0000gp/T//mkself69625.tar
mv: rename src.sh to first: No such file or directory
Header is 772 lines long

About to compress 4 KB of data...
Adding files to archive named "src.sh"...
bsdtar: Option --mtime is not supported
Usage:
  List:    bsdtar -tf <archive-filename>
  Extract: bsdtar -xf <archive-filename>
  Create:  bsdtar -cf <archive-filename> [filenames...]
  Help:    bsdtar --help
ERROR: failed to create temporary archive: /var/folders/2x/mv56x8w15pb0lv1ql29c99lm0000gp/T//mkself69649.tar
mv: rename src.sh to second: No such file or directory
cmp: first: No such file or directory
ASSERT:expected:<2> but was:<0>
shunit2:ERROR testByteforbyte() returned non-zero return code.

Ran 1 test.

FAILED (failures=1)

@mattviasat
mattviasat marked this pull request as ready for review August 27, 2026 18:15
@mattviasat
mattviasat deleted the branch megastep:master August 27, 2026 18:19
@mattviasat mattviasat closed this Aug 27, 2026
@mattviasat
mattviasat deleted the master branch August 27, 2026 18:19
@mattviasat

Copy link
Copy Markdown
Contributor Author

did a branch rename. See #361

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant