Sorting files in metadata for build reproducibility#8569
Sorting files in metadata for build reproducibility#8569duckinator merged 2 commits intoruby:masterfrom
Conversation
|
Thanks for opening a pull request and helping make RubyGems and Bundler better! Someone from the RubyGems team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality. We use GitHub Actions to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of GitHub Actions in the PR status window below. If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #rubygems or #bundler channel on Slack. For more information about contributing to the RubyGems project feel free to review our CONTRIBUTING guide |
|
This PR seems fine to me. The failing CI highlights in my opinion, a deficiency in |
|
I created #8573 to fix this |
|
Thank you @deivid-rodriguez! |
7fc881e to
7921179
Compare
|
I made #8587 so This looks good aside from that! |
|
Thank you for the help with this, @giacomobenedetti! |
Sorting files in metadata for reproducibility (cherry picked from commit 84d0dea)
Sorting files in metadata for reproducibility (cherry picked from commit 84d0dea)
|
Apologies for being very late to the party, but I discovered today that this change is breaking for gems that build multiple native extensions where at least one of them isn't rake-based. Sorting extensions here means that gem authors cannot control the order that extensions are listed in the serialized gem spec, which in turn influences what order native extensions are built. I wouldn't have thought it mattered, but once a gem extension has been built with rake, no other extensions are built. See this line in builder.rb, which has been in place for over a decade. This is more than a hypothetical - the Google Protobuf gem I work on does exactly this - we have an extconf-based extension for the core implementation, and a rakefile-based extension that we use with If I run If I run What I don't know is the best way to fix this. I don't know why |
|
@JasonLunn Would you be able to move this into a new issue with some steps to reproduce, so that we can track it and help debug? |
Note: Building the protobuf gem with versions of rubygems that include ruby/rubygems#8569 is broken due to the issue reported in ruby/rubygems#9244. Workaround is to use a rubygems version below 3.7.0 to build the gem. Closes #25051 COPYBARA_INTEGRATE_REVIEW=#25051 from frederikspang:main 83f91c7 FUTURE_COPYBARA_INTEGRATE_REVIEW=#25051 from frederikspang:main 83f91c7 PiperOrigin-RevId: 853462400
Note: Building the protobuf gem with versions of rubygems that include ruby/rubygems#8569 is broken due to the issue reported in ruby/rubygems#9244. Workaround is to use a rubygems version below 3.7.0 to build the gem. Closes #25051 COPYBARA_INTEGRATE_REVIEW=#25051 from frederikspang:main 83f91c7 FUTURE_COPYBARA_INTEGRATE_REVIEW=#25051 from frederikspang:main 83f91c7 PiperOrigin-RevId: 853462400
Note: Building the protobuf gem with versions of rubygems that include ruby/rubygems#8569 is broken due to the issue reported in ruby/rubygems#9244. Workaround is to use a rubygems version below 3.7.0 to build the gem. Closes #25051 COPYBARA_INTEGRATE_REVIEW=#25051 from frederikspang:main 83f91c7 PiperOrigin-RevId: 858713403
What was the end-user or developer problem that led to this PR?
Files sorting is system-dependent making a build not reproducible. This behavior can be seen using
reprotestto manipulate the file ordering during a build.What is your fix for the problem, implemented in this PR?
Adding a
sortwhile reading files listed in metadata fixes this issue.Make sure the following tasks are checked