Skip to content
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

autogen: fix build reproducibility issues #66552

Closed
wants to merge 1 commit into from

Conversation

delroth
Copy link
Contributor

@delroth delroth commented Aug 13, 2019

Motivation for this change

https://r13y.com/diff/2d1d9ebcbadce93e8dc711b4519442c992003b68ab1ad8445a425ea7dd7bf1e2-dd2c04513f0896c22e745c5368ff35cf0bdd607c121e9821958676305d59617a.html

Note: patch not sent upstream -- I see "GNU", I don't bother. I have no interest in signing the GNU CLA or figuring out the most likely convoluted process involved in submitting a 2 lines patch ¯\_(ツ)_/¯ @brkorb fyi

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @grahamc (let me know if you'd rather not be cc'd on these -- since you maintain r13y.com I assume you have an interest in these changes)

echo ! tar cvf ${tag}.${sfx} ${tag}
-tar cvf - ${tag} | $gz > ${top_builddir}/autoopts/${tag}.${sfx}
+tar --sort=name --mtime=0 cvf - ${tag} \
+ | $gz > ${top_builddir}/autoopts/${tag}.${sfx}
Copy link
Member

Choose a reason for hiding this comment

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

cc @andir

Copy link

@brkorb brkorb Nov 5, 2020

Choose a reason for hiding this comment

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

     rbopts=""
     if test ! -z "$SOURCE_DATE_EPOCH"
     then
         f=$(tar --help|grep -q sort=) # backticks are inconvenient here
         test ! -z "$f" && {
             rbopts="--sort=name --format=gnu --clamp-mtime"
             rbopts="$rbopts --mtime @$SOURCE_DATE_EPOCH"
         }
    fi

    tar cvf - $rbopts ${tag} | \
        $gz > ${top_builddir}/autoopts/${tag}.${sfx}

@brkorb
Copy link

brkorb commented Aug 13, 2019 via email

@FRidh FRidh added this to Needs review in Staging Dec 1, 2019
@bennofs
Copy link
Contributor

bennofs commented Feb 27, 2020

It may be a good idea to use a larger value for the timeout, to ensure builds are not failing due to the timeout even on slower platforms. Debian used 78: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=794892.

We can probably import the bash code from https://salsa.debian.org/debian/autogen/-/blob/master/pkg/libopts/mklibsrc.sh#L130-140 for the tar issue.

@brkorb
Copy link

brkorb commented Feb 27, 2020 via email

@stale
Copy link

stale bot commented Aug 25, 2020

Hello, I'm a bot and I thank you in the name of the community for your contributions.

Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do:

If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list.

If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past.

If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments.

Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 25, 2020
@delroth
Copy link
Contributor Author

delroth commented Aug 27, 2020

Still relevant according to r13y.com. Right now the only comments on this PR I don't really see as blockers (the timeout issue is theoretical, and the tar vs. GNU tar problem doesn't apply in the Nix build environment).

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 27, 2020
@r-burns
Copy link
Contributor

r-burns commented Oct 31, 2020

I think it would be great to fix this reproducibility issue. Am I correct that the tar issue was fixed in autogen 5.18.14 so that patch is no longer needed?
https://salsa.debian.org/debian/autogen/-/commit/e430285604ad57ab7fcde89369727864c7ff6355#4481a1b92971c5a17cc30bdc3c5c120f22a2e8f5
If so, then I think the timeout configure flag alone will make this reproducible!

@ajs124 ajs124 mentioned this pull request Nov 1, 2020
10 tasks
@andir
Copy link
Member

andir commented Nov 1, 2020

Wow. i totally forgot about this PR exiting and already having dived into this. @zimbatm, @aszlig and I had some time looking at that today and came up with #102280 but never thought someone else might have done the work already. Sorry @delroth! I think we can close this now event thought you really deserve some credit for the work here.

@andir andir closed this Nov 1, 2020
Staging automation moved this from Needs review to Done Nov 1, 2020
@zimbatm
Copy link
Member

zimbatm commented Nov 1, 2020

Is the libopts patch still needed? We only have seen the first issue in practice but it doesn't mean that the second one isn't valid.

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

Successfully merging this pull request may close these issues.

None yet

7 participants