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

ruby: improve reproducibility of gem builds #123732

Closed
wants to merge 1 commit into from

Conversation

baloo
Copy link
Member

@baloo baloo commented May 19, 2021

Motivation for this change

By default, the gem build will leave a path like:
lib/ruby/gems/2.7.0/gems/racc-1.5.2/ext/racc/cparse/.gem.20210503-6-csuqdb

putting the build date in the output hurts the build reproducibility
efforts

see #123718

This is the tmp directory here https://github.com/ruby/ruby/blob/adcbae8d49ec04d365ce13274783b1495c3c7d0e/lib/rubygems/ext/ext_conf_builder.rb#L15
https://github.com/ruby/ruby/blob/adcbae8d49ec04d365ce13274783b1495c3c7d0e/lib/tmpdir.rb#L140
that is not collected correctly.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.

@baloo baloo requested a review from marsam as a code owner May 19, 2021 21:21
@baloo baloo changed the title ruby: improve reproducibility of gem built ruby: improve reproducibility of gem build May 19, 2021
@baloo baloo force-pushed the baloo/rubygem/reproducible branch from 23feea1 to e5dfdd1 Compare May 19, 2021 21:26
@baloo baloo changed the title ruby: improve reproducibility of gem build ruby: improve reproducibility of gem builds May 19, 2021
@Mindavi
Copy link
Contributor

Mindavi commented May 19, 2021

Great, I did a checkout and nokogiri + racc are now reproducible! I just looked at that folder and it's indeed empty (at least for nokogiri), so no harm in deleting it.

LGTM, regex should indeed only match that folder.

By default, the gem build will leave a path like:
  lib/ruby/gems/2.7.0/gems/racc-1.5.2/ext/racc/cparse/.gem.20210503-6-csuqdb

putting the build date in the output hurts the build reproducibility
efforts

see NixOS#123718

Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
@baloo
Copy link
Member Author

baloo commented May 19, 2021

it's an upstream logic bug in rubygems.

@baloo baloo closed this May 19, 2021
@baloo
Copy link
Member Author

baloo commented May 20, 2021

closed in favor of #123748

@Mindavi
Copy link
Contributor

Mindavi commented May 20, 2021

Taking it upstream is indeed nicer :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants