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

lib/mkmf.rb: sort list of object files in generated Makefile #1367

Closed
wants to merge 1 commit into from
Closed

lib/mkmf.rb: sort list of object files in generated Makefile #1367

wants to merge 1 commit into from

Conversation

reinerh
Copy link

@reinerh reinerh commented May 27, 2016

Without sorting the list explicitely, its order is indeterministic,
because readdir() is also not deterministic.
When the list of object files varies between builds, they are linked
in a different order, which results in an unreproducible build.

Without sorting the list explicitely, its order is indeterministic,
because readdir() is also not deterministic.
When the list of object files varies between builds, they are linked
in a different order, which results in an unreproducible build.
@reinerh
Copy link
Author

reinerh commented May 29, 2016

Can this fix please also be backported to the 2.3 branch?

@nobu
Copy link
Member

nobu commented Jun 3, 2016

What do you mean by "an unreproducible build"?

@hsbt hsbt closed this in 15dba48 Jun 3, 2016
@reinerh
Copy link
Author

reinerh commented Jun 3, 2016

@nobu I mean that the resulting binaries will not be bit-identical on different build runs, when the objects are not sorted.
See also https://reproducible-builds.org/ for more details.

This patch was already backported to Debian's ruby 2.3.
This change alone helped building about 40 additional packages reproducibly:
See the jump in the graph on 2016-05-30: https://tests.reproducible-builds.org/unstable/i386/stats_meta_pkg_state_maint_pkg-ruby-extras-maintainers.png

nobu added a commit to nobu/ruby that referenced this pull request Jun 4, 2016
* lib/mkmf.rb (create_makefile): sort lists of source and object
  files in generated Makefile, unless given by extconf.rb.
  [Fix rubyGH-1367]

Without sorting the list of object files explicitely, its order is
indeterministic, because readdir() is also not deterministic.
When the list of object files varies between builds, they are
linked in a different order, which results in an unreproducible
build.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rhenium pushed a commit to rhenium/ruby that referenced this pull request Jun 11, 2016
* lib/mkmf.rb (create_makefile): sort lists of source and object
  files in generated Makefile, unless given by extconf.rb.
  [Fix rubyGH-1367]

Without sorting the list of object files explicitely, its order is
indeterministic, because readdir() is also not deterministic.
When the list of object files varies between builds, they are
linked in a different order, which results in an unreproducible
build.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
mrkn pushed a commit to mrkn/ruby that referenced this pull request Jun 13, 2016
* lib/mkmf.rb (create_makefile): sort lists of source and object
  files in generated Makefile, unless given by extconf.rb.
  [Fix rubyGH-1367]

Without sorting the list of object files explicitely, its order is
indeterministic, because readdir() is also not deterministic.
When the list of object files varies between builds, they are
linked in a different order, which results in an unreproducible
build.

git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/trunk@55265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
tenderlove pushed a commit to tenderlove/ruby that referenced this pull request Jul 11, 2016
* lib/mkmf.rb (create_makefile): sort lists of source and object
  files in generated Makefile, unless given by extconf.rb.
  [Fix rubyGH-1367]

Without sorting the list of object files explicitely, its order is
indeterministic, because readdir() is also not deterministic.
When the list of object files varies between builds, they are
linked in a different order, which results in an unreproducible
build.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
BanzaiMan pushed a commit to BanzaiMan/ruby that referenced this pull request Jul 22, 2016
  this version includes ruby#1367 , ruby#1373 , ruby#1375
* test/rubygems: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
bmwiedemann pushed a commit to bmwiedemann/ruby that referenced this pull request Jun 3, 2017
* lib/mkmf.rb (create_makefile): sort lists of source and object
  files in generated Makefile, unless given by extconf.rb.
  [Fix rubyGH-1367]

Without sorting the list of object files explicitely, its order is
indeterministic, because readdir() is also not deterministic.
When the list of object files varies between builds, they are
linked in a different order, which results in an unreproducible
build.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Cherry-picked from trunk commit 15dba48
matzbot pushed a commit that referenced this pull request Jan 31, 2018
	* lib/mkmf.rb (create_makefile): sort lists of source and object
	  files in generated Makefile, unless given by extconf.rb.
	  [Fix GH-1367]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
zimbatm added a commit to zimbatm/ruby that referenced this pull request Oct 25, 2020
This is a continuation of 15dba48 /
rubyGH-1367.

Without sorting the list of headers explicitly, its order is
indeterministic, because readdir() is also not deterministic. When the
list of object files varies between builds, it generates a different
Makefile, which results in an unreproducible build.
zimbatm added a commit to zimbatm/ruby that referenced this pull request Nov 4, 2020
This is a continuation of 15dba48 /
rubyGH-1367.

Without sorting the list of headers explicitly, its order is
indeterministic, because readdir() is also not deterministic. When the
list of object files varies between builds, it generates a different
Makefile, which results in an unreproducible build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants