ruby: fix the reproducibility issue
PATCH 1/1 ruby: fix the reproducibility issue
Apply some changes on the Ruby makefiles in order to fix the reproducibility:
- use a fixed timestamp,
- sort linked objects,
- doesn't use the current date,
- and use UTC date.
[YOCTO #14268]
--- ...doc-build-reproducible-documentation.patch | 35 ++++++++++ ...-list-of-object-files-in-generated-M.patch | 28 ++++++++ ...eproducible-change-fixing-784225-too.patch | 28 ++++++++ .../0006-Make-gemspecs-reproducible.patch | 67 +++++++++++++++++++ meta/recipes-devtools/ruby/ruby_3.0.2.bb | 4 ++ 5 files changed, 162 insertions(+) create mode 100644 meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch create mode 100644 meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch create mode 100644 meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch create mode 100644 meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch
meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch new file +35 -0
@@ -0,0 +1,35 @@ +From: Christian Hofstaedtler <[email protected]> +Date: Tue, 10 Oct 2017 15:04:34 -0300 +Subject: rdoc: build reproducible documentation + +- provide a fixed timestamp to the gzip compression + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Christian Hofstaedtler <[email protected]> +--- + lib/rdoc/generator/json_index.rb | 4 ++-- + lib/rdoc/rdoc.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/lib/rdoc/generator/json_index.rb ++++ b/lib/rdoc/generator/json_index.rb +@@ -178,7 +178,7 @@ + debug_msg "Writing gzipped search index to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(search_index_file) ++ gz.mtime = -1 + gz.orig_name = search_index_file.basename.to_s + gz.write search_index + gz.close +@@ -196,7 +196,7 @@ + debug_msg "Writing gzipped file to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(dest) ++ gz.mtime = -1 + gz.orig_name = dest.basename.to_s + gz.write data + gz.close
meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch new file +28 -0
@@ -0,0 +1,28 @@ +From: Reiner Herrmann <[email protected]> +Date: Tue, 10 Oct 2017 15:06:13 -0300 +Subject: lib/mkmf.rb: sort list of object files in generated Makefile + +Without sorting the list explicitly, 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. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Reiner Herrmann <[email protected]> +--- + lib/mkmf.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/mkmf.rb ++++ b/lib/mkmf.rb +@@ -2315,7 +2315,7 @@ + LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS} + ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')} + SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')} +-OBJS = #{$objs.join(" ")} ++OBJS = #{$objs.sort.join(" ")} + HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')} + LOCAL_HDRS = #{$headers.join(' ')} + TARGET = #{target}
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch new file +28 -0
@@ -0,0 +1,28 @@ +From: Christian Hofstaedtler <[email protected]> +Date: Tue, 10 Oct 2017 15:07:11 -0300 +Subject: Mark Gemspec-reproducible change fixing #784225, too + +I think the UTC date change will fix the Multi-Arch not-same file issue, +too. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Christian Hofstaedtler <[email protected]> +--- + lib/rubygems/specification.rb | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/lib/rubygems/specification.rb ++++ b/lib/rubygems/specification.rb +@@ -1695,7 +1695,9 @@ + raise(Gem::InvalidSpecificationException, + "invalid date format in specification: #{date.inspect}") + end +- when Time, DateLike then ++ when Time then ++ Time.utc(date.utc.year, date.utc.month, date.utc.day) ++ when DateLike then + Time.utc(date.year, date.month, date.day) + else + TODAY
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +67 -0
67 lines not on this page · raw message
meta/recipes-devtools/ruby/ruby_3.0.2.bb +4 -0
@@ -7,6 +7,10 @@ SRC_URI += " \ file://run-ptest \ file://0001-template-Makefile.in-do-not-write-host-cross-cc-item.patch \ file://0002-template-Makefile.in-filter-out-f-prefix-map.patch \ + file://0003-rdoc-build-reproducible-documentation.patch \ + file://0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch \ + file://0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch \ + file://0006-Make-gemspecs-reproducible.patch \ " SRC_URI[sha256sum] = "5085dee0ad9f06996a8acec7ebea4a8735e6fac22f22e2d98c3f2bc3bef7e6f1"
Signature · 1 line
2.31.1
Does this mean ruby can be dropped from reproducibility exception list?
Alex
Quoted 259 lines · Thomas Perrot
Apply some changes on the Ruby makefiles in order to fix the reproducibility:
- use a fixed timestamp,
- sort linked objects,
- doesn't use the current date,
- and use UTC date.[YOCTO #14268]
Signed-off-by Thomas Perrot <[email protected]>--- ...doc-build-reproducible-documentation.patch | 35 ++++++++++ ...-list-of-object-files-in-generated-M.patch | 28 ++++++++ ...eproducible-change-fixing-784225-too.patch | 28 ++++++++ .../0006-Make-gemspecs-reproducible.patch | 67 +++++++++++++++++++ meta/recipes-devtools/ruby/ruby_3.0.2.bb | 4 ++ 5 files changed, 162 insertions(+) create mode 100644 meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch create mode 100644 meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch create mode 100644 meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch create mode 100644
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchdiff --git
a/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchb/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchnew file mode 100644
index 000000000000..f92f0e1ba683
---/dev/null
+++b/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchmeta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch new file +35
-0@@ -0,0 +1,35 @@ +From: Christian Hofstaedtler <[email protected]> +Date: Tue, 10 Oct 2017 15:04:34 -0300 +Subject: rdoc: build reproducible documentation + +- provide a fixed timestamp to the gzip compression + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Christian Hofstaedtler <[email protected]> +--- + lib/rdoc/generator/json_index.rb | 4 ++-- + lib/rdoc/rdoc.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/lib/rdoc/generator/json_index.rb ++++ b/lib/rdoc/generator/json_index.rb +@@ -178,7 +178,7 @@ + debug_msg "Writing gzipped search index to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(search_index_file) ++ gz.mtime = -1 + gz.orig_name = search_index_file.basename.to_s + gz.write search_index + gz.close +@@ -196,7 +196,7 @@ + debug_msg "Writing gzipped file to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(dest) ++ gz.mtime = -1 + gz.orig_name = dest.basename.to_s + gz.write data + gz.closediff --git
a/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchb/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchnew file mode 100644
index 000000000000..e0aca0dcfc10
---/dev/null
+++b/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchmeta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch new file +23
-0@@ -0,0 +1,28 @@ +From: Reiner Herrmann <[email protected]> +Date: Tue, 10 Oct 2017 15:06:13 -0300 +Subject: lib/mkmf.rb: sort list of object files in generated Makefile + +Without sorting the list explicitly, 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. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Reiner Herrmann <[email protected]> +--- + lib/mkmf.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/mkmf.rb ++++ b/lib/mkmf.rb +@@ -2315,7 +2315,7 @@ + LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS} + ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')} + SRCS = $(ORIG_SRCS) #{(srcs -orig_srcs).collect(&File.method(:basename)).join(' ')}
+-OBJS = #{$objs.join(" ")}
++OBJS = #{$objs.sort.join(" ")}
+ HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')}
+LOCAL_HDRS= #{$headers.join(' ')}
+ TARGET = #{target}
diff --gita/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchb/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchnew file mode 100644
index 000000000000..b7faa58655b2
---/dev/null
+++b/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchmeta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch new file +20
-0@@ -0,0 +1,28 @@ +From: Christian Hofstaedtler <[email protected]> +Date: Tue, 10 Oct 2017 15:07:11 -0300 +Subject: Mark Gemspec-reproducible change fixing #784225, too + +I think the UTC date change will fix the Multi-Arch not-same file issue, +too. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Christian Hofstaedtler <[email protected]> +--- + lib/rubygems/specification.rb | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/lib/rubygems/specification.rb ++++ b/lib/rubygems/specification.rb +@@ -1695,7 +1695,9 @@ + raise(Gem::InvalidSpecificationException, + "invalid date format in specification:#{date.inspect}")
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch new file +8
-0+ end +- when Time, DateLike then ++ when Time then ++ Time.utc(date.utc.year, date.utc.month, date.utc.day) ++ when DateLike then + Time.utc(date.year, date.month, date.day) + else + TODAYdiff --git
a/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchb/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchnew file mode 100644
index 000000000000..504893b4b4ffmeta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +27
-0@@ -0,0 +1,67 @@ +From: Lucas Kanashiro <[email protected]> +Date: Fri, 1 Nov 2019 15:25:17 -0300 +Subject: Make gemspecs reproducible + +Without an explicit date, they will get the current date and make the +build unreproducible + +Upstream-Status: Backport [debian] + +--- + ext/bigdecimal/bigdecimal.gemspec | 1 + + ext/fiddle/fiddle.gemspec | 1 + + ext/io/console/io-console.gemspec | 2 +- + lib/ipaddr.gemspec | 1 + + lib/rdoc/rdoc.gemspec | 1 + + 5 files changed, 5 insertions(+), 1 deletion(-) + +--- a/ext/bigdecimal/bigdecimal.gemspec ++++ b/ext/bigdecimal/bigdecimal.gemspec +@@ -6,6 +6,7 @@ + s.name = "bigdecimal" + s.version = bigdecimal_version + s.authors = ["Kenta Murata", "Zachary Scott", "Shigeo Kobayashi"] ++ s.date = RUBY_RELEASE_DATE + s.email = ["[email protected]"] + + s.summary = "Arbitrary-precision decimal floating-point numberlibrary."
+--- a/ext/fiddle/fiddle.gemspec
++++ b/ext/fiddle/fiddle.gemspec
+@@ -8,6 +8,7 @@
+Gem::Specification.newdo |spec|meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +5
-0+ spec.name = "fiddle" + spec.version = version_module::Fiddle::VERSION ++ spec.date = RUBY_RELEASE_DATE + spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"] + spec.email = ["[email protected]", "meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +31
-0+ +--- a/ext/io/console/io-console.gemspec ++++ b/ext/io/console/io-console.gemspec +@@ -4,6 +4,7 @@ + Gem::Specification.new do |s| + s.name = "io-console" + s.version = _VERSION ++ s.date = RUBY_RELEASE_DATE + s.summary = "Console interface" + s.email = "[email protected]" + s.description = "add console capabilities to IO instances." +--- a/lib/ipaddr.gemspec ++++ b/lib/ipaddr.gemspec +@@ -6,6 +6,7 @@ + Gem::Specification.new do |spec| + spec.name = "ipaddr" + spec.version = "1.2.2" ++ spec.date = RUBY_RELEASE_DATE + spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"] + spec.email = ["[email protected]", "[email protected]"] + +--- a/lib/rdoc/rdoc.gemspec ++++ b/lib/rdoc/rdoc.gemspec +@@ -7,6 +7,7 @@ + + Gem::Specification.new do |s| + s.name = "rdoc" ++ s.date = RUBY_RELEASE_DATE + s.version = RDoc::VERSION + + s.authors = [meta/recipes-devtools/ruby/ruby_3.0.2.bb +4
-0@@ -7,6 +7,10 @@ SRC_URI += " \ file://run-ptest \ file://0001-template-Makefile.in-do-not-write-host-cross-cc-item.patch \ file://0002-template-Makefile.in-filter-out-f-prefix-map.patch \ + file://0003-rdoc-build-reproducible-documentation.patch \ + file://0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch \ + file://0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch \ + file://0006-Make-gemspecs-reproducible.patch \ " SRC_URI[sha256sum] ="
5085dee0ad9f06996a8acec7ebea4a8735e6fac22f22e2d98c3f2bc3bef7e6f1" --
2.31.1-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#156493):
https://lists.openembedded.org/g/openembedded-core/message/156493
Mute This Topic: https://lists.openembedded.org/mt/85974381/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Hello,
Quoted 3 lines · Alexander Kanavin
Does this mean ruby can be dropped from reproducibility exception list?
I think so, but it would be nice to run some additional build tests on autobuilder before, because it's not often obvious to reproduce this kind of issue locally.
Best regards,
Thomas
Quoted 278 lines
Alex
Quoted 274 lines · Thomas Perrot
Apply some changes on the Ruby makefiles in order to fix the reproducibility:
- use a fixed timestamp,
- sort linked objects,
- doesn't use the current date,
- and use UTC date.[YOCTO #14268]
Signed-off-by Thomas Perrot <[email protected]>---
...doc-build-reproducible-documentation.patch | 35 ++++++++++ ...-list-of-object-files-in-generated-M.patch | 28 ++++++++ ...eproducible-change-fixing-784225-too.patch | 28 ++++++++ .../0006-Make-gemspecs-reproducible.patch | 67 +++++++++++++++++++ meta/recipes-devtools/ruby/ruby_3.0.2.bb | 4 ++ 5 files changed, 162 insertions(+)create mode 100644 meta/recipes-devtools/ruby/ruby/0003-rdoc- build-
reproducible-documentation.patch
create mode 100644 meta/recipes-devtools/ruby/ruby/0004-lib- mkmf.rb- sort-list-of-object-files-in-generated-M.patch create mode 100644 meta/recipes-devtools/ruby/ruby/0005-Mark- Gemspec-reproducible-change-fixing-784225-too.patch create mode 100644 meta/recipes-devtools/ruby/ruby/0006-Make- gemspecs-reproducible.patch(quoted diff) +0
-0reproducible-documentation.patch b/meta/recipes-
devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchnew file mode 100644
index 000000000000..f92f0e1ba683meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible- new file +0
-0documentation.patch
meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible- new file +35
-0@@ -0,0 +1,35 @@ +From: Christian Hofstaedtler <[email protected]> +Date: Tue, 10 Oct 2017 15:04:34 -0300 +Subject: rdoc: build reproducible documentation + +- provide a fixed timestamp to the gzip compression + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Christian Hofstaedtler <[email protected]> +--- + lib/rdoc/generator/json_index.rb | 4 ++-- + lib/rdoc/rdoc.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/lib/rdoc/generator/json_index.rb ++++ b/lib/rdoc/generator/json_index.rb +@@ -178,7 +178,7 @@ + debug_msg "Writing gzipped search index to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(search_index_file) ++ gz.mtime = -1 + gz.orig_name = search_index_file.basename.to_s + gz.write search_index + gz.close +@@ -196,7 +196,7 @@ + debug_msg "Writing gzipped file to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(dest) ++ gz.mtime = -1 + gz.orig_name = dest.basename.to_s + gz.write data + gz.close(quoted diff) +0
-0list-of-object-files-in-generated-M.patch b/meta/recipes- devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in- generated-M.patch
new file mode 100644
index 000000000000..e0aca0dcfc10meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list- new file +0
-0of-
object-files-in-generated-M.patchmeta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list- new file +3
-0@@ -0,0 +1,28 @@ +From: Reiner Herrmann <[email protected]> +Date: Tue, 10 Oct 2017 15:06:13 -0300 +Subject: lib/mkmf.rb: sort list of object files in generated
Makefilemeta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list- new file +4
-0+ +Without sorting the list explicitly, its order is indeterministic, +because readdir() is also not deterministic. +When the list of object files varies between builds, they arelinked
meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list- new file +15
-0+in a different order, which results in an unreproducible build. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Reiner Herrmann <[email protected]> +--- + lib/mkmf.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/mkmf.rb ++++ b/lib/mkmf.rb +@@ -2315,7 +2315,7 @@ + LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS} + ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join('')}
+ SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')} +-OBJS = #{$objs.join(" ")}
++OBJS = #{$objs.sort.join(" ")}
+ HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')}
+LOCAL_HDRS= #{$headers.join(' ')}
+ TARGET = #{target}(quoted diff) +0
-0reproducible-change-fixing-784225-too.patch b/meta/recipes- devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing- 784225-too.patch
new file mode 100644
index 000000000000..b7faa58655b2meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec- new file +0
-0reproducible-
change-fixing-784225-too.patchmeta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec- new file +5
-0@@ -0,0 +1,28 @@ +From: Christian Hofstaedtler <[email protected]> +Date: Tue, 10 Oct 2017 15:07:11 -0300 +Subject: Mark Gemspec-reproducible change fixing #784225, too + +I think the UTC date change will fix the Multi-Arch not-same fileissue,
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec- new file +15
-0+too. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Christian Hofstaedtler <[email protected]> +--- + lib/rubygems/specification.rb | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/lib/rubygems/specification.rb ++++ b/lib/rubygems/specification.rb +@@ -1695,7 +1695,9 @@ + raise(Gem::InvalidSpecificationException, + "invalid date format in specification:#{date.inspect}")
+ end
+- when Time, DateLike then
++ when Time then
++Time.utc(date.utc.year, date.utc.month, date.utc.day)
++ when DateLike then
+ Time.utc(date.year, date.month, date.day) + else
+ TODAY(quoted diff) +0
-0reproducible.patch b/meta/recipes-devtools/ruby/ruby/0006-Make- gemspecs-reproducible.patch
new file mode 100644
index 000000000000..504893b4b4ffmeta/recipes-devtools/ruby/ruby/0006-Make-gemspecs- new file +0
-0reproducible.patch
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs- new file +5
-0@@ -0,0 +1,67 @@ +From: Lucas Kanashiro <[email protected]> +Date: Fri, 1 Nov 2019 15:25:17 -0300 +Subject: Make gemspecs reproducible + +Without an explicit date, they will get the current date and makethe
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs- new file +18
-0+build unreproducible + +Upstream-Status: Backport [debian] + +--- + ext/bigdecimal/bigdecimal.gemspec | 1 + + ext/fiddle/fiddle.gemspec | 1 + + ext/io/console/io-console.gemspec | 2 +- + lib/ipaddr.gemspec | 1 + + lib/rdoc/rdoc.gemspec | 1 + + 5 files changed, 5 insertions(+), 1 deletion(-) + +--- a/ext/bigdecimal/bigdecimal.gemspec ++++ b/ext/bigdecimal/bigdecimal.gemspec +@@ -6,6 +6,7 @@ + s.name = "bigdecimal" + s.version = bigdecimal_version + s.authors = ["Kenta Murata", "Zachary Scott", "ShigeoKobayashi"]
++ s.date =RUBY_RELEASE_DATE
+ s.email = ["[email protected]"]
+
+ s.summary = "Arbitrary-precision decimal floating-point number library."
+--- a/ext/fiddle/fiddle.gemspec
++++ b/ext/fiddle/fiddle.gemspec
+@@ -8,6 +8,7 @@
+Gem::Specification.newdo |spec|
+ spec.name = "fiddle"
+ spec.version =version_module::Fiddle::VERSION++ spec.date =RUBY_RELEASE_DATE
+ spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"] + spec.email = ["[email protected]", "[email protected]"]meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs- new file +31
-0+ +--- a/ext/io/console/io-console.gemspec ++++ b/ext/io/console/io-console.gemspec +@@ -4,6 +4,7 @@ + Gem::Specification.new do |s| + s.name = "io-console" + s.version = _VERSION ++ s.date = RUBY_RELEASE_DATE + s.summary = "Console interface" + s.email = "[email protected]" + s.description = "add console capabilities to IO instances." +--- a/lib/ipaddr.gemspec ++++ b/lib/ipaddr.gemspec +@@ -6,6 +6,7 @@ + Gem::Specification.new do |spec| + spec.name = "ipaddr" + spec.version = "1.2.2" ++ spec.date = RUBY_RELEASE_DATE + spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"] + spec.email = ["[email protected]", "[email protected]"] + +--- a/lib/rdoc/rdoc.gemspec ++++ b/lib/rdoc/rdoc.gemspec +@@ -7,6 +7,7 @@ + + Gem::Specification.new do |s| + s.name = "rdoc" ++ s.date = RUBY_RELEASE_DATE + s.version = RDoc::VERSION + + s.authors = [meta/recipes- renamed from meta/recipes-devtools/ruby/ruby_3.0.2.bb +0
-0devtools/ruby/ruby_3.0.2.bb
index38e594a59ef3..2abf504d91bc100644meta/recipes-devtools/ruby/ruby_3.0.2.bb +0
-0@@ -7,6 +7,10 @@ SRC_URI += " \ file://run-ptest \file://0001-template-Makefile.in-do-not-write-host-cross- cc-item.patch \
file://0002-template-Makefile.in-filter-out-f-prefix- map.patch \
+ file://0003-rdoc-build-reproducible-documentation.patch \
+ file://0004-lib-mkmf.rb-sort-list-of-object-files-in- generated-M.patch \
+ file://0005-Mark-Gemspec-reproducible-change-fixing- 784225-too.patch \
+ file://0006-Make-gemspecs-reproducible.patch \
"SRC_URI[sha256sum] = "
5085dee0ad9f06996a8acec7ebea4a8735e6fac22f22e2d98c3f2bc3bef7e6f1"-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#156496):
https://lists.openembedded.org/g/openembedded-core/message/156496
Mute This Topic: https://lists.openembedded.org/mt/85974381/5443093
Group Owner: [email protected] Unsubscribe:
https://lists.openembedded.org/g/openembedded-core/unsub [
[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
Thomas Perrot, Bootlin Embedded Linux and kernel engineering https://bootlin.com
Quoted 2 lines · Alexander Kanavin
Does this mean ruby can be dropped from reproducibility exception list?
That is the goal, I'll run that through the autobuilders
Quoted 264 lines
Alex
Quoted 259 lines · Thomas Perrot
Apply some changes on the Ruby makefiles in order to fix the reproducibility:
- use a fixed timestamp,
- sort linked objects,
- doesn't use the current date,
- and use UTC date.[YOCTO #14268]
Signed-off-by Thomas Perrot <[email protected]>--- ...doc-build-reproducible-documentation.patch | 35 ++++++++++ ...-list-of-object-files-in-generated-M.patch | 28 ++++++++ ...eproducible-change-fixing-784225-too.patch | 28 ++++++++ .../0006-Make-gemspecs-reproducible.patch | 67 +++++++++++++++++++ meta/recipes-devtools/ruby/ruby_3.0.2.bb | 4 ++ 5 files changed, 162 insertions(+) create mode 100644 meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch create mode 100644 meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch create mode 100644 meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch create mode 100644
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchdiff --git
a/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchb/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchnew file mode 100644
index 000000000000..f92f0e1ba683
---/dev/null
+++b/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchmeta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch new file +35
-0@@ -0,0 +1,35 @@ +From: Christian Hofstaedtler <[email protected]> +Date: Tue, 10 Oct 2017 15:04:34 -0300 +Subject: rdoc: build reproducible documentation + +- provide a fixed timestamp to the gzip compression + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Christian Hofstaedtler <[email protected]> +--- + lib/rdoc/generator/json_index.rb | 4 ++-- + lib/rdoc/rdoc.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/lib/rdoc/generator/json_index.rb ++++ b/lib/rdoc/generator/json_index.rb +@@ -178,7 +178,7 @@ + debug_msg "Writing gzipped search index to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(search_index_file) ++ gz.mtime = -1 + gz.orig_name = search_index_file.basename.to_s + gz.write search_index + gz.close +@@ -196,7 +196,7 @@ + debug_msg "Writing gzipped file to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(dest) ++ gz.mtime = -1 + gz.orig_name = dest.basename.to_s + gz.write data + gz.closediff --git
a/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchb/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchnew file mode 100644
index 000000000000..e0aca0dcfc10
---/dev/null
+++b/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchmeta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch new file +23
-0@@ -0,0 +1,28 @@ +From: Reiner Herrmann <[email protected]> +Date: Tue, 10 Oct 2017 15:06:13 -0300 +Subject: lib/mkmf.rb: sort list of object files in generated Makefile + +Without sorting the list explicitly, 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. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Reiner Herrmann <[email protected]> +--- + lib/mkmf.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/mkmf.rb ++++ b/lib/mkmf.rb +@@ -2315,7 +2315,7 @@ + LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS} + ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')} + SRCS = $(ORIG_SRCS) #{(srcs -orig_srcs).collect(&File.method(:basename)).join(' ')}
+-OBJS = #{$objs.join(" ")}
++OBJS = #{$objs.sort.join(" ")}
+ HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')}
+LOCAL_HDRS= #{$headers.join(' ')}
+ TARGET = #{target}
diff --gita/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchb/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchnew file mode 100644
index 000000000000..b7faa58655b2
---/dev/null
+++b/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchmeta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch new file +20
-0@@ -0,0 +1,28 @@ +From: Christian Hofstaedtler <[email protected]> +Date: Tue, 10 Oct 2017 15:07:11 -0300 +Subject: Mark Gemspec-reproducible change fixing #784225, too + +I think the UTC date change will fix the Multi-Arch not-same file issue, +too. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Christian Hofstaedtler <[email protected]> +--- + lib/rubygems/specification.rb | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/lib/rubygems/specification.rb ++++ b/lib/rubygems/specification.rb +@@ -1695,7 +1695,9 @@ + raise(Gem::InvalidSpecificationException, + "invalid date format in specification:#{date.inspect}")
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch new file +8
-0+ end +- when Time, DateLike then ++ when Time then ++ Time.utc(date.utc.year, date.utc.month, date.utc.day) ++ when DateLike then + Time.utc(date.year, date.month, date.day) + else + TODAYdiff --git
a/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchb/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchnew file mode 100644
index 000000000000..504893b4b4ffmeta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +27
-0@@ -0,0 +1,67 @@ +From: Lucas Kanashiro <[email protected]> +Date: Fri, 1 Nov 2019 15:25:17 -0300 +Subject: Make gemspecs reproducible + +Without an explicit date, they will get the current date and make the +build unreproducible + +Upstream-Status: Backport [debian] + +--- + ext/bigdecimal/bigdecimal.gemspec | 1 + + ext/fiddle/fiddle.gemspec | 1 + + ext/io/console/io-console.gemspec | 2 +- + lib/ipaddr.gemspec | 1 + + lib/rdoc/rdoc.gemspec | 1 + + 5 files changed, 5 insertions(+), 1 deletion(-) + +--- a/ext/bigdecimal/bigdecimal.gemspec ++++ b/ext/bigdecimal/bigdecimal.gemspec +@@ -6,6 +6,7 @@ + s.name = "bigdecimal" + s.version = bigdecimal_version + s.authors = ["Kenta Murata", "Zachary Scott", "Shigeo Kobayashi"] ++ s.date = RUBY_RELEASE_DATE + s.email = ["[email protected]"] + + s.summary = "Arbitrary-precision decimal floating-point numberlibrary."
+--- a/ext/fiddle/fiddle.gemspec
++++ b/ext/fiddle/fiddle.gemspec
+@@ -8,6 +8,7 @@
+Gem::Specification.newdo |spec|meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +5
-0+ spec.name = "fiddle" + spec.version = version_module::Fiddle::VERSION ++ spec.date = RUBY_RELEASE_DATE + spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"] + spec.email = ["[email protected]", "meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +31
-0+ +--- a/ext/io/console/io-console.gemspec ++++ b/ext/io/console/io-console.gemspec +@@ -4,6 +4,7 @@ + Gem::Specification.new do |s| + s.name = "io-console" + s.version = _VERSION ++ s.date = RUBY_RELEASE_DATE + s.summary = "Console interface" + s.email = "[email protected]" + s.description = "add console capabilities to IO instances." +--- a/lib/ipaddr.gemspec ++++ b/lib/ipaddr.gemspec +@@ -6,6 +6,7 @@ + Gem::Specification.new do |spec| + spec.name = "ipaddr" + spec.version = "1.2.2" ++ spec.date = RUBY_RELEASE_DATE + spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"] + spec.email = ["[email protected]", "[email protected]"] + +--- a/lib/rdoc/rdoc.gemspec ++++ b/lib/rdoc/rdoc.gemspec +@@ -7,6 +7,7 @@ + + Gem::Specification.new do |s| + s.name = "rdoc" ++ s.date = RUBY_RELEASE_DATE + s.version = RDoc::VERSION + + s.authors = [meta/recipes-devtools/ruby/ruby_3.0.2.bb +4
-0@@ -7,6 +7,10 @@ SRC_URI += " \ file://run-ptest \ file://0001-template-Makefile.in-do-not-write-host-cross-cc-item.patch \ file://0002-template-Makefile.in-filter-out-f-prefix-map.patch \ + file://0003-rdoc-build-reproducible-documentation.patch \ + file://0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch \ + file://0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch \ + file://0006-Make-gemspecs-reproducible.patch \ " SRC_URI[sha256sum] ="
5085dee0ad9f06996a8acec7ebea4a8735e6fac22f22e2d98c3f2bc3bef7e6f1" --
2.31.1-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#156493):
https://lists.openembedded.org/g/openembedded-core/message/156493
Mute This Topic: https://lists.openembedded.org/mt/85974381/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
But if it's not removed from repro exceptions you won't get an error if it's still not reproducible.
Alex
Quoted 296 lines · Alexandre Belloni
Quoted 2 lines · Alexander Kanavin
Does this mean ruby can be dropped from reproducibility exception list?
That is the goal, I'll run that through the autobuilders
Quoted 24 lines
Alex
Quoted 19 lines · Thomas Perrot
Apply some changes on the Ruby makefiles in order to fix the reproducibility:
- use a fixed timestamp,
- sort linked objects,
- doesn't use the current date,
- and use UTC date.[YOCTO #14268]
Signed-off-by Thomas Perrot <[email protected]>--- ...doc-build-reproducible-documentation.patch | 35 ++++++++++ ...-list-of-object-files-in-generated-M.patch | 28 ++++++++ ...eproducible-change-fixing-784225-too.patch | 28 ++++++++ .../0006-Make-gemspecs-reproducible.patch | 67 +++++++++++++++++++ meta/recipes-devtools/ruby/ruby_3.0.2.bb | 4 ++ 5 files changed, 162 insertions(+) create mode 100644
meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchQuoted 2 lines
Quoted 2 lines
create mode 100644
meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchQuoted 2 lines
Quoted 2 lines
create mode 100644
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchQuoted 5 lines
Quoted 5 lines
create mode 100644
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchdiff --git
a/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchQuoted 1 line
Quoted 1 line
b/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchQuoted 5 lines
Quoted 5 lines
new file mode 100644
index 000000000000..f92f0e1ba683
---/dev/null
+++
b/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchQuoted 30 lines
Quoted 30 lines
meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch new file +29
-0@@ -0,0 +1,35 @@ +From: Christian Hofstaedtler <[email protected]> +Date: Tue, 10 Oct 2017 15:04:34 -0300 +Subject: rdoc: build reproducible documentation + +- provide a fixed timestamp to the gzip compression + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Christian Hofstaedtler <[email protected]> +--- + lib/rdoc/generator/json_index.rb | 4 ++-- + lib/rdoc/rdoc.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/lib/rdoc/generator/json_index.rb ++++ b/lib/rdoc/generator/json_index.rb +@@ -178,7 +178,7 @@ + debug_msg "Writing gzipped search index to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(search_index_file) ++ gz.mtime = -1 + gz.orig_name = search_index_file.basename.to_s + gz.write search_index + gz.close +@@ -196,7 +196,7 @@ + debug_msg "Writing gzipped file to %s" % outfile +Quoted 8 lines
Quoted 8 lines
meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch new file +6
-0+ Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(dest) ++ gz.mtime = -1 + gz.orig_name = dest.basename.to_s + gz.write data + gz.closediff --git
a/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchQuoted 1 line
Quoted 1 line
b/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchQuoted 5 lines
Quoted 5 lines
new file mode 100644
index 000000000000..e0aca0dcfc10
---/dev/null
+++
b/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchQuoted 24 lines
Quoted 24 lines
meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch new file +23
-0@@ -0,0 +1,28 @@ +From: Reiner Herrmann <[email protected]> +Date: Tue, 10 Oct 2017 15:06:13 -0300 +Subject: lib/mkmf.rb: sort list of object files in generated Makefile + +Without sorting the list explicitly, 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. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Reiner Herrmann <[email protected]> +--- + lib/mkmf.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/mkmf.rb ++++ b/lib/mkmf.rb +@@ -2315,7 +2315,7 @@ + LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS} + ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')} + SRCS = $(ORIG_SRCS) #{(srcs -Quoted 8 lines
Quoted 8 lines
orig_srcs).collect(&File.method(:basename)).join(' ')} +-OBJS = #{$objs.join(" ")}
++OBJS = #{$objs.sort.join(" ")}
+ HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')}
+LOCAL_HDRS= #{$headers.join(' ')}
+ TARGET = #{target}
diff --git
a/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchQuoted 1 line
Quoted 1 line
b/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchQuoted 5 lines
Quoted 5 lines
new file mode 100644
index 000000000000..b7faa58655b2
---/dev/null
+++
b/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchQuoted 6 lines
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch line 5
Quoted 6 lines
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch new file +5
-0@@ -0,0 +1,28 @@ +From: Christian Hofstaedtler <[email protected]> +Date: Tue, 10 Oct 2017 15:07:11 -0300 +Subject: Mark Gemspec-reproducible change fixing #784225, too + +I think the UTC date change will fix the Multi-Arch not-same fileissue,
Quoted 23 lines
Quoted 23 lines
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch new file +15
-0+too. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Christian Hofstaedtler <[email protected]> +--- + lib/rubygems/specification.rb | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/lib/rubygems/specification.rb ++++ b/lib/rubygems/specification.rb +@@ -1695,7 +1695,9 @@ + raise(Gem::InvalidSpecificationException, + "invalid date format in specification:#{date.inspect}")
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch new file +7
-0+ end +- when Time, DateLike then ++ when Time then ++ Time.utc(date.utc.year, date.utc.month, date.utc.day) ++ when DateLike then + Time.utc(date.year, date.month, date.day) + elseQuoted 8 lines
Quoted 8 lines
+ TODAY
diff --gita/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchb/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchnew file mode 100644
index 000000000000..504893b4b4ff
---/dev/null
+++
b/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchQuoted 16 lines
Quoted 16 lines
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +15
-0@@ -0,0 +1,67 @@ +From: Lucas Kanashiro <[email protected]> +Date: Fri, 1 Nov 2019 15:25:17 -0300 +Subject: Make gemspecs reproducible + +Without an explicit date, they will get the current date and make the +build unreproducible + +Upstream-Status: Backport [debian] + +--- + ext/bigdecimal/bigdecimal.gemspec | 1 + + ext/fiddle/fiddle.gemspec | 1 + + ext/io/console/io-console.gemspec | 2 +- + lib/ipaddr.gemspec | 1 + + lib/rdoc/rdoc.gemspec | 1 +Quoted 8 lines
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch
Quoted 8 lines
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +8
-0+ 5 files changed, 5 insertions(+), 1 deletion(-) + +--- a/ext/bigdecimal/bigdecimal.gemspec ++++ b/ext/bigdecimal/bigdecimal.gemspec +@@ -6,6 +6,7 @@ + s.name = "bigdecimal" + s.version = bigdecimal_version + s.authors = ["Kenta Murata", "Zachary Scott", "ShigeoKobayashi"]
Quoted 4 lines
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch
Quoted 4 lines
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +4
-0++ s.date = RUBY_RELEASE_DATE + s.email = ["[email protected]"] + + s.summary = "Arbitrary-precision decimal floating-pointnumber
Quoted 50 lines
Quoted 50 lines
library."
+--- a/ext/fiddle/fiddle.gemspec
++++ b/ext/fiddle/fiddle.gemspec
+@@ -8,6 +8,7 @@
+Gem::Specification.newdo |spec|meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +5
-0+ spec.name = "fiddle" + spec.version = version_module::Fiddle::VERSION ++ spec.date = RUBY_RELEASE_DATE + spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"] + spec.email = ["[email protected]", "meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +31
-0+ +--- a/ext/io/console/io-console.gemspec ++++ b/ext/io/console/io-console.gemspec +@@ -4,6 +4,7 @@ + Gem::Specification.new do |s| + s.name = "io-console" + s.version = _VERSION ++ s.date = RUBY_RELEASE_DATE + s.summary = "Console interface" + s.email = "[email protected]" + s.description = "add console capabilities to IO instances." +--- a/lib/ipaddr.gemspec ++++ b/lib/ipaddr.gemspec +@@ -6,6 +6,7 @@ + Gem::Specification.new do |spec| + spec.name = "ipaddr" + spec.version = "1.2.2" ++ spec.date = RUBY_RELEASE_DATE + spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"] + spec.email = ["[email protected]", "[email protected]"] + +--- a/lib/rdoc/rdoc.gemspec ++++ b/lib/rdoc/rdoc.gemspec +@@ -7,6 +7,7 @@ + + Gem::Specification.new do |s| + s.name = "rdoc" ++ s.date = RUBY_RELEASE_DATE + s.version = RDoc::VERSION + + s.authors = [meta/recipes-devtools/ruby/ruby_3.0.2.bb +0
-0@@ -7,6 +7,10 @@ SRC_URI += " \ file://run-ptest \Quoted 1 line
Quoted 1 line
file://0001-template-Makefile.in-do-not-write-host-cross-cc-item.patch
\
Quoted 1 line
Quoted 1 line
file://0002-template-Makefile.in-filter-out-f-prefix-map.patch
Quoted 4 lines
meta/recipes-devtools/ruby/ruby_3.0.2.bb
Quoted 4 lines
\
meta/recipes-devtools/ruby/ruby_3.0.2.bb +2
-0+ file://0003-rdoc-build-reproducible-documentation.patch \ +file://0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch \
Quoted 11 lines
Quoted 11 lines
meta/recipes-devtools/ruby/ruby_3.0.2.bb +2
-0+ file://0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch \ + file://0006-Make-gemspecs-reproducible.patch \ " SRC_URI[sha256sum] ="
5085dee0ad9f06996a8acec7ebea4a8735e6fac22f22e2d98c3f2bc3bef7e6f1" --
2.31.1Quoted 7 lines
Quoted 7 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#156493):
https://lists.openembedded.org/g/openembedded-core/message/156493
Mute This Topic: https://lists.openembedded.org/mt/85974381/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub[
Quoted 4 lines
Quoted 4 lines
[email protected]]
-=-=-=-=-=-=-=-=-=-=-=---
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Quoted 3 lines · Alexander Kanavin
But if it's not removed from repro exceptions you won't get an error if it's still not reproducible.
Sure, I'll remove it.
Quoted 301 lines
Alex
Quoted 296 lines · Alexandre Belloni
Quoted 2 lines · Alexander Kanavin
Does this mean ruby can be dropped from reproducibility exception list?
That is the goal, I'll run that through the autobuilders
Quoted 24 lines
Alex
Quoted 19 lines · Thomas Perrot
Apply some changes on the Ruby makefiles in order to fix the reproducibility:
- use a fixed timestamp,
- sort linked objects,
- doesn't use the current date,
- and use UTC date.[YOCTO #14268]
Signed-off-by Thomas Perrot <[email protected]>--- ...doc-build-reproducible-documentation.patch | 35 ++++++++++ ...-list-of-object-files-in-generated-M.patch | 28 ++++++++ ...eproducible-change-fixing-784225-too.patch | 28 ++++++++ .../0006-Make-gemspecs-reproducible.patch | 67 +++++++++++++++++++ meta/recipes-devtools/ruby/ruby_3.0.2.bb | 4 ++ 5 files changed, 162 insertions(+) create mode 100644
meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchQuoted 2 lines
Quoted 2 lines
create mode 100644
meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchQuoted 2 lines
Quoted 2 lines
create mode 100644
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchQuoted 5 lines
Quoted 5 lines
create mode 100644
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchdiff --git
a/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchQuoted 1 line
Quoted 1 line
b/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchQuoted 5 lines
Quoted 5 lines
new file mode 100644
index 000000000000..f92f0e1ba683
---/dev/null
+++
b/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patchQuoted 30 lines
Quoted 30 lines
meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch new file +29
-0@@ -0,0 +1,35 @@ +From: Christian Hofstaedtler <[email protected]> +Date: Tue, 10 Oct 2017 15:04:34 -0300 +Subject: rdoc: build reproducible documentation + +- provide a fixed timestamp to the gzip compression + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Christian Hofstaedtler <[email protected]> +--- + lib/rdoc/generator/json_index.rb | 4 ++-- + lib/rdoc/rdoc.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/lib/rdoc/generator/json_index.rb ++++ b/lib/rdoc/generator/json_index.rb +@@ -178,7 +178,7 @@ + debug_msg "Writing gzipped search index to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(search_index_file) ++ gz.mtime = -1 + gz.orig_name = search_index_file.basename.to_s + gz.write search_index + gz.close +@@ -196,7 +196,7 @@ + debug_msg "Writing gzipped file to %s" % outfile +Quoted 8 lines
Quoted 8 lines
meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch new file +6
-0+ Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(dest) ++ gz.mtime = -1 + gz.orig_name = dest.basename.to_s + gz.write data + gz.closediff --git
a/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchQuoted 1 line
Quoted 1 line
b/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchQuoted 5 lines
Quoted 5 lines
new file mode 100644
index 000000000000..e0aca0dcfc10
---/dev/null
+++
b/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patchQuoted 24 lines
Quoted 24 lines
meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch new file +23
-0@@ -0,0 +1,28 @@ +From: Reiner Herrmann <[email protected]> +Date: Tue, 10 Oct 2017 15:06:13 -0300 +Subject: lib/mkmf.rb: sort list of object files in generated Makefile + +Without sorting the list explicitly, 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. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Reiner Herrmann <[email protected]> +--- + lib/mkmf.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/mkmf.rb ++++ b/lib/mkmf.rb +@@ -2315,7 +2315,7 @@ + LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS} + ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')} + SRCS = $(ORIG_SRCS) #{(srcs -Quoted 8 lines
Quoted 8 lines
orig_srcs).collect(&File.method(:basename)).join(' ')} +-OBJS = #{$objs.join(" ")}
++OBJS = #{$objs.sort.join(" ")}
+ HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')}
+LOCAL_HDRS= #{$headers.join(' ')}
+ TARGET = #{target}
diff --git
a/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchQuoted 1 line
Quoted 1 line
b/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchQuoted 5 lines
Quoted 5 lines
new file mode 100644
index 000000000000..b7faa58655b2
---/dev/null
+++
b/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patchQuoted 6 lines
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch line 5
Quoted 6 lines
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch new file +5
-0@@ -0,0 +1,28 @@ +From: Christian Hofstaedtler <[email protected]> +Date: Tue, 10 Oct 2017 15:07:11 -0300 +Subject: Mark Gemspec-reproducible change fixing #784225, too + +I think the UTC date change will fix the Multi-Arch not-same fileissue,
Quoted 23 lines
Quoted 23 lines
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch new file +15
-0+too. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <[email protected]> +Signed-off-by: Christian Hofstaedtler <[email protected]> +--- + lib/rubygems/specification.rb | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/lib/rubygems/specification.rb ++++ b/lib/rubygems/specification.rb +@@ -1695,7 +1695,9 @@ + raise(Gem::InvalidSpecificationException, + "invalid date format in specification:#{date.inspect}")
meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch new file +7
-0+ end +- when Time, DateLike then ++ when Time then ++ Time.utc(date.utc.year, date.utc.month, date.utc.day) ++ when DateLike then + Time.utc(date.year, date.month, date.day) + elseQuoted 8 lines
Quoted 8 lines
+ TODAY
diff --gita/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchb/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchnew file mode 100644
index 000000000000..504893b4b4ff
---/dev/null
+++
b/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patchQuoted 16 lines
Quoted 16 lines
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +15
-0@@ -0,0 +1,67 @@ +From: Lucas Kanashiro <[email protected]> +Date: Fri, 1 Nov 2019 15:25:17 -0300 +Subject: Make gemspecs reproducible + +Without an explicit date, they will get the current date and make the +build unreproducible + +Upstream-Status: Backport [debian] + +--- + ext/bigdecimal/bigdecimal.gemspec | 1 + + ext/fiddle/fiddle.gemspec | 1 + + ext/io/console/io-console.gemspec | 2 +- + lib/ipaddr.gemspec | 1 + + lib/rdoc/rdoc.gemspec | 1 +Quoted 8 lines
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch
Quoted 8 lines
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +8
-0+ 5 files changed, 5 insertions(+), 1 deletion(-) + +--- a/ext/bigdecimal/bigdecimal.gemspec ++++ b/ext/bigdecimal/bigdecimal.gemspec +@@ -6,6 +6,7 @@ + s.name = "bigdecimal" + s.version = bigdecimal_version + s.authors = ["Kenta Murata", "Zachary Scott", "ShigeoKobayashi"]
Quoted 4 lines
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch
Quoted 4 lines
meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +4
-0++ s.date = RUBY_RELEASE_DATE + s.email = ["[email protected]"] + + s.summary = "Arbitrary-precision decimal floating-pointnumber
Quoted 50 lines
Quoted 50 lines
library."
+--- a/ext/fiddle/fiddle.gemspec
++++ b/ext/fiddle/fiddle.gemspec
+@@ -8,6 +8,7 @@
+Gem::Specification.newdo |spec|meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +5
-0+ spec.name = "fiddle" + spec.version = version_module::Fiddle::VERSION ++ spec.date = RUBY_RELEASE_DATE + spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"] + spec.email = ["[email protected]", "meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file +31
-0+ +--- a/ext/io/console/io-console.gemspec ++++ b/ext/io/console/io-console.gemspec +@@ -4,6 +4,7 @@ + Gem::Specification.new do |s| + s.name = "io-console" + s.version = _VERSION ++ s.date = RUBY_RELEASE_DATE + s.summary = "Console interface" + s.email = "[email protected]" + s.description = "add console capabilities to IO instances." +--- a/lib/ipaddr.gemspec ++++ b/lib/ipaddr.gemspec +@@ -6,6 +6,7 @@ + Gem::Specification.new do |spec| + spec.name = "ipaddr" + spec.version = "1.2.2" ++ spec.date = RUBY_RELEASE_DATE + spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"] + spec.email = ["[email protected]", "[email protected]"] + +--- a/lib/rdoc/rdoc.gemspec ++++ b/lib/rdoc/rdoc.gemspec +@@ -7,6 +7,7 @@ + + Gem::Specification.new do |s| + s.name = "rdoc" ++ s.date = RUBY_RELEASE_DATE + s.version = RDoc::VERSION + + s.authors = [meta/recipes-devtools/ruby/ruby_3.0.2.bb +0
-0@@ -7,6 +7,10 @@ SRC_URI += " \ file://run-ptest \Quoted 1 line
Quoted 1 line
file://0001-template-Makefile.in-do-not-write-host-cross-cc-item.patch
\
Quoted 1 line
Quoted 1 line
file://0002-template-Makefile.in-filter-out-f-prefix-map.patch
Quoted 4 lines
meta/recipes-devtools/ruby/ruby_3.0.2.bb
Quoted 4 lines
\
meta/recipes-devtools/ruby/ruby_3.0.2.bb +2
-0+ file://0003-rdoc-build-reproducible-documentation.patch \ +file://0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch \
Quoted 11 lines
Quoted 11 lines
meta/recipes-devtools/ruby/ruby_3.0.2.bb +2
-0+ file://0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch \ + file://0006-Make-gemspecs-reproducible.patch \ " SRC_URI[sha256sum] ="
5085dee0ad9f06996a8acec7ebea4a8735e6fac22f22e2d98c3f2bc3bef7e6f1" --
2.31.1Quoted 7 lines
Quoted 7 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#156493):
https://lists.openembedded.org/g/openembedded-core/message/156493
Mute This Topic: https://lists.openembedded.org/mt/85974381/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub[
Quoted 4 lines
Quoted 4 lines
[email protected]]
-=-=-=-=-=-=-=-=-=-=-=---
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com