New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gnutar: make reproducible by default #107251
base: staging
Are you sure you want to change the base?
Conversation
8447be5
to
1484f1e
Compare
I marked this as stale due to inactivity. → More info |
Still relevant. |
I marked this as stale due to inactivity. → More info |
@prusnak you marked this as 'Draft' in december 2020 - why? Is there anything you'd like to do before we start reviewing this? Would you like help? |
1484f1e
to
24fdc30
Compare
@raboof No. I just wanted to gather more feedback before someone accidentally merges this. Since there was no feedback, I am marking this as ready. |
b43561d
to
a3ad038
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with nix-shell -p gnutar
that the expected environment variable is set and behaves as expected:
$ tar -c -f foo.tar foo.txt
$ tar -v --list -f ./foo.tar
tar: Option --mtime: Treating date '@315532800' as 1980-01-01 01:00:00
-rw-r--r-- 0/0 0 1980-01-01 01:00 foo.txt
That 01:00 was suspicious to me: 315532800 is 1:00am in my timezone, so this is correct only assuming tar takes into account the current timezone when listing (not creating) the archive. I checked, and this is luckily the case: I switched timezones and the printed timestamp 'changed along' with it. So all good AFAICS 👍
I think the issue with this that was mentioned by @FRidh, is that we still do not have |
@prusnak Any feedback on this? |
$ tar --mtime="1" --owner=0 --group=0 --numeric-owner --sort=name xf
tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
Try 'tar --help' or 'tar --usage' for more information.
$ tar xf --mtime="1" --owner=0 --group=0 --numeric-owner --sort=name
tar: --mtime=1: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
$ tar xf blah --mtime="1" --owner=0 --group=0 --numeric-owner --sort=name
tar: blah: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
$ tar --mtime="1" --owner=0 --group=0 --numeric-owner --sort=name xf blah
tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
Try 'tar --help' or 'tar --usage' for more information. tar seems to be very picky about it's arguments Switched it to use if |
12ea7ea
to
8f31dc5
Compare
err from nix tests
adding the reproducible flags and updating the |
Tested and confirmed to work if PR in nix is merged, see NixOS/nix#9225 (review) |
@GrahamcOfBorg eval |
@drupol can I let you adopt this PR? |
No comments, LGTM 👍 |
@RaitoBezarius I wish I could help on this, but I really don't know how to fix the remaining issues. |
@prusnak could I bother you with a rebase for this PR? I will try to see it to the finish line. |
8f31dc5
to
e1edc81
Compare
Done. Rebased on top of current staging. |
95ae68a
to
b4a89d0
Compare
I pushed an extra commit to refactor the file and switch to |
08a0de7
to
b5cf705
Compare
b5cf705
to
1a574f9
Compare
No, you don't understand. I took your changes and restructured them. Basically I took some of your cosmetic changes you did to my first commit and moved them to your second commit. |
Yep, sorry I've been too hasty for replying :) |
I'm trying to fix the issue locally. The issue is with When using
For some reason, there's an issue with the |
I made further investigations. Currently, in this PR, there's an issue when doing the following:
When replacing
(The decompressing part is done in https://github.com/NixOS/nixpkgs/blame/b5cf705fc77b75f762ce1cb3c5391e5f373e34fa/pkgs/stdenv/generic/setup.sh#L1051) |
Motivation for this change
Fixes #106643
tar
flags whenGNUTAR_REPRODUCIBLE
is set:GNUTAR_REPRODUCIBLE =1
ingenericBuild()
ofpkgs/stdenv/generic/setup.sh
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)