[PATCH] gnu: Add openjdk18.

OpenSubmitted by Rostislav Svoboda.
Details
4 participants
  • Björn Höfling
  • Julien Lepiller
  • Maxime Devos
  • Rostislav Svoboda
Owner
unassigned
Severity
normal
R
R
Rostislav Svoboda wrote on 11 Apr 14:53 +0200
(address . guix-patches@gnu.org)(name . Rostislav Svoboda)(address . Rostislav.Svoboda@gmail.com)
20220411125335.4047-1-Rostislav.Svoboda@gmail.com
---
gnu/packages/java.scm | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)

Toggle diff (46 lines)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 6738b5dc35..10c84d2973 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -2263,6 +2263,39 @@ (define-public openjdk17
                  (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))
     (home-page "https://openjdk.java.net/projects/jdk/17")))
 
+(define-public openjdk18
+  (package
+    (inherit openjdk17)
+    (name "openjdk")
+    (version "18")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/openjdk/jdk18u")
+                    (commit (string-append "jdk-" version "-ga"))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1bv6bdhkmwvn10l0xy8yi9xibds640hs5zsvx0jp7wrxa3qw4qy8"))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("openjdk17:jdk" ,openjdk17 "jdk")
+       ("pkg-config" ,pkg-config)
+       ("unzip" ,unzip)
+       ("which" ,which)
+       ("zip" ,zip)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments openjdk16)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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"))))))))
+    (home-page "https://openjdk.java.net/projects/jdk/18")))
+
 (define-public icedtea icedtea-8)
 
 
-- 
2.35.1
M
M
Maxime Devos wrote on 11 Apr 15:43 +0200
e781bf550c921f40077881903271a6e09d01837f.camel@telenet.be
Rostislav Svoboda schreef op ma 11-04-2022 om 14:53 [+0200]:
Toggle quote (4 lines)
> +    (native-inputs
> +     `(("autoconf" ,autoconf)
> +       ("openjdk17:jdk" ,openjdk17 "jdk")

Does it need openjdk17 to build, or would openjdk16 suffice?
That would avoid increasing the bootstrap chain length.

Greetings,
MAxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYlQwcBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qzUAQC7Th1Mm2AiDgIiKKm7vnvfRyQr
2hE3698rqHQwH+ZQkAD/chhD3g9c/oPm3KeB63WAQDY3Ntqi5rseytBtAC3EYQ8=
=JLzp
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 11 Apr 15:44 +0200
a9a9a72c96edccc26d7f7c4df09f5b12d5daec8a.camel@telenet.be
Rostislav Svoboda schreef op ma 11-04-2022 om 14:53 [+0200]:
Toggle quote (11 lines)
> +    (arguments
> +     (substitute-keyword-arguments (package-arguments openjdk16)
> +       ((#:phases phases)
> +        `(modify-phases ,phases
> +           (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"))))))))

Why is this duplicated? It is exactly the same phase as for openjdk17,
so inherit should take care of it.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYlQwxBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sazAQCB36oMFOg8JWudeEclu9vkeQyS
SdTuLgZY6gb56BIjUAEAqKiYOjuy4VpCRjtUAlm+9hxnKN/Ggb0Xv9eDTHwYewM=
=DLrE
-----END PGP SIGNATURE-----


J
J
Julien Lepiller wrote on 11 Apr 16:15 +0200
0A4C69EF-B0AA-4B99-AFC5-44C6602E7305@lepiller.eu
Hi!

The patch looks great, but I wonder why you need to change che phases to tomething that looks like openjdk 17's phases? Am I missing something? Wouldn't it work without any change to the arguments?

I can't build and test because of my limited bandwidth. Hopefully another maintainer can rur the tests and maybe push if my issues aren't solved soon…

On April 11, 2022 2:53:35 PM GMT+02:00, Rostislav Svoboda <rostislav.svoboda@gmail.com> wrote:
Toggle quote (54 lines)
>---
> gnu/packages/java.scm | 33 +++++++++++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
>diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
>index 6738b5dc35..10c84d2973 100644
>--- a/gnu/packages/java.scm
>+++ b/gnu/packages/java.scm
>@@ -2263,6 +2263,39 @@ (define-public openjdk17
> (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))
> (home-page "https://openjdk.java.net/projects/jdk/17")))
>
>+(define-public openjdk18
>+ (package
>+ (inherit openjdk17)
>+ (name "openjdk")
>+ (version "18")
>+ (source (origin
>+ (method git-fetch)
>+ (uri (git-reference
>+ (url "https://github.com/openjdk/jdk18u")
>+ (commit (string-append "jdk-" version "-ga"))))
>+ (file-name (git-file-name name version))
>+ (sha256
>+ (base32
>+ "1bv6bdhkmwvn10l0xy8yi9xibds640hs5zsvx0jp7wrxa3qw4qy8"))))
>+ (native-inputs
>+ `(("autoconf" ,autoconf)
>+ ("openjdk17:jdk" ,openjdk17 "jdk")
>+ ("pkg-config" ,pkg-config)
>+ ("unzip" ,unzip)
>+ ("which" ,which)
>+ ("zip" ,zip)))
>+ (arguments
>+ (substitute-keyword-arguments (package-arguments openjdk16)
>+ ((#:phases phases)
>+ `(modify-phases ,phases
>+ (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"))))))))
>+ (home-page "https://openjdk.java.net/projects/jdk/18")))
>+
> (define-public icedtea icedtea-8)
>
> >
>--
>2.35.1
>
>
>
>
Attachment: file
R
R
Rostislav Svoboda wrote on 12 Apr 15:03 +0200
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 54852@debbugs.gnu.org)
CAEtmmezw36LEg-K+098qJNPXooxi40F+TaqcP7VV45AB8z_jxg@mail.gmail.com
Toggle quote (8 lines)
> Rostislav Svoboda schreef op ma 11-04-2022 om 14:53 [+0200]:
> > + (native-inputs
> > + `(("autoconf" ,autoconf)
> > + ("openjdk17:jdk" ,openjdk17 "jdk")
>
> Does it need openjdk17 to build, or would openjdk16 suffice?
> That would avoid increasing the bootstrap chain length.

Having
("openjdk16:jdk" ,openjdk16 "jdk")

leads to:

configure: Found potential Boot JDK using java(c) in PATH
configure: Potential Boot JDK found at
/gnu/store/j9lyv24nkwgznddiqfv29j2czfn15a9b-openjdk-16.0.1-jdk is
incorrect JDK version (openjdk version "16.0.1" 2021-04-20 OpenJDK
Runtime Environment (build 16.0.1+0-adhoc..source) OpenJDK 64-Bit
Server VM (build 16.0.1+0-adhoc..source, mixed mode, sharing));
ignoring
configure: (Your Boot JDK version must be one of: 17 18)
configure: Could not find a valid Boot JDK. OpenJDK distributions are
configure: This might be fixed by explicitly setting --with-boot-jdk
configure: error: Cannot continue

Cheers
Bost
R
R
Rostislav Svoboda wrote on 12 Apr 15:24 +0200
(address . 54852@debbugs.gnu.org)
CAEtmmezbF7sKtaWTKjfO+7V2nE1yLkAdAV6UKomtce_69Q=RnQ@mail.gmail.com
Le lun. 11 avr. 2022 à 15:44, Maxime Devos <maximedevos@telenet.be> a écrit :
Toggle quote (14 lines)
> > + (arguments
> > + (substitute-keyword-arguments (package-arguments openjdk16)
> > + ((#:phases phases)
> > + `(modify-phases ,phases
> > + (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"))))))))
>
> Why is this duplicated? It is exactly the same phase as for openjdk17,
> so inherit should take care of it.

Le lun. 11 avr. 2022 à 16:16, Julien Lepiller <julien@lepiller.eu> a écrit :
Toggle quote (2 lines)
> The patch looks great, but I wonder why you need to change che phases to tomething that looks like openjdk 17's phases? Am I missing something? Wouldn't it work without any change to the arguments?

You're both right. We don't need that. (Sorry) I'm sending correction below.

Cheers
Bost


From 543aa7797308ea66d1d1140e72a48908a2e73419 Mon Sep 17 00:00:00 2001
From: Rostislav Svoboda <Rostislav.Svoboda@gmail.com>
Date: Mon, 11 Apr 2022 11:55:55 +0200
Subject: [PATCH] gnu: Add openjdk18.

---
gnu/packages/java.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (36 lines)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 6738b5dc35..ec0b956388 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -2263,6 +2263,29 @@ (define-public openjdk17
                  (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))
     (home-page "https://openjdk.java.net/projects/jdk/17")))

+(define-public openjdk18
+  (package
+    (inherit openjdk17)
+    (name "openjdk")
+    (version "18")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/openjdk/jdk18u")
+                    (commit (string-append "jdk-" version "-ga"))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1bv6bdhkmwvn10l0xy8yi9xibds640hs5zsvx0jp7wrxa3qw4qy8"))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("openjdk17:jdk" ,openjdk17 "jdk")
+       ("pkg-config" ,pkg-config)
+       ("unzip" ,unzip)
+       ("which" ,which)
+       ("zip" ,zip)))
+    (home-page "https://openjdk.java.net/projects/jdk/18")))
+
 (define-public icedtea icedtea-8)


-- 
2.35.1
B
B
Björn Höfling wrote on 13 Apr 09:51 +0200
(name . Julien Lepiller)(address . julien@lepiller.eu)
20220413095130.32e5e14a@alma-ubu
Hi,

On Mon, 11 Apr 2022 16:15:46 +0200
Julien Lepiller <julien@lepiller.eu> wrote:

Toggle quote (4 lines)
> I can't build and test because of my limited bandwidth. Hopefully
> another maintainer can rur the tests and maybe push if my issues
> aren't solved soon…

I tried but stumbled upon some limits:

/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash: fork: retry: Resource temporarily unavailable
g++: fatal error: cannot execute '/gnu/store/069aq2v993kpc41yabp5b6vm4wb9jkhg-gcc-10.3.0/libexec/gcc/x86_64-unknown-linux-gnu/10.3.0/cc1plus': vfork: Resource temporarily unavailable
compilation terminated.

Is this in my shell or on the daemon? How can I increase it?

Not sure if I'm faster than your download, but let's see ...

Björn
-----BEGIN PGP SIGNATURE-----

iF0EAREKAB0WIQQiGUP0np8nb5SZM4K/KGy2WT5f/QUCYlaBAgAKCRC/KGy2WT5f
/a08AKCWoqvL3kZlGRg7c2f3u+3AJSmMmgCdF0spDTnbVNqJ8uTP+EOJGVBBnXU=
=NojS
-----END PGP SIGNATURE-----


R
R
Rostislav Svoboda wrote on 21 Apr 12:27 +0200
(address . 54852@debbugs.gnu.org)
CAEtmmeyRyj8jj6-B1XB_z=cBA=M_xd69oS8wtdJ8YthS8Nkejw@mail.gmail.com
Le mar. 12 avr. 2022 à 15:24, Rostislav Svoboda
<rostislav.svoboda@gmail.com> a écrit :
Toggle quote (8 lines)
> + (native-inputs
> + `(("autoconf" ,autoconf)
> + ("openjdk17:jdk" ,openjdk17 "jdk")
> + ("pkg-config" ,pkg-config)
> + ("unzip" ,unzip)
> + ("which" ,which)
> + ("zip" ,zip)))

And it looks like even this part can be deduplicated. Either by:

(native-inputs
(map (lambda (input)
(match (car input)
("openjdk16:jdk" `("openjdk17:jdk" ,openjdk17 "jdk"))
(_ input)))
(package-native-inputs openjdk17)))

or by:

(native-inputs
(modify-inputs (append (package-native-inputs openjdk17)
`(("openjdk17:jdk" ,openjdk17 "jdk")))
(delete "openjdk16:jdk")))

Which one do you like more?

Cheers
Bost
M
M
Maxime Devos wrote on 21 Apr 18:38 +0200
(address . 54852@debbugs.gnu.org)
3878c34d8b9b52c6a618bb47ff3a3142f3d55c9f.camel@telenet.be
Rostislav Svoboda schreef op do 21-04-2022 om 12:27 [+0200]:
Toggle quote (9 lines)
> or by:
>
> (native-inputs
>      (modify-inputs (append (package-native-inputs openjdk17)
>                             `(("openjdk17:jdk" ,openjdk17 "jdk")))
>        (delete "openjdk16:jdk")))
>
> Which one do you like more?

Is something like

(modify-inputs (package-native-inputs opendjk17)
(replace "openjdk16:jdk" openjdk17))

possible?
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYmGImhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rqAAP48GOuyHlktuRugtUQcPbWyZf2O
wgF2NKmsz3Lo6w0rfAD8DlE8eRyIyrQz0mI8Ho2pQz1OiuzWpNXInjY5DyK6rQs=
=F5AU
-----END PGP SIGNATURE-----


R
R
Rostislav Svoboda wrote on 22 Apr 12:59 +0200
(name . Maxime Devos)(address . maximedevos@telenet.be)
CAEtmmeyFCg+o6NP9DeciGQ0ewwJo4U7tETBQ7O6YLMCMKSB2LA@mail.gmail.com
Toggle quote (7 lines)
> Is something like
>
> (modify-inputs (package-native-inputs opendjk17)
> (replace "openjdk16:jdk" openjdk17))
>
> possible?

I think more appropriate would be:

(modify-inputs (package-native-inputs openjdk17)
(replace "openjdk16:jdk" `(,openjdk17 "jdk")))

however that would mean to assign a value Y to a variable named
"I-represent-a-value-of-X". So hmm, better not this way.

I personally prefer the:

(native-inputs
(map (lambda (input)
(match (car input)
("openjdk16:jdk" `("openjdk17:jdk" ,openjdk17 "jdk"))
(_ input)))
(package-native-inputs openjdk17)))

variant. IMO it better expresses the idea of substitution.

Here, (if such a pattern repeats) we could define a new syntax
`substitue` in the guix/packages.scm analogical to `delete`,
`prepend`, `append` and `replace`.

Cheers
Bost
M
M
Maxime Devos wrote on 23 Apr 16:38 +0200
(name . Rostislav Svoboda)(address . rostislav.svoboda@gmail.com)
77993552c1ea4641522845b97adc8bd5d8a2691a.camel@telenet.be
Rostislav Svoboda schreef op vr 22-04-2022 om 12:59 [+0200]:
Toggle quote (30 lines)
> > Is something like
> >
> >    (modify-inputs (package-native-inputs opendjk17)
> >      (replace "openjdk16:jdk" openjdk17))
> >
> > possible?
>
> I think more appropriate would be:
>
> (modify-inputs (package-native-inputs openjdk17)
>       (replace "openjdk16:jdk" `(,openjdk17 "jdk")))
>
> however that would mean to assign a value Y to a variable named
> "I-represent-a-value-of-X". So hmm, better not this way.
>
> I personally prefer the:
>
> (native-inputs
>      (map (lambda (input)
>             (match (car input)
>               ("openjdk16:jdk" `("openjdk17:jdk" ,openjdk17 "jdk"))
>               (_ input)))
>           (package-native-inputs openjdk17)))
>
> variant. IMO it better expresses the idea of substitution.
>
> Here, (if such a pattern repeats) we could define a new syntax
> `substitue` in the guix/packages.scm analogical to `delete`,
> `prepend`, `append` and `replace`.

Isn't this just (modify-inputs ... (replace "..." ...))?

What's the difference between 'replace' and 'substitute'? They
conceptually seem to be about the same to me. And in case of
substitute, I'm more thinking of 'substitute*' than package inputs.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYmQPWRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rbDAP965Lg0A2ilI1uJJRJjxvfVbsWe
s0GAuvl4ErCC0pT8XAD/XN0a0YhjSG+GDcOfOAfOpZ3M+ASjUI0XQBvsISEQZgI=
=DAfq
-----END PGP SIGNATURE-----


R
R
Rostislav Svoboda wrote on 23 Apr 17:11 +0200
(name . Maxime Devos)(address . maximedevos@telenet.be)
CAEtmmezkOJddukPYmFRiWi1p9D5FaYotRchJoGhCD+gPjYcELg@mail.gmail.com
Toggle quote (10 lines)
> > Here, (if such a pattern repeats) we could define a new syntax
> > `substitue` in the guix/packages.scm analogical to `delete`,
> > `prepend`, `append` and `replace`.
>
> Isn't this just (modify-inputs ... (replace "..." ...))?
>
> What's the difference between 'replace' and 'substitute'? They
> conceptually seem to be about the same to me. And in case of
> substitute, I'm more thinking of 'substitute*' than package inputs.

The lists `inputs`, `native-inputs` and `propagated-inputs` are lists
of association lists that map input labels to file names. E.g.:

(native-inputs
`(("autoconf" ,autoconf)
("openjdk16:jdk" ,openjdk16 "jdk")
("pkg-config" ,pkg-config)
("unzip" ,unzip)
("which" ,which)
("zip" ,zip)))

The `replace` just replaces the file name for a given input label (see
guix/packages.scm, line 1099):

(define (replace-input name replacement inputs)
"Replace input NAME by REPLACEMENT within INPUTS."
(map (lambda (input)
(match input
(((? string? label) _ . outputs)
(if (string=? label name)
(match replacement ;does REPLACEMENT specify an output?
((_ _) (cons label replacement))
(_ (cons* label replacement outputs)))
input))))
inputs))

(define-syntax replace
(lambda (s)
(syntax-violation 'replace
"'replace' may only be used within 'modify-inputs'"
s)))


Toggle quote (2 lines)
> I'm more thinking of 'substitute*' than package inputs.

That thing which I named `substitute` doesn't exist. I was just
contemplating that we could write it, if we want to change the whole
association list, i.e. the pair input label & file name, not just the
file name. (And when I think about it again, such a name will lead to
confusion. So nah, forget about it.)

Cheers
Bost
M
M
Maxime Devos wrote on 23 Apr 18:10 +0200
(name . Rostislav Svoboda)(address . rostislav.svoboda@gmail.com)
a2417a9eee66d45e406c14ff78b2239e68bbf985.camel@telenet.be
Rostislav Svoboda schreef op za 23-04-2022 om 17:11 [+0200]:
Toggle quote (11 lines)
> The lists `inputs`, `native-inputs` and `propagated-inputs` are lists
> of association lists that map input labels to file names. E.g.:
>
> (native-inputs
>      `(("autoconf" ,autoconf)
>        ("openjdk16:jdk" ,openjdk16 "jdk")
>        ("pkg-config" ,pkg-config)
>        ("unzip" ,unzip)
>        ("which" ,which)
>        ("zip" ,zip)))

Nitpick: 'autoconf', 'openjdk16', ..., are package objects, not file
names.

Toggle quote (15 lines)
> The `replace` just replaces the file name for a given input label (see
> guix/packages.scm, line 1099):
>
> (define (replace-input name replacement inputs)
>   "Replace input NAME by REPLACEMENT within INPUTS."
>   (map (lambda (input)
>          (match input
>            (((? string? label) _ . outputs)
>             (if (string=? label name)
>                 (match replacement        ;does REPLACEMENT specify an output?
>                   ((_ _) (cons label replacement))
>                   (_     (cons* label replacement outputs)))
>                 input))))
>        inputs))

Replacing 'file name' by 'package object', isn't that what we need
here? FWIW, 'replace' could be extended to also support modifying the
output, but that extra functionality doesn't appear to have any use
yet.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYmQlDBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qq+AP9g0p/O7ll3NcEHdms6QKB/C3MY
ZYMf1haC/diXWGLjowEAh4PmKGEeWTDtYVSgYXtIEpW/IWmjsrUjj6HDGeK8Ygg=
=mE3h
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 8 May 18:41 +0200
a6cdc5b94a93719e5fc9efc2a1509b193865719e.camel@telenet.be
How long did it take to compile openjdk@18 on your computer? It's
taking many hours on my computer ...
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYnfyrhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7seMAQDJ3JcKu45NHqZeMnUnTL3KdaMM
WsoFMuvwnEcNd9hm5gD/V80/J5aninnJc0A7sT1I9XAV35LeAKsRRK3XBE5ZWQI=
=ozjM
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 9 May 21:11 +0200
d1fd3fb876bd26c7dc1e9685daf362bcba43a767.camel@telenet.be
The following simplified package definition ‘worked’ for me:

(define-public openjdk18
(package
(inherit openjdk17)
(name "openjdk")
(version "18")
(source (origin
(method git-fetch)
(uri (git-reference
(commit (string-append "jdk-" version "-ga"))))
(file-name (git-file-name name version))
(sha256
(base32
"1bv6bdhkmwvn10l0xy8yi9xibds640hs5zsvx0jp7wrxa3qw4qy8"))))
(native-inputs
(modify-inputs (package-native-inputs openjdk17)
(replace "openjdk16:jdk" openjdk17)))
[home-page ...]))

‘worked’, because it took to long for me so I interrupted the build in
the build phase.

About the labels issue: maybe "icedtea-8" could be changed to "icedtea",
"openjdkN" to "openjdk" and "openjdkN:jdk" to "openjdk:jdk" at some point
in the future, such that the package name matches the input label and
the input alist can be changed to a package list.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYnlnURccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hQhAQDHAk4mOUdA2pRpOtJWOzIG43Ud
AlECZELeSG5EcTYJGQEA3zqBn7P8oF6hVd41DJzVSE4emDeIkLo8aGTJOo5hyAM=
=t7ci
-----END PGP SIGNATURE-----


R
R
Rostislav Svoboda wrote on 10 May 00:20 +0200
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 54852@debbugs.gnu.org)
CAEtmmez=WOj7KCips=LR1aiikkmAhTioDOv=oBKw7gy5-uMUkw@mail.gmail.com
Hi Maxime,

Toggle quote (21 lines)
> The following simplified package definition ‘worked’ for me:
>
> (define-public openjdk18
> (package
> (inherit openjdk17)
> (name "openjdk")
> (version "18")
> (source (origin
> (method git-fetch)
> (uri (git-reference
> (url "https://github.com/openjdk/jdk18u")
> (commit (string-append "jdk-" version "-ga"))))
> (file-name (git-file-name name version))
> (sha256
> (base32
> "1bv6bdhkmwvn10l0xy8yi9xibds640hs5zsvx0jp7wrxa3qw4qy8"))))
> (native-inputs
> (modify-inputs (package-native-inputs openjdk17)
> (replace "openjdk16:jdk" openjdk17)))
> [home-page ...]))

I'm a bit puzzled. Here is how I run the build:
The `/home/bost/dev/guix` contains a clone of

```shell
$ pwd
/home/bost/dev/guix/gnu/packages
$ time guix build --check --load-path=. openjdk
...
Executed in 73.08 secs fish external
usr time 151.31 secs 0.00 micros 151.31 secs
sys time 0.48 secs 759.00 micros 0.48 secs
```

So my build time is about 2,5 minutes. During the build I get plenty
of warnings like:
guix build: warning: failed to load '(SOME-THING)':
no code for module (SOME-THING)
./SOME-THING.scm:20:0: warning: module name (gnu packages
SOME-THING) does not match file name 'SOME-THING.scm'
hint: File `./SOME-THING.scm' should probably start with:

(define-module (SOME-THING))

and it looks like the warnings can be ignored.

Regarding the compilation itself, first of all I had to exclude the
271b2e43bef96f17f3f1e1085394b4bb144c5768 due to the
Then I had to fix the `[home-page ...]` and put there `(home-page
doesn't compile. I get:
The following graft will be made:
/gnu/store/42kdy7fs7pykx79m69v2gpxw7gmph745-openjdk-18.drv
guix build: error: some outputs of
`/gnu/store/42kdy7fs7pykx79m69v2gpxw7gmph745-openjdk-18.drv' are not
valid, so checking is not possible

And here are the definitions which work for me:
;; I'd prefer:
(define-public openjdk18
(package
(inherit openjdk17)
(name "openjdk")
(version "18")
(source (origin
(method git-fetch)
(uri (git-reference
(commit (string-append "jdk-" version "-ga"))))
(file-name (git-file-name name version))
(sha256
(base32
"1bv6bdhkmwvn10l0xy8yi9xibds640hs5zsvx0jp7wrxa3qw4qy8"))))
(native-inputs
(map (lambda (input)
(match (car input)
("openjdk16:jdk" `("openjdk17:jdk" ,openjdk17 "jdk"))
(_ input)))
(package-native-inputs openjdk17)))

;; This works too:
(define-public openjdk18
(package
(inherit openjdk17)
(name "openjdk")
(version "18")
(source (origin
(method git-fetch)
(uri (git-reference
(commit (string-append "jdk-" version "-ga"))))
(file-name (git-file-name name version))
(sha256
(base32
"1bv6bdhkmwvn10l0xy8yi9xibds640hs5zsvx0jp7wrxa3qw4qy8"))))
(modify-inputs (package-native-inputs openjdk17)
(delete "openjdk16:jdk")
(append `(("openjdk17:jdk" ,openjdk17 "jdk"))))

Toggle quote (5 lines)
> About the labels issue: maybe "icedtea-8" could be changed to "icedtea",
> "openjdkN" to "openjdk" and "openjdkN:jdk" to "openjdk:jdk" at some point
> in the future, such that the package name matches the input label and
> the input alist can be changed to a package list.

Sure. Good idea.

Greetings,
Bost
M
M
Maxime Devos wrote on 10 May 08:59 +0200
(name . Rostislav Svoboda)(address . rostislav.svoboda@gmail.com)(address . 54852@debbugs.gnu.org)
f7b6c91febc02d7a0cb6afc1cbce5e3df586d468.camel@telenet.be
Rostislav Svoboda schreef op di 10-05-2022 om 00:20 [+0200]:
Toggle quote (5 lines)
> /home/bost/dev/guix/gnu/packages
> $ time guix build --check --load-path=. openjdk
> [...]
> and it looks like the warnings can be ignored

packages contains files like "base.scm" corresponding to the module
(gnu packages base). However, now there are two (gnu packages base) --
the base from the guix you run, and the base from ./. Additionally,
"base.scm" has a module (gnu packages base) so Guile expects it to be
located in ./gnu/package/base.scm instead.

Instead, try:

/home/bost/dev/guix
# do this inside a "guix shell -D guix" or whatever you use
# to set up a Guix development environment
$ make && time ./pre-inst-env guix build openjdk

(also, don't do --check -- check is for verifying that the build was
reproducible, but it's a new package definition, so Guix doesn't have
anything to compare it against).

Toggle quote (3 lines)
> The following graft will be made:
> [...]

Looks like Guix didn't detect the new package definition, otherwise
you'd see ‘The following packages will be build’ or the like.

Toggle quote (4 lines)
> ;; I'd prefer: [...
> (delete "openjdk16:jdk")
> (append `(("openjdk17:jdk" ,openjdk17 "jdk"))))

If/when

Toggle quote (6 lines)
> About the labels issue: maybe "icedtea-8" could be changed to
> "icedtea", "openjdkN" to "openjdk" and "openjdkN:jdk" to
> "openjdk:jdk" at some point in the future, such that the package name
> matches the input label and the input alist can be changed to a
> package list.

is addressed, WDYT of (replace "openjdk" openjdk)?

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYnoNQRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7uGEAP0YZZ/uuI5rauFCrFiOG1f+4WOq
41bIr1ch3KygIYdD7gD/fFBnL2b6BqX8d5TMQg79LY/VvJ/fOWsB39mpY7yo6wM=
=cxCb
-----END PGP SIGNATURE-----


R
R
Rostislav Svoboda wrote on 11 May 17:37 +0200
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 54852@debbugs.gnu.org)
CAEtmmexbPzM1mwAkGJ_6_7ngixXQT7CUYKiH=UrQ9mA6jy+WdA@mail.gmail.com
Hi Maxime,

Toggle quote (7 lines)
> Instead, try:
>
> /home/bost/dev/guix
> # do this inside a "guix shell -D guix" or whatever you use
> # to set up a Guix development environment
> $ make && time ./pre-inst-env guix build openjdk

Ok thanks. (As you see, I need to learn a lot.)
Regarding the build time (just for the record), I run

$ cd /home/bost/dev/guix
$ git checkout dev
$ git --force -dx # make sure everything is pristine clean and clear
$ guix shell --development guix
# and then:
[env]$ ./bootstrap && ./configure --localstatedir=/var && make -j24
[env]$ time ./pre-inst-env guix build openjdk
...
real 4m32.993s
user 0m26.175s
sys 0m1.357s

And my `dev` branch contains this openjdk18 definition:

(define-public openjdk18
(package
(inherit openjdk17)
(name "openjdk")
(version "18")
(source (origin
(method git-fetch)
(uri (git-reference
(commit (string-append "jdk-" version "-ga"))))
(file-name (git-file-name name version))
(sha256
(base32
"1bv6bdhkmwvn10l0xy8yi9xibds640hs5zsvx0jp7wrxa3qw4qy8"))))
(native-inputs
(map (lambda (input)
(match (car input)
("openjdk16:jdk" `("openjdk17:jdk" ,openjdk17 "jdk"))
(_ input)))
(package-native-inputs openjdk17)))

Toggle quote (6 lines)
> > ;; I'd prefer: [...
> > (delete "openjdk16:jdk")
> > (append `(("openjdk17:jdk" ,openjdk17 "jdk"))))
>
> If/when

What do you mean by that???

Toggle quote (8 lines)
> > About the labels issue: maybe "icedtea-8" could be changed to
> > "icedtea", "openjdkN" to "openjdk" and "openjdkN:jdk" to
> > "openjdk:jdk" at some point in the future, such that the package name
> > matches the input label and the input alist can be changed to a
> > package list.
>
> is addressed, WDYT of (replace "openjdk" openjdk)?

???
Could you explain that please?
Because to me, out of any context, (e.g. when grep-ing over the source
code,) that looks like a "replace a-thing with a-thing". I.e.
effectively, a do-nothing command.
Thank you.

Greetings,
Bost
M
M
Maxime Devos wrote on 11 May 20:13 +0200
(name . Rostislav Svoboda)(address . rostislav.svoboda@gmail.com)(address . 54852@debbugs.gnu.org)
8f19c4e7977c5171d68dfdea9e5991713973ca0b.camel@telenet.be
Rostislav Svoboda schreef op wo 11-05-2022 om 17:37 [+0200]:
Toggle quote (16 lines)
> > > About the labels issue: maybe "icedtea-8" could be changed to
> > > "icedtea", "openjdkN" to "openjdk" and "openjdkN:jdk" to
> > > "openjdk:jdk" at some point in the future, such that the package
> > > name
> > > matches the input label and the input alist can be changed to a
> > > package list.
> >
> > is addressed, WDYT of (replace "openjdk" openjdk)?
>
> ???
> Could you explain that please?
> Because to me, out of any context, (e.g. when grep-ing over the
> source
> code,) that looks like a "replace a-thing with a-thing". I.e.
> effectively, a do-nothing command.

Oops, I meant (replace "openjdk" openjdkN). Basically, whenever we now
have (native-inputs `(("openjdkN" ,openjdkN) ("openjdkN" ,openjdkN
"jdk") [... other inputs ...])), let's replace it by

;; In the openjdkN+1 package
(native-inputs
(list `(("openjdk" ,openjdkN)
("openjdk:jdk" ,openjdkN "jdk")
[...])))

such that we always use the same input labels for the openjdk packages
(here, N is 9, 10, 11, 12, 13, 14, 15 or 16).

Then the the native-inputs can be simplified to (using "guix style"):

(native-inputs
(list openjdkN `(,openjdkN "jdk") [...]))

and further to

(native-inputs
(modify-inputs (package-native-inputs openjdkN)
(replace "openjdk" openjdkN)))

which means: take the 'native-inputs' of the previous version of
'openjdk', but replace the openjdk it uses (openjdkN-1) by itself
(openjdkN).
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYnv8tRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lYiAQCXwoLnno35pCBWSrGGm8Aflf22
dLjNycauHd7i19/C7gD/Y8Smhw/m62AITih6nVPAs1tP0SUkKcEuAm8i09Bb5Qc=
=KVv3
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 11 May 20:22 +0200
(name . Rostislav Svoboda)(address . rostislav.svoboda@gmail.com)(address . 54852@debbugs.gnu.org)
6beb046093f8655ccfb67105800c93a5ce8259e5.camel@telenet.be
Rostislav Svoboda schreef op wo 11-05-2022 om 17:37 [+0200]:
Toggle quote (2 lines)
> [env]$ time ./pre-inst-env guix build openjdk

Did you run this after it was already built, or before? If the former,
it probably just counts time grafting (4min seems about accurate for
openjdk in my experience) due to some new grafts since last time.

For timing build times, I recommend:

# --no-grafts: don't do grafts to avoid counting time grafting
# --check --rounds=1: build it again
$ time ./pre-inst-env guix build openjdk --no-grafts --check --rounds=1

though that only does somethin usefu

Toggle quote (5 lines)
> ...
> real 4m32.993s
> user 0m26.175s
> sys 0m1.357s

I compiled it with cores=1 or cores=4 or cores=8 (not sure which).
Since apparently you have a 24 core computer, multiplying by 24 would
give an estimate of 108m ≅ 2 hours for cores=1. Though it ran much
longer than that on my computer (at least 12h), so I don't understand,
unless there was grafting involved.

I don't think it really matters though, so maybe we can drop this?

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYnv+4RccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ooeAP49M+umpq3kyYpdcGvYsURVWShW
KYEt5xhZZcnn3820VQD+KkR8h66+hCkfXUO10E2nGxrYC5MJgnn6pBYXgR2ECQU=
=ToEf
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 11 May 20:30 +0200
(name . Rostislav Svoboda)(address . rostislav.svoboda@gmail.com)(address . 54852@debbugs.gnu.org)
20bd22d42a1379c41e1560eb8383de732c261e7f.camel@telenet.be
Rostislav Svoboda schreef op wo 11-05-2022 om 17:37 [+0200]:
Toggle quote (8 lines)
> > > ;; I'd prefer: [...
> > > (delete "openjdk16:jdk")
> > > (append `(("openjdk17:jdk" ,openjdk17 "jdk"))))
> >
> > If/when
>
> What do you mean by that???

It's a sentence construction that I occasionally find useful but I
imagine it can be confusing to someone not used to it. (Rest of
explanation continued later).

Toggle quote (10 lines)
>
> > > About the labels issue: maybe "icedtea-8" could be changed to
> > > "icedtea", "openjdkN" to "openjdk" and "openjdkN:jdk" to
> > > "openjdk:jdk" at some point in the future, such that the package
> > > name
> > > matches the input label and the input alist can be changed to a
> > > package list.
> >
> > is addressed, WDYT of (replace "openjdk" openjdk)?

Basically, the full sentence is ‘If/when SUBJECT is addressed, WDYT of
(replace "openjdk" openjdk)?’. Here, SUBJECT is the complete next
quote:

Toggle quote (6 lines)
> About the labels issue: maybe "icedtea-8" could be changed to
> "icedtea", "openjdkN" to "openjdk" and "openjdkN:jdk" to
> "openjdk:jdk" at some point in the future, such that the package name
> matches the input label and the input alist can be changed to a
> package list.

In linguistic terms, the subject of the sentence is the above
paragraph. Using a full paragraph as subject isn't really feasible in
verbal speech, but textual communication is more flexible in this
aspect, albeit with the usual ‘only if both communication partners
understand each other’ caveat.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYnwAyRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pZaAQDgXWLZU1tiC9Gtfng1fltfWwWx
tLb2fBjiLYsYk5VZcwD/QnnJLMX3YD4QzPcmiRAHNyOnmKdqjyuvGXGkuGIf7QE=
=fi0j
-----END PGP SIGNATURE-----


?