Your message dated Tue, 16 Aug 2016 16:11:38 +0000
with message-id <[email protected]>
and subject line Bug#795484: fixed in ruby-rmagick 2.15.4+dfsg-2
has caused the Debian Bug report #795484,
regarding ruby-rmagick: please make the build reproducible
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
795484: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=795484
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: ruby-rmagick
Version: 2.13.2-4
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: randomness timestamps
X-Debbugs-Cc: [email protected]
Hi,
While working on the "reproducible builds" effort [1], we have noticed
that ruby-rmagick could not be built reproducibly.
This is due to:
- Inherent randomness in some of the documentation images. For example,
using fractals and/or random noise.
- Examples using timestamps as image captions.
In order to fix the former, I needed to expose ImageMagick's
SeedPseudoRandomGenerator method via the RMagick interface itself and
then ensure it is called in the right documentation fragments. To fix
the later, I simply hardcoded the image captions.
Patch attached. Once applied, ruby-rmagick can be built reproducibly
in our reproducible toolchain.
[1]: https://wiki.debian.org/ReproducibleBuilds
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` [email protected] / chris-lamb.co.uk
`-
diff --git a/doc/ex/add_noise.rb b/doc/ex/add_noise.rb
index 4756efe..1fff60d 100644
--- a/doc/ex/add_noise.rb
+++ b/doc/ex/add_noise.rb
@@ -1,5 +1,6 @@
#! /usr/local/bin/ruby -w
require 'RMagick'
+Magick::seed_pseudo_random_generator 0
# Demonstrate the Image#add_noise method
NOISE_TYPES = [Magick::UniformNoise, Magick::GaussianNoise,
diff --git a/doc/ex/enhance.rb b/doc/ex/enhance.rb
index fd76795..e9daac3 100644
--- a/doc/ex/enhance.rb
+++ b/doc/ex/enhance.rb
@@ -1,5 +1,6 @@
#!/usr/local/bin/ruby -w
require 'RMagick'
+Magick::seed_pseudo_random_generator 0
# Demonstrate the Image#enhance method
diff --git a/doc/ex/matte_fill_to_border.rb b/doc/ex/matte_fill_to_border.rb
index 3ae1a15..05a2412 100644
--- a/doc/ex/matte_fill_to_border.rb
+++ b/doc/ex/matte_fill_to_border.rb
@@ -1,6 +1,7 @@
#! /usr/local/bin/ruby -w
require 'RMagick'
+Magick::seed_pseudo_random_generator 0
img = Magick::Image.new(200,200)
img.compression = Magick::LZWCompression
diff --git a/doc/ex/matte_floodfill.rb b/doc/ex/matte_floodfill.rb
index e528d11..b101024 100644
--- a/doc/ex/matte_floodfill.rb
+++ b/doc/ex/matte_floodfill.rb
@@ -1,6 +1,7 @@
#! /usr/local/bin/ruby -w
require 'RMagick'
+Magick::seed_pseudo_random_generator 0
img = Magick::Image.new(200,200)
img.compression = Magick::LZWCompression
diff --git a/doc/ex/matte_replace.rb b/doc/ex/matte_replace.rb
index fa047cd..655bd0f 100644
--- a/doc/ex/matte_replace.rb
+++ b/doc/ex/matte_replace.rb
@@ -1,6 +1,7 @@
#! /usr/local/bin/ruby -w
require 'RMagick'
+Magick::seed_pseudo_random_generator 0
img = Magick::Image.new(200,200)
img.compression = Magick::LZWCompression
diff --git a/doc/ex/median_filter.rb b/doc/ex/median_filter.rb
index 70dc899..7202b4e 100644
--- a/doc/ex/median_filter.rb
+++ b/doc/ex/median_filter.rb
@@ -1,5 +1,6 @@
#! /usr/local/bin/ruby -w
require 'RMagick'
+Magick::seed_pseudo_random_generator 0
# Demonstrate the Image#median_filter method
diff --git a/doc/ex/polaroid.rb b/doc/ex/polaroid.rb
index 026af47..23f3ebc 100644
--- a/doc/ex/polaroid.rb
+++ b/doc/ex/polaroid.rb
@@ -5,7 +5,7 @@ require 'date'
# Demonstrate the Image#polaroid method
img = Magick::Image.read('images/Flower_Hat.jpg').first
-img[:Caption] = "\nLosha\n" + Date.today.to_s
+img[:Caption] = "\nLosha\nPlus hat"
begin
picture = img.polaroid do
diff --git a/doc/ex/reduce_noise.rb b/doc/ex/reduce_noise.rb
index 05615e4..b139c2d 100644
--- a/doc/ex/reduce_noise.rb
+++ b/doc/ex/reduce_noise.rb
@@ -1,5 +1,6 @@
#! /usr/local/bin/ruby -w
require 'RMagick'
+Magick::seed_pseudo_random_generator 0
# Demonstrate the Image#reduce_noise method
diff --git a/doc/ex/sketch.rb b/doc/ex/sketch.rb
index f4e7eda..f263c86 100644
--- a/doc/ex/sketch.rb
+++ b/doc/ex/sketch.rb
@@ -1,6 +1,7 @@
#! /usr/local/bin/ruby -w
require 'RMagick'
+Magick::seed_pseudo_random_generator 0
img = Magick::Image.read('images/Flower_Hat.jpg').first
diff --git a/doc/ex/spread.rb b/doc/ex/spread.rb
index 7bf9d96..fd4d86d 100644
--- a/doc/ex/spread.rb
+++ b/doc/ex/spread.rb
@@ -1,5 +1,6 @@
#! /usr/local/bin/ruby -w
require 'RMagick'
+Magick::seed_pseudo_random_generator 0
# Demonstrate the Image#spread method
diff --git a/doc/ex/transparent.rb b/doc/ex/transparent.rb
index 3280021..8fdc887 100644
--- a/doc/ex/transparent.rb
+++ b/doc/ex/transparent.rb
@@ -1,5 +1,6 @@
#! /usr/local/bin/ruby -w
require 'RMagick'
+Magick::seed_pseudo_random_generator 0
# Demonstrate the Image#transparent method.
# Change all black pixels in the image to transparent.
diff --git a/ext/RMagick/rmagick.c b/ext/RMagick/rmagick.c
index 661f95f..5c81108 100644
--- a/ext/RMagick/rmagick.c
+++ b/ext/RMagick/rmagick.c
@@ -392,3 +392,24 @@ Magick_set_log_format(VALUE class, VALUE format)
return class;
}
+
+/**
+ * Sets the pseudo-random number generator secret key
+ *
+ * Ruby usage:
+ * - @verbatim Magick.seed_pseudo_random_generator(seed) @endverbatim
+ *
+ * Notes:
+ * - singleton method
+ *
+ * @param class the class on which the method is run.
+ * @param seed the secret key
+ * @return the class.
+ */
+VALUE
+Magick_seed_pseudo_random_generator(VALUE class, VALUE seed)
+{
+ unsigned long s = NUM2ULONG(seed);
+ (void) SeedPseudoRandomGenerator(s);
+ return class;
+}
diff --git a/ext/RMagick/rmagick.h b/ext/RMagick/rmagick.h
index 8aa6f3f..30c4f38 100644
--- a/ext/RMagick/rmagick.h
+++ b/ext/RMagick/rmagick.h
@@ -676,6 +676,7 @@ extern VALUE Magick_limit_resource(int, VALUE *, VALUE);
extern VALUE Magick_set_cache_threshold(VALUE, VALUE);
extern VALUE Magick_set_log_event_mask(int, VALUE *, VALUE);
extern VALUE Magick_set_log_format(VALUE, VALUE);
+extern VALUE Magick_seed_pseudo_random_generator(VALUE, VALUE);
// rmdraw.c
ATTR_WRITER(Draw, affine)
diff --git a/ext/RMagick/rmmain.c b/ext/RMagick/rmmain.c
index e5ebc92..6fc465c 100644
--- a/ext/RMagick/rmmain.c
+++ b/ext/RMagick/rmmain.c
@@ -184,6 +184,7 @@ Init_RMagick2(void)
rb_define_module_function(Module_Magick, "set_cache_threshold",
Magick_set_cache_threshold, 1);
rb_define_module_function(Module_Magick, "set_log_event_mask",
Magick_set_log_event_mask, -1);
rb_define_module_function(Module_Magick, "set_log_format",
Magick_set_log_format, 1);
+ rb_define_module_function(Module_Magick, "seed_pseudo_random_generator",
Magick_seed_pseudo_random_generator, 1);
/*-----------------------------------------------------------------------*/
/* Class Magick::Image methods */
--- End Message ---
--- Begin Message ---
Source: ruby-rmagick
Source-Version: 2.15.4+dfsg-2
We believe that the bug you reported is fixed in the latest version of
ruby-rmagick, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Antonio Terceiro <[email protected]> (supplier of updated ruby-rmagick
package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Tue, 16 Aug 2016 11:29:37 -0300
Source: ruby-rmagick
Binary: ruby-rmagick ruby-rmagick-doc
Architecture: source
Version: 2.15.4+dfsg-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Ruby Extras Maintainers
<[email protected]>
Changed-By: Antonio Terceiro <[email protected]>
Description:
ruby-rmagick - ImageMagick API for Ruby
ruby-rmagick-doc - ImageMagick API for Ruby (documentation)
Closes: 795484
Changes:
ruby-rmagick (2.15.4+dfsg-2) unstable; urgency=medium
.
* Bump Standards-Version to 3.9.8 (no changes needed)
* Add 2 patches to make build reproducible (Closes: #795484)
- 0003-Use-deterministic-label-for-image.patch, based on the original
patch by Chris Lamb.
- 0004-Seed-RNG-to-0-during-builds.patch: seed random number generator
with 0 when SOURCE_DATE_EPOCH is set. This will also help reverse
dependencies that use ruby-rmagick during their own build.
Checksums-Sha1:
d0734b0fbd1e0f5f31a6158e42357e259a7dbd01 2349 ruby-rmagick_2.15.4+dfsg-2.dsc
fc34ac254052a89e299efbd51eafd5cd37e2dd4b 7936
ruby-rmagick_2.15.4+dfsg-2.debian.tar.xz
Checksums-Sha256:
ae02121713dea32a41dbbce10bf7f33034815f09d42284c3ef6305f2be7f92ef 2349
ruby-rmagick_2.15.4+dfsg-2.dsc
cf11ae1b442fd4d02ec1854b3b45fd90a324e6a1af0168dc07b0b320ea46f2c8 7936
ruby-rmagick_2.15.4+dfsg-2.debian.tar.xz
Files:
068f4ae9d3ac2a2127a1ffc100b303ef 2349 ruby optional
ruby-rmagick_2.15.4+dfsg-2.dsc
cf31d94de9dd3643b0b4a79850fc2e2f 7936 ruby optional
ruby-rmagick_2.15.4+dfsg-2.debian.tar.xz
-----BEGIN PGP SIGNATURE-----
iQIcBAEBCAAGBQJXsySRAAoJEPwNsbvNRgvedjMP/RzVyVQ8SfFdJK0PopYGcg2t
vLk19Ez+wsc9ALGxQhq6vRjRoLlz7SXNECQha9KV7KCMa/BckxAt+f2HMJBcjPpV
d+AH4ANha7ZEZvbwecviam8KvTvODnB5zuHCiFwKu2P/OivxUhLzNIUJX0cFvQP3
P2r2kXZATfKlGESl5rgks9r1wj1OBuyexUFiwp7KBXTeylVZNHggMemguUYB+n8B
CfGsty50jHPh9atSmesBbDGwt5pjfcKRXO9x3U2632IADTp9PdM/BCMjNeWaVHvo
+c5bdeHIzc/2CqNo5kClUmiVYywLUKTqyGJEyAHhZzdfesrE+o4I9rVYVY/pNuCw
mmBr/Mz5aTVoPZ17TJCrW6CccSj21GXk0+3UJHWw7pFOcd6G1ses5NCSJ44+3Qu7
xdVquApl/OrXaytviY48mkoHtvwWsu3acZL6dBgfQagk7H39EEMPz46Nwi+pQXCA
txe+IavDL9YP3scjFOHQSrtVeXuyXvAWGiasxWTRIeiOZibeb35mcz/zgPIjZD2O
yFxCySzBYb0Rss6s22XFhMPzHKJaFif6tUyzb5hPL2CluwHftdRG0eDpe9X7hsuL
LeCmQW+MB8Edkj/A0tf3S1iWpFHY51ugWcT0bLvoLdKkQVGomXB4lIG75DTWmbU0
Zaxyvw0zf5UjQ8INw+PU
=9tih
-----END PGP SIGNATURE-----
--- End Message ---
_______________________________________________
Pkg-ruby-extras-maintainers mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ruby-extras-maintainers