GNU bug report logs - #51693
[patch] Add Java 17

Previous Next

Package: guix;

Reported by: "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>

Date: Mon, 8 Nov 2021 20:35:01 UTC

Severity: normal

Tags: patch

Done: Ricardo Wurmus <rekado <at> elephly.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51693 in the body.
You can then email your comments to 51693 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#51693; Package guix. (Mon, 08 Nov 2021 20:35:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 08 Nov 2021 20:35:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>
To: bug-guix <at> gnu.org
Subject: [patch] Add Java 17
Date: Mon, 08 Nov 2021 21:32:16 +0100
[Message part 1 (text/plain, inline)]
Hi,

the attached patch adds openjdk <at> 17

Take care with updating packages depending on this, because the changes
to the module system can cause runtime failures.

[0001-gnu-openjdk17-add-Java-17.0.1.patch (text/x-patch, inline)]
From 23d8220c78a9ac6aa84dff96fd0c0a1d8214a699 Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <arne_bab <at> web.de>
Date: Mon, 8 Nov 2021 21:21:41 +0100
Subject: [PATCH] gnu: openjdk17: add Java 17.0.1.

* gnu/packages/java.scm (openjdk17): 17.0.1
---
 gnu/packages/java.scm | 46 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index da72dbb38c..34abdcc418 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -2581,6 +2581,52 @@ (define-public openjdk16
                #t))))))
     (home-page "https://openjdk.java.net/projects/jdk/16")))

+(define-public openjdk17
+  (package
+    (inherit openjdk16)
+    (name "openjdk")
+    (version "17.0.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/openjdk/jdk17u")
+                    (commit (string-append "jdk-" version "-ga"))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1l1jgbz8q7zq66npfg88r0l5xga427vrz35iys09j44b6qllrldd"))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("openjdk16:jdk" ,openjdk16 "jdk")
+       ("pkg-config" ,pkg-config)
+       ("unzip" ,unzip)
+       ("which" ,which)
+       ("zip" ,zip)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments openjdk15)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'make-templates-writable
+             (lambda _
+               ;; The build system copies a few .template files from the
+               ;; source directory into the build directory and then modifies
+               ;; them in-place.  So these files have to be writable.
+               (for-each
+                (lambda (file)
+                  (invoke "chmod" "u+w" file))
+                (find-files "src/java.base/share/classes/jdk/internal/misc/"
+                            "\\.template$"))
+               #t))
+           (replace 'fix-java-shebangs
+             (lambda _
+               ;; This file was "fixed" by patch-source-shebangs, but it requires
+               ;; this exact first line.
+               (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
+                 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))
+               #t))
+           ))))
+    (home-page "https://openjdk.java.net/projects/jdk/17")))
+
 (define-public icedtea icedtea-8)

 
--
2.33.1

[Message part 3 (text/plain, inline)]

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#51693; Package guix. (Sun, 14 Nov 2021 15:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 51693 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>
Cc: 51693 <at> debbugs.gnu.org
Subject: Re: bug#51693: [patch] Add Java 17
Date: Sun, 14 Nov 2021 16:54:07 +0100
Le Mon, 08 Nov 2021 21:32:16 +0100,
"Dr. Arne Babenhauserheide" <arne_bab <at> web.de> a écrit :

> Hi,
> 
> the attached patch adds openjdk <at> 17
> 
> Take care with updating packages depending on this, because the
> changes to the module system can cause runtime failures.
> 

Hi!

sorry for the delay. I tried your patch, but the build fails for me
because it goes "out of file descriptors" and "unix resources". Does it
work for you? I tried with various levels of parallelism, but it did not
change anything.

also about your patch, could you replace (invoke "chmod" "u+w" file)
with a call to make-writable? It's available by default in the build
environment, it comes from (guix build utils). I wonder also why you
inherit arguments from openjdk15 instead of openjdk16?

Thanks!




Information forwarded to bug-guix <at> gnu.org:
bug#51693; Package guix. (Sun, 14 Nov 2021 22:46:01 GMT) Full text and rfc822 format available.

Message #11 received at 51693 <at> debbugs.gnu.org (full text, mbox):

From: "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 51693 <at> debbugs.gnu.org
Subject: Re: bug#51693: [patch] Add Java 17
Date: Sun, 14 Nov 2021 21:59:44 +0100
[Message part 1 (text/plain, inline)]
Julien Lepiller <julien <at> lepiller.eu> writes:

> Le Mon, 08 Nov 2021 21:32:16 +0100,
> "Dr. Arne Babenhauserheide" <arne_bab <at> web.de> a écrit :
>
>> the attached patch adds openjdk <at> 17
>> 
>> Take care with updating packages depending on this, because the
>> changes to the module system can cause runtime failures.

> sorry for the delay.

No problems — thank you for checking my patch!

> I tried your patch, but the build fails for me
> because it goes "out of file descriptors" and "unix resources". Does it
> work for you?

It works for me, yes.

./pre-inst-env guix environment --ad-hoc openjdk <at> 17:jdk -- java -version
…
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment (build 17.0.1+0-adhoc..source)
OpenJDK 64-Bit Server VM (build 17.0.1+0-adhoc..source, mixed mode, sharing)

> I tried with various levels of parallelism, but it did not
> change anything.
>
> also about your patch, could you replace (invoke "chmod" "u+w" file)
> with a call to make-writable?

Do you mean `make-file-writable` ? I switched to that now.

> It's available by default in the build
> environment, it comes from (guix build utils). I wonder also why you
> inherit arguments from openjdk15 instead of openjdk16?

That was a mistake — thank you!

I attached a new patch.

[0001-gnu-openjdk17-add-Java-17.0.1.patch (text/x-patch, inline)]
From 5d9d3e96163798fe9b8146f134e47311b4e0ac77 Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <arne_bab <at> web.de>
Date: Mon, 8 Nov 2021 21:21:41 +0100
Subject: [PATCH] gnu: openjdk17: add Java 17.0.1.

* gnu/packages/java.scm (openjdk17): 17.0.1

Thanks to Julien Lepiller for feedback!
---
 gnu/packages/java.scm | 48 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 46 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index da72dbb38c..b62d730fc4 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -2566,6 +2566,42 @@ (define-public openjdk16
        ("zip" ,zip)))
     (arguments
      (substitute-keyword-arguments (package-arguments openjdk15)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'make-templates-writable
+             (lambda _
+               ;; The build system copies a few .template files from the
+               ;; source directory into the build directory and then modifies
+               ;; them in-place.  So these files have to be writable.
+               (for-each make-file-writable
+                (find-files "src/java.base/share/classes/jdk/internal/misc/"
+                            "\\.template$"))
+               #t))))))
+    (home-page "https://openjdk.java.net/projects/jdk/16")))
+
+(define-public openjdk17
+  (package
+    (inherit openjdk16)
+    (name "openjdk")
+    (version "17.0.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/openjdk/jdk17u")
+                    (commit (string-append "jdk-" version "-ga"))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1l1jgbz8q7zq66npfg88r0l5xga427vrz35iys09j44b6qllrldd"))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("openjdk16:jdk" ,openjdk16 "jdk")
+       ("pkg-config" ,pkg-config)
+       ("unzip" ,unzip)
+       ("which" ,which)
+       ("zip" ,zip)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments openjdk16)
        ((#:phases phases)
         `(modify-phases ,phases
            (add-after 'unpack 'make-templates-writable
@@ -2578,8 +2614,16 @@ (define-public openjdk16
                   (invoke "chmod" "u+w" file))
                 (find-files "src/java.base/share/classes/jdk/internal/misc/"
                             "\\.template$"))
-               #t))))))
-    (home-page "https://openjdk.java.net/projects/jdk/16")))
+               #t))
+           (replace 'fix-java-shebangs
+             (lambda _
+               ;; This file was "fixed" by patch-source-shebangs, but it requires
+               ;; this exact first line.
+               (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
+                 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))
+               #t))
+           ))))
+    (home-page "https://openjdk.java.net/projects/jdk/17")))
 
 (define-public icedtea icedtea-8)
 
-- 
2.33.1

[Message part 3 (text/plain, inline)]
Liebe Grüße,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#51693; Package guix. (Mon, 15 Nov 2021 13:00:02 GMT) Full text and rfc822 format available.

Message #14 received at 51693 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>
Cc: 51693 <at> debbugs.gnu.org
Subject: Re: bug#51693: [patch] Add Java 17
Date: Mon, 15 Nov 2021 13:59:12 +0100
Hi, I think you fixed openjdk16 instead of openjdk17, this makes the
patch a bit confusing to read.

Le Sun, 14 Nov 2021 21:59:44 +0100,
"Dr. Arne Babenhauserheide" <arne_bab <at> web.de> a écrit :

> Julien Lepiller <julien <at> lepiller.eu> writes:
> 
> > Le Mon, 08 Nov 2021 21:32:16 +0100,
> > "Dr. Arne Babenhauserheide" <arne_bab <at> web.de> a écrit :
> >  
> >> the attached patch adds openjdk <at> 17
> >> 
> >> Take care with updating packages depending on this, because the
> >> changes to the module system can cause runtime failures.  
> 
> > sorry for the delay.  
> 
> No problems — thank you for checking my patch!
> 
> > I tried your patch, but the build fails for me
> > because it goes "out of file descriptors" and "unix resources".
> > Does it work for you?  
> 
> It works for me, yes.
> 
> ./pre-inst-env guix environment --ad-hoc openjdk <at> 17:jdk -- java
> -version …
> openjdk version "17.0.1" 2021-10-19
> OpenJDK Runtime Environment (build 17.0.1+0-adhoc..source)
> OpenJDK 64-Bit Server VM (build 17.0.1+0-adhoc..source, mixed mode,
> sharing)
> 
> > I tried with various levels of parallelism, but it did not
> > change anything.
> >
> > also about your patch, could you replace (invoke "chmod" "u+w" file)
> > with a call to make-writable?  
> 
> Do you mean `make-file-writable` ? I switched to that now.
> 
> > It's available by default in the build
> > environment, it comes from (guix build utils). I wonder also why you
> > inherit arguments from openjdk15 instead of openjdk16?  
> 
> That was a mistake — thank you!
> 
> I attached a new patch.
> 





Information forwarded to bug-guix <at> gnu.org:
bug#51693; Package guix. (Mon, 15 Nov 2021 14:09:01 GMT) Full text and rfc822 format available.

Message #17 received at 51693 <at> debbugs.gnu.org (full text, mbox):

From: "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 51693 <at> debbugs.gnu.org
Subject: Re: bug#51693: [patch] Add Java 17
Date: Mon, 15 Nov 2021 15:00:59 +0100
[Message part 1 (text/plain, inline)]
Hi,

Julien Lepiller <julien <at> lepiller.eu> writes:

> Hi, I think you fixed openjdk16 instead of openjdk17, this makes the
> patch a bit confusing to read.

I didn’t fix openjdk16, it’s just the change detection in git that makes
it look like that because there are unchanged lines in-between.

I wish I could make that better, but git just doesn’t understand the
semantics of the code, so it does not recognize the unchanged end of the
openjdk16 block and instead things that my insertion of openjdk17 is a
modification of the end of openjdk16 plus insertion of the start of
openjdk17.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
[signature.asc (application/pgp-signature, inline)]

Reply sent to Ricardo Wurmus <rekado <at> elephly.net>:
You have taken responsibility. (Thu, 02 Dec 2021 23:03:01 GMT) Full text and rfc822 format available.

Notification sent to "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>:
bug acknowledged by developer. (Thu, 02 Dec 2021 23:03:01 GMT) Full text and rfc822 format available.

Message #22 received at 51693-done <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 51693-done <at> debbugs.gnu.org
Cc: "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>
Subject: [patch] Add Java 17
Date: Thu, 02 Dec 2021 22:58:29 +0000
I split it up into a commit fixing openjdk 16 and one adding openjdk 17;
I removed a duplicate phase from openjdk 17 and let it inherit the phases from openjdk 16.

I’ve applied the patches to the “master” branch.

Thanks!

-- 
Ricardo




Information forwarded to bug-guix <at> gnu.org:
bug#51693; Package guix. (Fri, 03 Dec 2021 07:51:02 GMT) Full text and rfc822 format available.

Message #25 received at 51693-done <at> debbugs.gnu.org (full text, mbox):

From: "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 51693-done <at> debbugs.gnu.org
Subject: Re: [patch] Add Java 17
Date: Fri, 03 Dec 2021 08:49:57 +0100
[Message part 1 (text/plain, inline)]
Ricardo Wurmus <rekado <at> elephly.net> writes:

> I split it up into a commit fixing openjdk 16 and one adding openjdk 17;
> I removed a duplicate phase from openjdk 17 and let it inherit the phases from openjdk 16.
>
> I’ve applied the patches to the “master” branch.

Very cool! Thank you!

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 31 Dec 2021 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 117 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.