[PATCH] gnu: icedtea-6: Make javadoc reproducible.

OpenSubmitted by Gábor Boskovits.
Details
5 participants
  • Gábor Boskovits
  • Danny Milosavljevic
  • Kei Kebreau
  • Maxim Cournoyer
  • Ricardo Wurmus
Owner
unassigned
Severity
normal
G
G
Gábor Boskovits wrote on 14 Oct 2018 21:06
(address . guix-patches@gnu.org)(name . Gábor Boskovits)(address . boskovits@gmail.com)
20181014190655.23754-1-boskovits@gmail.com
* gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch: New file.
* gnu/packages/java.scm[icedtea-6](native-inputs): Add patch to langtools-src.
(phases)[unpack]: Adjust unpacking of patched source.
* gnu/local.mk[dist_patch_DATA]: Register it.
---
gnu/local.mk | 1 +
gnu/packages/java.scm | 10 ++++---
.../icedtea-6-javadoc-reproducibility.patch | 26 +++++++++++++++++++
3 files changed, 34 insertions(+), 3 deletions(-)
create mode 100644 gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch

Toggle diff (76 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index c3bc35a80..6e332b041 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -807,6 +807,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/icecat-use-system-graphite2.patch	\
   %D%/packages/patches/icecat-use-system-harfbuzz.patch		\
   %D%/packages/patches/icedtea-6-hotspot-gcc-segfault-workaround.patch  \
+  %D%/packages/patches/icedtea-6-javadoc-reproducibility.patch	\
   %D%/packages/patches/icedtea-7-hotspot-gcc-segfault-workaround.patch  \
   %D%/packages/patches/id3lib-CVE-2007-4460.patch			\
   %D%/packages/patches/ilmbase-fix-tests.patch			\
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index d2f4c9d05..ab9e3fd3a 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -734,10 +734,12 @@ machine.")))
                                        (string-append part "-src"))
                             part))
                          '("jdk" "corba"
-                           "langtools" "jaxp" "jaxws")))
+                           "jaxp" "jaxws")))
              (with-directory-excursion "openjdk"
                (invoke "tar" "xvf" (assoc-ref inputs "hotspot-src"))
-               (rename-file "hg-checkout" "hotspot"))
+               (rename-file "hg-checkout" "hotspot")
+               (invoke "tar" "xvf" (assoc-ref inputs "langtools-src"))
+               (rename-file "hg-checkout" "langtools"))
              (substitute* "Makefile.in"
                (("echo \"ERROR: No up-to-date OpenJDK zip available\"; exit -1;")
                 "echo \"trust me\";")
@@ -976,7 +978,9 @@ machine.")))
                  (changeset "jdk6-b41")))
            (sha256
             (base32
-             "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))))
+             "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))
+           (patches
+            (search-patches "icedtea-6-javadoc-reproducibility.patch"))))
        ("jaxp-src"
         ,(origin
            (method hg-fetch)
diff --git a/gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch b/gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch
new file mode 100644
index 000000000..d4c8a97f3
--- /dev/null
+++ b/gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch
@@ -0,0 +1,26 @@
+# HG changeset patch
+# User Gábor Boskovits <boskovits@gmail.com>
+# Date 1539456874 -7200
+#      Sat Oct 13 20:54:34 2018 +0200
+# Node ID 6e5f716a659247888c104f66c58bf40fb959c8a4
+# Parent  06656286f572cbf716397b9d983f8dee7d94f913
+Make javadoc respect SOURCE_DATE_EPOCH.
+
+diff -r 06656286f572 -r 6e5f716a6592 src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
+--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Mon Aug 22 10:53:55 2016 -0700
++++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Sat Oct 13 20:54:34 2018 +0200
+@@ -396,6 +396,13 @@
+      */
+     public String today() {
+         Calendar calendar = new GregorianCalendar(TimeZone.getDefault());
+-        return calendar.getTime().toString();
++	Date date=calendar.getTime();
++	Map<String,String> env = System.getenv();
++	if(env.containsKey("SOURCE_DATE_EPOCH")) {
++	    String epoch=env.get("SOURCE_DATE_EPOCH");
++	    long unixtime=Long.parseLong(epoch);
++	    date=new Date(unixtime*1000L);
++	}
++        return date.toString();
+     }
+ }
-- 
2.18.0
D
D
Danny Milosavljevic wrote on 17 Oct 2018 09:58
(name . Gábor Boskovits)(address . boskovits@gmail.com)(address . 33041@debbugs.gnu.org)
20181017095811.51bdc62e@scratchpost.org
Hi Gabor,

On Sun, 14 Oct 2018 21:06:55 +0200
Gábor Boskovits <boskovits@gmail.com> wrote:

Toggle quote (19 lines)
> +diff -r 06656286f572 -r 6e5f716a6592 src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
> +--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Mon Aug 22 10:53:55 2016 -0700
> ++++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Sat Oct 13 20:54:34 2018 +0200
> +@@ -396,6 +396,13 @@
> + */
> + public String today() {
> + Calendar calendar = new GregorianCalendar(TimeZone.getDefault());
> +- return calendar.getTime().toString();
> ++ Date date=calendar.getTime();
> ++ Map<String,String> env = System.getenv();
> ++ if(env.containsKey("SOURCE_DATE_EPOCH")) {
> ++ String epoch=env.get("SOURCE_DATE_EPOCH");
> ++ long unixtime=Long.parseLong(epoch);
> ++ date=new Date(unixtime*1000L);
> ++ }
> ++ return date.toString();
> + }
> + }

Indentation is off.

Also, why not System.getenv("SOURCE_DATE_EPOCH") and check for null? Not that important, though.

Otherwise LGTM!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlvG65MACgkQ5xo1VCww
uqXlzQf/WbFKpipNSzy1TNt+Mtn7vJo4fTIqZ5bmpkGjK2IzE28PklIld4KFnHBJ
WHW3Rpj22V2FyekhyVZ++KPhLteYjiF9Gh1pXkHr7+w7SJz3UFNwdbAFWCvesw+s
/a5jyJ9O0+xvhrwOdCce74a35Hj/dD7jpZPHL7MDfB+MSjPADMsM8yjNLgjuXs92
orFjWYT70nyzDqZBX70AOE3AXEFTOlo6mCmxew7J6+Rzt29b3W3N03WQVhXWBV2k
SI8SXzI3Bav4eMPR5Xe9x/djQgRq6VcQSiuU7tLLR6WFKMrPDVFZSOxWIu33XnZX
ihHwvn/U1mF+qQkM2he1q4b6jNHrOA==
=/B1x
-----END PGP SIGNATURE-----


R
R
Ricardo Wurmus wrote on 14 May 2020 19:58
[PATCH] gnu: icedtea-6: Make javadoc reproducible.
(address . 33041@debbugs.gnu.org)(name . Gábor Boskovits)(address . boskovits@gmail.com)
87h7wiiejl.fsf@elephly.net
Hi Gábor,

looks like we dropped this issue. Would you like to rebase it, include
Danny’s suggestions, and push it? I’d very much like to close bug #30927.

--
Ricardo
G
G
Gábor Boskovits wrote on 14 May 2020 20:22
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 33041@debbugs.gnu.org)
CAE4v=pj9q3=C7+X8DEok6ThX25VBAYnYc+O46-Q2YV43NRVTvQ@mail.gmail.com
Ok, I will look into it.

Ricardo Wurmus <rekado@elephly.net> ezt írta (időpont: 2020. máj. 14., Csü
19:59):

Toggle quote (8 lines)
> Hi Gábor,
>
> looks like we dropped this issue. Would you like to rebase it, include
> Danny’s suggestions, and push it? I’d very much like to close bug #30927.
>
> --
> Ricardo
>
Attachment: file
K
K
Kei Kebreau wrote on 10 Dec 2020 22:31
Re: [bug#33041] [PATCH] gnu: icedtea-6: Make javadoc reproducible.
(name . Gábor Boskovits)(address . boskovits@gmail.com)
87o8j1xs96.fsf@posteo.net
Hi all,

I came across this bug and had some time to attempt to make the
suggested changes. Please find the updated patch attached and let me
know if it still works as intended.

Best,
Kei
From e3bc8635e8730e33c2e4f9658dacb6f2f669d8bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= <boskovits@gmail.com>
Date: Sun, 14 Oct 2018 21:06:55 +0200
Subject: [PATCH] gnu: icedtea-6: Make javadoc reproducible.

* gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch: New file.
* gnu/packages/java.scm[icedtea-6](native-inputs): Add patch to langtools-src.
(phases)[unpack]: Adjust unpacking of patched source.
* gnu/local.mk[dist_patch_DATA]: Register it.
---
gnu/local.mk | 1 +
gnu/packages/java.scm | 9 +++++--
.../icedtea-6-javadoc-reproducibility.patch | 25 +++++++++++++++++++
3 files changed, 33 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch

Toggle diff (72 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 9284e487fe..9a1b98eb16 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1169,6 +1169,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/icecat-use-system-graphite2+harfbuzz.patch	\
   %D%/packages/patches/icecat-use-system-media-libs.patch	\
   %D%/packages/patches/icedtea-6-extend-hotspot-aarch64-support.patch	\
+  %D%/packages/patches/icedtea-6-javadoc-reproducibility.patch	\
   %D%/packages/patches/icedtea-7-hotspot-aarch64-use-c++98.patch	\
   %D%/packages/patches/icu4c-CVE-2020-10531.patch  		\
   %D%/packages/patches/id3lib-CVE-2007-4460.patch			\
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index e298fd9537..deaa9e1fcd 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -892,7 +892,10 @@ machine.")))
                                        (string-append part "-src"))
                             part))
                          '("jdk" "hotspot" "corba"
-                           "langtools" "jaxp" "jaxws")))
+                           "jaxp" "jaxws")))
+             (with-directory-excursion "openjdk"
+               (invoke "tar" "xvf" (assoc-ref inputs "langtools-src"))
+               (rename-file "hg-checkout" "langtools"))
              (substitute* "patches/freetypeversion.patch"
                (("REQUIRED_FREETYPE_VERSION = 2.2.1")
                 "REQUIRED_FREETYPE_VERSION = 2.10.1"))
@@ -1136,7 +1139,9 @@ machine.")))
                  (changeset "jdk6-b41")))
            (sha256
             (base32
-             "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))))
+             "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))
+           (patches
+            (search-patches "icedtea-6-javadoc-reproducibility.patch"))))
        ("jaxp-src"
         ,(origin
            (method hg-fetch)
diff --git a/gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch b/gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch
new file mode 100644
index 0000000000..dd472a9c66
--- /dev/null
+++ b/gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch
@@ -0,0 +1,25 @@
+# HG changeset patch
+# User Gábor Boskovits <boskovits@gmail.com>
+# Date 1539456874 -7200
+#      Sat Oct 13 20:54:34 2018 +0200
+# Node ID 6e5f716a659247888c104f66c58bf40fb959c8a4
+# Parent  06656286f572cbf716397b9d983f8dee7d94f913
+Make javadoc respect SOURCE_DATE_EPOCH.
+
+diff -r 06656286f572 src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
+--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Mon Aug 22 10:53:55 2016 -0700
++++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Wed Dec 09 21:40:00 2020 -0500
+@@ -396,6 +396,12 @@
+      */
+     public String today() {
+         Calendar calendar = new GregorianCalendar(TimeZone.getDefault());
+-        return calendar.getTime().toString();
++        Date date=calendar.getTime();
++        String epoch=System.getenv("SOURCE_DATE_EPOCH");
++        if(epoch != null) {
++            long unixtime=Long.parseLong(epoch);
++            date=new Date(unixtime*1000L);
++	}
++	return date.toString();
+     }
+ }
-- 
2.29.2
Gábor Boskovits <boskovits@gmail.com> writes:

Toggle quote (11 lines)
> Ok, I will look into it.
>
> Ricardo Wurmus <rekado@elephly.net> ezt írta (időpont: 2020. máj. 14., Csü 19:59):
>
> Hi Gábor,
>
> looks like we dropped this issue. Would you like to rebase it, include
> Danny’s suggestions, and push it? I’d very much like to close bug #30927.
>
> --
> Ricardo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEg7ZwOtzKO2lLzi2m5qXuPBlGeg0FAl/Sk7UACgkQ5qXuPBlG
eg2qahAAqcafzd2Z8omf/kTKqZiBOAgfxaSKALXmbKpSfF8rRlsc92V0bLidijBn
tuDkmt0wfBAzJABxiC7kiBgZomxvgL2FwJipJTnPXXrkIA/qa/Gf37aNRhWNQVBl
X7bGMc4HEeDvcA7OX8hfICdioEZY1HnADbA6iPymic+dqBLoEFK41WSDA4Yjzc+x
vKvAf5rx2HMZ/liPtihAMb/a0keji3jSPA8kbWgJ0IBqv7nvbb2WOkyL65v7hcBt
H2qpkglZnOqFJaQ8ZZiuFy6rm/4qvGg/Qp7xWKZYuLoB1RQLByJWnyhIolXlNB3l
65n9phOH5LReCUYJqCwe6GK1AQiwSBVS/3pxgldpJ1Ajhy3eXU0E+PhWIbsCCPik
EaY45sfOUxyXCORoPayeNaKkNW+bqixqPdY+jFREW0nlHIzyomiJ2e7yR+Wv8rQy
0cnPTGgZ1tMIvi7HYbRYF+HRATdkFhFKMAGe+kA+A4N7VgLv6zLFO6H1IUB3j8fA
GflwWye8ZjV964Y/kZQ1yZI0pIFl5h7c4LvE/93wpvftlgc8L01HNsWVFLKq/Y2q
PSlak5Kj/dpnrFGTM8e7vIaK2b993vkna5/yxwJSTYiD78VuJKJml/i1TM3q1Tlo
Jk/aa64iUjE7m8Vnk7idiTSbHDdH49zxjp3cWoymyhsDb61T6Yw=
=JWeO
-----END PGP SIGNATURE-----

M
M
Maxim Cournoyer wrote on 14 Jul 2021 15:34
Re: bug#33041: [PATCH] gnu: icedtea-6: Make javadoc reproducible.
(name . Kei Kebreau)(address . kkebreau@posteo.net)
871r81ow7j.fsf_-_@gmail.com
Hi,

Kei Kebreau <kkebreau@posteo.net> writes:

Toggle quote (6 lines)
> Hi all,
>
> I came across this bug and had some time to attempt to make the
> suggested changes. Please find the updated patch attached and let me
> know if it still works as intended.

[...]

Toggle quote (59 lines)
> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
> index e298fd9537..deaa9e1fcd 100644
> --- a/gnu/packages/java.scm
> +++ b/gnu/packages/java.scm
> @@ -892,7 +892,10 @@ machine.")))
> (string-append part "-src"))
> part))
> '("jdk" "hotspot" "corba"
> - "langtools" "jaxp" "jaxws")))
> + "jaxp" "jaxws")))
> + (with-directory-excursion "openjdk"
> + (invoke "tar" "xvf" (assoc-ref inputs "langtools-src"))
> + (rename-file "hg-checkout" "langtools"))
> (substitute* "patches/freetypeversion.patch"
> (("REQUIRED_FREETYPE_VERSION = 2.2.1")
> "REQUIRED_FREETYPE_VERSION = 2.10.1"))
> @@ -1136,7 +1139,9 @@ machine.")))
> (changeset "jdk6-b41")))
> (sha256
> (base32
> - "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))))
> + "1x52wd67fynbbd9ild6fb4wvba3f5hhwk03qdjfazd0a1qr37z3d"))
> + (patches
> + (search-patches "icedtea-6-javadoc-reproducibility.patch"))))
> ("jaxp-src"
> ,(origin
> (method hg-fetch)
> diff --git a/gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch b/gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch
> new file mode 100644
> index 0000000000..dd472a9c66
> --- /dev/null
> +++ b/gnu/packages/patches/icedtea-6-javadoc-reproducibility.patch
> @@ -0,0 +1,25 @@
> +# HG changeset patch
> +# User Gábor Boskovits <boskovits@gmail.com>
> +# Date 1539456874 -7200
> +# Sat Oct 13 20:54:34 2018 +0200
> +# Node ID 6e5f716a659247888c104f66c58bf40fb959c8a4
> +# Parent 06656286f572cbf716397b9d983f8dee7d94f913
> +Make javadoc respect SOURCE_DATE_EPOCH.
> +
> +diff -r 06656286f572 src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
> +--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Mon Aug 22 10:53:55 2016 -0700
> ++++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Wed Dec 09 21:40:00 2020 -0500
> +@@ -396,6 +396,12 @@
> + */
> + public String today() {
> + Calendar calendar = new GregorianCalendar(TimeZone.getDefault());
> +- return calendar.getTime().toString();
> ++ Date date=calendar.getTime();
> ++ String epoch=System.getenv("SOURCE_DATE_EPOCH");
> ++ if(epoch != null) {
> ++ long unixtime=Long.parseLong(epoch);
> ++ date=new Date(unixtime*1000L);
> ++ }
> ++ return date.toString();
> + }
> + }

I tried this patch but it didn't work for me:

Toggle snippet (27 lines)
diff -r /gnu/store/394r3dq5q2kmxddwcbh4wwnxmlp0b2rs-icedtea-1.13.13-doc/share/doc/icedtea/api/org/omg/PortableServer/POAPackage/WrongPolicyHelper.html /gnu/store/394r3dq5q2kmxddwcbh4wwnxmlp0b2rs-icedtea-1.13.13-doc-check/share/doc/icedtea/api/org/omg/PortableServer/POAPackage/WrongPolicyHelper.html
116c116
< Wednesday, July 14, 2021 12:30:23 AM GMT</div>
---
> Wednesday, July 14, 2021 12:14:11 AM GMT</div>
diff -r /gnu/store/394r3dq5q2kmxddwcbh4wwnxmlp0b2rs-icedtea-1.13.13-doc/share/doc/icedtea/api/org/omg/PortableServer/POAPackage/WrongPolicy.html /gnu/store/394r3dq5q2kmxddwcbh4wwnxmlp0b2rs-icedtea-1.13.13-doc-check/share/doc/icedtea/api/org/omg/PortableServer/POAPackage/WrongPolicy.html
129c129
< Wednesday, July 14, 2021 12:30:23 AM GMT</div>
---
> Wednesday, July 14, 2021 12:14:11 AM GMT</div>
diff -r /gnu/store/394r3dq5q2kmxddwcbh4wwnxmlp0b2rs-icedtea-1.13.13-doc/share/doc/icedtea/api/org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.html /gnu/store/394r3dq5q2kmxddwcbh4wwnxmlp0b2rs-icedtea-1.13.13-doc-check/share/doc/icedtea/api/org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.html
102c102
< Wednesday, July 14, 2021 12:30:23 AM GMT</div>
---
> Wednesday, July 14, 2021 12:14:11 AM GMT</div>
diff -r /gnu/store/394r3dq5q2kmxddwcbh4wwnxmlp0b2rs-icedtea-1.13.13-doc/share/doc/icedtea/api/org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.html /gnu/store/394r3dq5q2kmxddwcbh4wwnxmlp0b2rs-icedtea-1.13.13-doc-check/share/doc/icedtea/api/org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.html
102c102
< Wednesday, July 14, 2021 12:30:23 AM GMT</div>
---
> Wednesday, July 14, 2021 12:14:11 AM GMT</div>
diff -r /gnu/store/394r3dq5q2kmxddwcbh4wwnxmlp0b2rs-icedtea-1.13.13-doc/share/doc/icedtea/api/org/omg/PortableServer/THREAD_POLICY_ID.html /gnu/store/394r3dq5q2kmxddwcbh4wwnxmlp0b2rs-icedtea-1.13.13-doc-check/share/doc/icedtea/api/org/omg/PortableServer/THREAD_POLICY_ID.html
102c102
< Wednesday, July 14, 2021 12:30:23 AM GMT</div>
---
> Wednesday, July 14, 2021 12:14:11 AM GMT</div>

Could you retest it to validate it's working as expected?

Thank you,

Maxim
M
M
Maxim Cournoyer wrote on 14 Jul 2021 15:34
control message for bug #33041
(address . control@debbugs.gnu.org)
87zgupnhmt.fsf@gmail.com
tags 33041 + moreinfo
quit
?