[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#794586: marked as done (ocaml: Please make ocamldoc produce reproducible manpages)



Your message dated Thu, 13 Aug 2015 17:51:47 +0000
with message-id <E1ZPwfL-0005kr-PP@franck.debian.org>
and subject line Bug#794586: fixed in ocaml 4.02.3-1
has caused the Debian Bug report #794586,
regarding ocaml: Please make ocamldoc produce reproducible manpages
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 owner@bugs.debian.org
immediately.)


-- 
794586: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=794586
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: ocaml
Version: 4.01.0-5
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

While working on the “reproducible builds” effort [1], we have noticed
that packages using ocamldoc to write manpages could not be built
reproducibly, including ocaml itself.

The attached patch removes extra timestamps from the generated
documentation. Once applied, ocamldoc-generated manpages can be built
reproducibly in our current experimental framework.

Note: this patch itself does not make ocaml build reproducibly, I will
submit a patch for that after #794583 is fixed.

 [1]: https://wiki.debian.org/ReproducibleBuilds

Regards,
Valentin
diff -u../chroot/root/ocaml-4.01.0/ocamldoc/odoc_man.ml
--- ocamldoc/odoc_man.ml	2012-10-15 19:50:56.000000000 +0200
+++ ../chroot/root/ocaml-4.01.0/ocamldoc/odoc_man.ml	2015-08-03 23:33:12.000000000 +0200
@@ -720,14 +720,13 @@
     (** Generate the man page for the given class.*)
     method generate_for_class cl =
       Odoc_info.reset_type_names () ;
-      let date = Unix.time () in
       let file = self#file_name cl.cl_name in
       try
         let chanout = self#open_out file in
         let b = new_buf () in
         bs b (".TH \""^cl.cl_name^"\" ");
         bs b !man_section ;
-        bs b (" "^(Odoc_misc.string_of_date ~hour: false date)^" ");
+        bs b (" source: "^Odoc_misc.current_date^" ");
         bs b "OCamldoc ";
         bs b ("\""^(match !Global.title with Some t -> t | None -> "")^"\"\n");
 
@@ -779,14 +778,13 @@
     (** Generate the man page for the given class type.*)
     method generate_for_class_type ct =
       Odoc_info.reset_type_names () ;
-      let date = Unix.time () in
       let file = self#file_name ct.clt_name in
       try
         let chanout = self#open_out file in
         let b = new_buf () in
         bs b (".TH \""^ct.clt_name^"\" ");
         bs b !man_section ;
-        bs b (" "^(Odoc_misc.string_of_date ~hour: false date)^" ");
+        bs b (" source: "^Odoc_misc.current_date^" ");
         bs b "OCamldoc ";
         bs b ("\""^(match !Global.title with Some t -> t | None -> "")^"\"\n");
 
@@ -836,14 +834,13 @@
     (** Generate the man file for the given module type.
        @raise Failure if an error occurs.*)
     method generate_for_module_type mt =
-      let date = Unix.time () in
       let file = self#file_name mt.mt_name in
       try
         let chanout = self#open_out file in
         let b = new_buf () in
         bs b (".TH \""^mt.mt_name^"\" ");
         bs b !man_section ;
-        bs b (" "^(Odoc_misc.string_of_date ~hour: false date)^" ");
+        bs b (" source: "^Odoc_misc.current_date^" ");
         bs b "OCamldoc ";
         bs b ("\""^(match !Global.title with Some t -> t | None -> "")^"\"\n");
 
@@ -914,14 +911,13 @@
     (** Generate the man file for the given module.
        @raise Failure if an error occurs.*)
     method generate_for_module m =
-      let date = Unix.time () in
       let file = self#file_name m.m_name in
       try
         let chanout = self#open_out file in
         let b = new_buf () in
         bs b (".TH \""^m.m_name^"\" ");
         bs b !man_section ;
-        bs b (" "^(Odoc_misc.string_of_date ~hour: false date)^" ");
+        bs b (" source: "^Odoc_misc.current_date^" ");
         bs b "OCamldoc ";
         bs b ("\""^(match !Global.title with Some t -> t | None -> "")^"\"\n");
 
@@ -1045,14 +1041,13 @@
           | Res_const (_,f) -> f.vc_name
          )
      in
-     let date = Unix.time () in
       let file = self#file_name name in
       try
         let chanout = self#open_out file in
         let b = new_buf () in
         bs b (".TH \""^name^"\" ");
         bs b !man_section ;
-        bs b (" "^(Odoc_misc.string_of_date ~hour: false date)^" ");
+        bs b (" source: "^Odoc_misc.current_date^" ");
         bs b "OCamldoc ";
         bs b ("\""^(match !Global.title with Some t -> t | None -> "")^"\"\n");
         bs b ".SH NAME\n";
diff -u ocamldoc/odoc_misc.ml ../chroot/root/ocaml-4.01.0/ocamldoc/odoc_misc.ml
--- ocamldoc/odoc_misc.ml	2012-10-15 19:50:56.000000000 +0200
+++ ../chroot/root/ocaml-4.01.0/ocamldoc/odoc_misc.ml	2015-08-03 23:26:58.000000000 +0200
@@ -223,9 +223,9 @@
     None -> None
   | Some v -> Some (f v)
 
-let string_of_date ?(hour=true) d =
+let string_of_date ?(absolute=false) ?(hour=true) d =
   let add_0 s = if String.length s < 2 then "0"^s else s in
-  let t = Unix.localtime d in
+  let t = (if absolute then Unix.gmtime else Unix.localtime) d in
   (string_of_int (t.Unix.tm_year + 1900))^"-"^
   (add_0 (string_of_int (t.Unix.tm_mon + 1)))^"-"^
   (add_0 (string_of_int t.Unix.tm_mday))^
@@ -238,6 +238,14 @@
      ""
   )
 
+let current_date =
+  let time =
+    try
+      float_of_string (Sys.getenv "SOURCE_DATE_EPOCH")
+    with
+      Sys_error _ -> Unix.time ()
+  in string_of_date ~absolute: true ~hour: false time
+
 
 let rec text_list_concat sep l =
   match l with
diff -u ocamldoc/odoc_misc.mli ../chroot/root/ocaml-4.01.0/ocamldoc/odoc_misc.mli
--- ocamldoc/odoc_misc.mli	2012-10-15 19:50:56.000000000 +0200
+++ ../chroot/root/ocaml-4.01.0/ocamldoc/odoc_misc.mli	2015-08-03 23:30:13.000000000 +0200
@@ -62,7 +62,12 @@
 
 (** Return a string representing a date given as a number of seconds
    since 1970. The hour is optionnaly displayed. *)
-val string_of_date : ?hour:bool -> float -> string
+val string_of_date : ?absolute:bool -> ?hour:bool -> float -> string
+
+(* Value returned by string_of_date for current time.
+ * Uses environment variable SOURCE_DATE_EPOCH if set; falls back to
+ * current timestamp otherwise. *)
+val current_date : string
 
 (** Return the first sentence (until the first dot) of a text.
    Don't stop in the middle of [Code], [Verbatim], [List], [Lnum],

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
Source: ocaml
Source-Version: 4.02.3-1

We believe that the bug you reported is fixed in the latest version of
ocaml, 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 794586@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Stéphane Glondu <glondu@debian.org> (supplier of updated ocaml 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 ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 13 Aug 2015 18:53:50 +0200
Source: ocaml
Binary: ocaml-nox ocaml ocaml-base-nox ocaml-base ocaml-native-compilers ocaml-source ocaml-interp ocaml-compiler-libs ocaml-mode
Architecture: source amd64 all
Version: 4.02.3-1
Distribution: experimental
Urgency: medium
Maintainer: Debian OCaml Maintainers <debian-ocaml-maint@lists.debian.org>
Changed-By: Stéphane Glondu <glondu@debian.org>
Description:
 ocaml      - ML language implementation with a class-based object system
 ocaml-base - Runtime system for OCaml bytecode executables
 ocaml-base-nox - Runtime system for OCaml bytecode executables (no X)
 ocaml-compiler-libs - OCaml interpreter and standard libraries
 ocaml-interp - OCaml interactive interpreter and standard libraries
 ocaml-mode - major mode for editing Objective Caml in Emacs
 ocaml-native-compilers - Native code compilers of the OCaml suite (the .opt ones)
 ocaml-nox  - ML implementation with a class-based object system (no X)
 ocaml-source - Sources for Objective Caml
Closes: 461125 779086 794586
Changes:
 ocaml (4.02.3-1) experimental; urgency=medium
 .
   * New upstream release
     - build and install libasmrun_shared.so (Closes: #461125)
   * Make the ocaml-source binary package reproducible (patch by Chris
     Lamb) (Closes: #779086)
   * Enable ocamldoc to build reproducible manpages (patch by Valentin
     Lorentz) (Closes: #794586)
   * Bump Standards-Version to 3.9.6
Checksums-Sha1:
 690964aee93b554d40136f9761dcfac8f1ad9404 2686 ocaml_4.02.3-1.dsc
 f6b4de2007d9ae825a4db43773456e98d593a767 2058552 ocaml_4.02.3.orig.tar.xz
 263b5ccda8e254e225ec70cd9fdbd59bed51cf0a 44268 ocaml_4.02.3-1.debian.tar.xz
 22989f7e945db42da5f5ee797c68842c828b85b0 538452 ocaml-base-nox_4.02.3-1_amd64.deb
 b0ad2e1053892e27f3d31287fe73552a448e0aa1 132518 ocaml-base_4.02.3-1_amd64.deb
 5ec2368f4a8da2154e7d41441ff6ea61733bb532 9607388 ocaml-compiler-libs_4.02.3-1_amd64.deb
 d799d8f03720cf1931506ff63aeda8c511c76719 360250 ocaml-interp_4.02.3-1_amd64.deb
 168f407414b51b6c968d844ad200a42ca4455238 136338 ocaml-mode_4.02.3-1_all.deb
 4e3f3bf082aec40bb9e0c398f19376c1889eb24c 2546040 ocaml-native-compilers_4.02.3-1_amd64.deb
 fcda6f3d1562ffebf4c14ef10789f10e98397f36 6693896 ocaml-nox_4.02.3-1_amd64.deb
 28fa9b4674363af7dfd4b876a96de2a650365dba 2159008 ocaml-source_4.02.3-1_all.deb
 e4d4a630b82b16270a603b70daa92c31fb8dc141 120302 ocaml_4.02.3-1_amd64.deb
Checksums-Sha256:
 30fbf5c475f0842de9f3d2fac1d3a2a02ee6dc2fea6f167d0fdf7536d2a51cdf 2686 ocaml_4.02.3-1.dsc
 83c6697e135b599a196fd7936eaf8a53dd6b8f3155a796d18407b56f91df9ce3 2058552 ocaml_4.02.3.orig.tar.xz
 6971adb432e74dd09dca94080e3d3d76005aaaa086f59ac3bcdc4c117654d87a 44268 ocaml_4.02.3-1.debian.tar.xz
 a2b499a7479fe59ca1a6b02e3cb2bbfaa4f97a2acad882df87ec6e3040b22779 538452 ocaml-base-nox_4.02.3-1_amd64.deb
 297f04c2f903f8405adef2e10767254ab7ea910f6d74268f092e36306c9ab2d8 132518 ocaml-base_4.02.3-1_amd64.deb
 58c462ae0f50c5e1fa4bc3f88aa5be2291604e8b85502c1b973e8cd6ef38017b 9607388 ocaml-compiler-libs_4.02.3-1_amd64.deb
 e0d95efe598b096f39fc1d4a33e42de9d696b9f42ef199fa738cfa08a10252ee 360250 ocaml-interp_4.02.3-1_amd64.deb
 d1d5238eabf12c79e3c6941a0b052cbb07c82f05f2f4fe3adcd89eb87b354dda 136338 ocaml-mode_4.02.3-1_all.deb
 920c8c200cc9fc549d7bc7536f540005ea3bcce7208a14a9ee141950a0da83dc 2546040 ocaml-native-compilers_4.02.3-1_amd64.deb
 3897419ca60ae738b3cd92b8977b1bca55e3ced4090a3d9a45e7c6808708cd2f 6693896 ocaml-nox_4.02.3-1_amd64.deb
 837579b2635c77e351007391cc2c6b7944098d3cd8b7b9548beecd610ea6e2ec 2159008 ocaml-source_4.02.3-1_all.deb
 cfe5c28a00e88ba6156f59772f19c38271b61a6c4603fc58deb94290b7ade324 120302 ocaml_4.02.3-1_amd64.deb
Files:
 5e9e70796441603ef1439d4da9e4175f 2686 ocaml optional ocaml_4.02.3-1.dsc
 9115706e30dad644f8dec9dfb459a9ab 2058552 ocaml optional ocaml_4.02.3.orig.tar.xz
 c2f1e2ec4f1a021126ba36c88ab35dc5 44268 ocaml optional ocaml_4.02.3-1.debian.tar.xz
 717fc238fa99fe9157cf9d05137f9a8a 538452 ocaml optional ocaml-base-nox_4.02.3-1_amd64.deb
 9a51948edf192ae347ed5aa6d7f5d418 132518 ocaml optional ocaml-base_4.02.3-1_amd64.deb
 f7737ad0c10e04b897850638d41e8daf 9607388 ocaml optional ocaml-compiler-libs_4.02.3-1_amd64.deb
 0b1a5cb69cae11ac840a02c44b9fc551 360250 ocaml optional ocaml-interp_4.02.3-1_amd64.deb
 7df1081cc5dd450b289bdf864ac88783 136338 ocaml optional ocaml-mode_4.02.3-1_all.deb
 ad818ba02dcafbbcd2dca318f1b328a4 2546040 ocaml optional ocaml-native-compilers_4.02.3-1_amd64.deb
 dba83116573c671248f7d5fe1b4de123 6693896 ocaml optional ocaml-nox_4.02.3-1_amd64.deb
 7d71e9d6a72e9edecfb86a0e320e13ed 2159008 ocaml optional ocaml-source_4.02.3-1_all.deb
 71f6d9570f3a82f5e275ec39a4284742 120302 ocaml optional ocaml_4.02.3-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJVzNVvAAoJEHhT2k1JiBrTCL4P/0UNlAe3IG2Yl6JH2qjW1qbb
rOLXisAavx0SsxQdFc28rhI9rbDAiWdygrN9bD8Lw/Nlw1voQI9OE2Bod7pYl3PI
94lop4BT1JD14Ekbek3vj97lsx/auj7vXnEuL9OmyiCyYEGKaDk0jBjvobIceoAF
GTNqvZh9gdgnN6OhBnH4lRJ6eArcdz0P4JS0+NmpSOnqw2qPDd+6xlPECVLAnDip
MRFAQ9Z71TF4+XVhKJ5mupRARsAPVBi8PAhlsWhwmAUPIv/il/DXC6k7F6rdH4zr
njp1N7rMo6jxPjROKbIYIuChGjvBieDOi3SIkftoKM30jZkvveXqL2ymw5CCOstZ
QwmeIhpZdd7jPD2v19QEltcvz6nOeowKiEv+IcZQSeNPYjYwKZFBGAqtNT78O4o5
LD9imkfQCPlP8Wnlx+faPlZXKOFap7SFGHonaJtfm1oF2yMIs6HtToX/4TSVgdn9
aj2SQCewnBvmL76+ilukQArjNTtYQ1Tv7Fmxx3c1J/wvs4GTAVQtVcXmRnJGG+uM
5GpK/kY4zvtLuEi6SF9c3qleUR8OWwZBkP4Hh9ibxk6z83IyAuj1wgm1zFtmSGz8
0VJ2p/bsYY5ueJbYTpyc7JopRTu8lhEONHxz7dMi9khoAHy7zy0mcN633uQ+xCAi
CMFlEf8W6VfX5EqNb4s9
=2QUO
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: