Skip to content

Commit fb4485f

Browse files
reinerhzeha
authored andcommitted
lib/mkmf.rb: sort list of object files in generated Makefile
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.
1 parent d06883d commit fb4485f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

debian/changelog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ ruby2.3 (2.3.1-2) UNRELEASED; urgency=medium
1414
(Closes: #822072)
1515
* Raise priority to "optional", now that ruby2.2 is gone, although
1616
the value of this change is unclear. (Closes: #822911)
17+
* Apply patch from Reiner Herrmann <[email protected]> to help with
18+
reproducibility of mkmf.rb using packages. (Closes: #825569)
1719

1820
-- Antonio Terceiro <[email protected]> Thu, 28 Apr 2016 09:33:58 -0300
1921

lib/mkmf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,7 @@ def create_makefile(target, srcprefix = nil)
22752275
LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
22762276
ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')}
22772277
SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')}
2278-
OBJS = #{$objs.join(" ")}
2278+
OBJS = #{$objs.sort.join(" ")}
22792279
HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')}
22802280
TARGET = #{target}
22812281
TARGET_NAME = #{target && target[/\A\w+/]}

0 commit comments

Comments
 (0)