unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#54852] [PATCH] gnu: Add openjdk18.
@ 2022-04-11 12:53 Rostislav Svoboda
  2022-04-11 13:43 ` Maxime Devos
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Rostislav Svoboda @ 2022-04-11 12:53 UTC (permalink / raw)
  To: 54852; +Cc: Rostislav Svoboda

---
 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)
 
 \f
-- 
2.35.1





^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-11 12:53 [bug#54852] [PATCH] gnu: Add openjdk18 Rostislav Svoboda
@ 2022-04-11 13:43 ` Maxime Devos
  2022-04-12 13:03   ` Rostislav Svoboda
  2022-04-11 13:44 ` Maxime Devos
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 22+ messages in thread
From: Maxime Devos @ 2022-04-11 13:43 UTC (permalink / raw)
  To: Rostislav Svoboda, 54852

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

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.

Greetings,
MAxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-11 12:53 [bug#54852] [PATCH] gnu: Add openjdk18 Rostislav Svoboda
  2022-04-11 13:43 ` Maxime Devos
@ 2022-04-11 13:44 ` Maxime Devos
  2022-04-12 13:24   ` Rostislav Svoboda
  2022-04-11 14:15 ` Julien Lepiller
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 22+ messages in thread
From: Maxime Devos @ 2022-04-11 13:44 UTC (permalink / raw)
  To: Rostislav Svoboda, 54852

[-- Attachment #1: Type: text/plain, Size: 800 bytes --]

Rostislav Svoboda schreef op ma 11-04-2022 om 14:53 [+0200]:
> +    (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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-11 12:53 [bug#54852] [PATCH] gnu: Add openjdk18 Rostislav Svoboda
  2022-04-11 13:43 ` Maxime Devos
  2022-04-11 13:44 ` Maxime Devos
@ 2022-04-11 14:15 ` Julien Lepiller
  2022-04-13  7:51   ` Björn Höfling
  2022-05-08 16:41 ` Maxime Devos
  2022-05-09 19:11 ` Maxime Devos
  4 siblings, 1 reply; 22+ messages in thread
From: Julien Lepiller @ 2022-04-11 14:15 UTC (permalink / raw)
  To: Rostislav Svoboda, 54852

[-- Attachment #1: Type: text/plain, Size: 2330 bytes --]

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:
>---
> 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)
> 
> \f>
>-- 
>2.35.1
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 2683 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-11 13:43 ` Maxime Devos
@ 2022-04-12 13:03   ` Rostislav Svoboda
  0 siblings, 0 replies; 22+ messages in thread
From: Rostislav Svoboda @ 2022-04-12 13:03 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 54852

> 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
available at http://jdk.java.net/.
configure: This might be fixed by explicitly setting --with-boot-jdk
configure: error: Cannot continue

Cheers
Bost




^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-11 13:44 ` Maxime Devos
@ 2022-04-12 13:24   ` Rostislav Svoboda
  2022-04-21 10:27     ` Rostislav Svoboda
  0 siblings, 1 reply; 22+ messages in thread
From: Rostislav Svoboda @ 2022-04-12 13:24 UTC (permalink / raw)
  To: Maxime Devos, Julien Lepiller; +Cc: 54852

Le lun. 11 avr. 2022 à 15:44, Maxime Devos <maximedevos@telenet.be> a écrit :
> > +    (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 :
> 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(+)

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




^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-11 14:15 ` Julien Lepiller
@ 2022-04-13  7:51   ` Björn Höfling
  0 siblings, 0 replies; 22+ messages in thread
From: Björn Höfling @ 2022-04-13  7:51 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: Rostislav Svoboda, 54852

[-- Attachment #1: Type: text/plain, Size: 766 bytes --]

Hi,

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

 
> 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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-12 13:24   ` Rostislav Svoboda
@ 2022-04-21 10:27     ` Rostislav Svoboda
  2022-04-21 16:38       ` Maxime Devos
  0 siblings, 1 reply; 22+ messages in thread
From: Rostislav Svoboda @ 2022-04-21 10:27 UTC (permalink / raw)
  To: Maxime Devos, Julien Lepiller; +Cc: 54852

Le mar. 12 avr. 2022 à 15:24, Rostislav Svoboda
<rostislav.svoboda@gmail.com> a écrit :
> +    (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




^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-21 10:27     ` Rostislav Svoboda
@ 2022-04-21 16:38       ` Maxime Devos
  2022-04-22 10:59         ` Rostislav Svoboda
  0 siblings, 1 reply; 22+ messages in thread
From: Maxime Devos @ 2022-04-21 16:38 UTC (permalink / raw)
  To: Rostislav Svoboda, Julien Lepiller; +Cc: 54852

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

Rostislav Svoboda schreef op do 21-04-2022 om 12:27 [+0200]:
> 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?

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-21 16:38       ` Maxime Devos
@ 2022-04-22 10:59         ` Rostislav Svoboda
  2022-04-23 14:38           ` Maxime Devos
  0 siblings, 1 reply; 22+ messages in thread
From: Rostislav Svoboda @ 2022-04-22 10:59 UTC (permalink / raw)
  To: Maxime Devos; +Cc: Julien Lepiller, 54852

> 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




^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-22 10:59         ` Rostislav Svoboda
@ 2022-04-23 14:38           ` Maxime Devos
  2022-04-23 15:11             ` Rostislav Svoboda
  0 siblings, 1 reply; 22+ messages in thread
From: Maxime Devos @ 2022-04-23 14:38 UTC (permalink / raw)
  To: Rostislav Svoboda; +Cc: Julien Lepiller, 54852

[-- Attachment #1: Type: text/plain, Size: 1348 bytes --]

Rostislav Svoboda schreef op vr 22-04-2022 om 12:59 [+0200]:
> > 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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-23 14:38           ` Maxime Devos
@ 2022-04-23 15:11             ` Rostislav Svoboda
  2022-04-23 16:10               ` Maxime Devos
  0 siblings, 1 reply; 22+ messages in thread
From: Rostislav Svoboda @ 2022-04-23 15:11 UTC (permalink / raw)
  To: Maxime Devos; +Cc: Julien Lepiller, 54852

> > 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)))

See also https://guix.gnu.org/en/blog/2021/the-big-change/

> 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




^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-23 15:11             ` Rostislav Svoboda
@ 2022-04-23 16:10               ` Maxime Devos
  0 siblings, 0 replies; 22+ messages in thread
From: Maxime Devos @ 2022-04-23 16:10 UTC (permalink / raw)
  To: Rostislav Svoboda; +Cc: Julien Lepiller, 54852

[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]

Rostislav Svoboda schreef op za 23-04-2022 om 17:11 [+0200]:
> 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.

> 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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-11 12:53 [bug#54852] [PATCH] gnu: Add openjdk18 Rostislav Svoboda
                   ` (2 preceding siblings ...)
  2022-04-11 14:15 ` Julien Lepiller
@ 2022-05-08 16:41 ` Maxime Devos
  2022-05-09 19:11 ` Maxime Devos
  4 siblings, 0 replies; 22+ messages in thread
From: Maxime Devos @ 2022-05-08 16:41 UTC (permalink / raw)
  To: Rostislav Svoboda, 54852

[-- Attachment #1: Type: text/plain, Size: 106 bytes --]

How long did it take to compile openjdk@18 on your computer?  It's
taking many hours on my computer ...

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-04-11 12:53 [bug#54852] [PATCH] gnu: Add openjdk18 Rostislav Svoboda
                   ` (3 preceding siblings ...)
  2022-05-08 16:41 ` Maxime Devos
@ 2022-05-09 19:11 ` Maxime Devos
  2022-05-09 22:20   ` Rostislav Svoboda
  4 siblings, 1 reply; 22+ messages in thread
From: Maxime Devos @ 2022-05-09 19:11 UTC (permalink / raw)
  To: Rostislav Svoboda, 54852

[-- Attachment #1: Type: text/plain, Size: 1112 bytes --]

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 ...]))

‘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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-05-09 19:11 ` Maxime Devos
@ 2022-05-09 22:20   ` Rostislav Svoboda
  2022-05-10  6:59     ` Maxime Devos
  0 siblings, 1 reply; 22+ messages in thread
From: Rostislav Svoboda @ 2022-05-09 22:20 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 54852

Hi Maxime,

> 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
https://git.savannah.gnu.org/git/guix.git

```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
https://issues.guix.gnu.org/55255 from my repo.
Then I had to fix the `[home-page ...]` and put there `(home-page
"https://openjdk.java.net/projects/jdk/18")` and even after that it
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
                    (url "https://github.com/openjdk/jdk18u")
                    (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)))
    (home-page "https://openjdk.java.net/projects/jdk/18")))

;; This works too:
(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"))))
    (modify-inputs (package-native-inputs openjdk17)
      (delete "openjdk16:jdk")
      (append `(("openjdk17:jdk" ,openjdk17 "jdk"))))
    (home-page "https://openjdk.java.net/projects/jdk/18")))

> 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




^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-05-09 22:20   ` Rostislav Svoboda
@ 2022-05-10  6:59     ` Maxime Devos
  2022-05-11 15:37       ` Rostislav Svoboda
  0 siblings, 1 reply; 22+ messages in thread
From: Maxime Devos @ 2022-05-10  6:59 UTC (permalink / raw)
  To: Rostislav Svoboda; +Cc: 54852

[-- Attachment #1: Type: text/plain, Size: 1573 bytes --]

Rostislav Svoboda schreef op di 10-05-2022 om 00:20 [+0200]:
> /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).

> 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.

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

If/when 

> 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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-05-10  6:59     ` Maxime Devos
@ 2022-05-11 15:37       ` Rostislav Svoboda
  2022-05-11 18:13         ` Maxime Devos
                           ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Rostislav Svoboda @ 2022-05-11 15:37 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 54852

Hi Maxime,

> 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
                    (url "https://github.com/openjdk/jdk18u")
                    (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)))
    (home-page "https://openjdk.java.net/projects/jdk/18")))

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

What do you mean by that???

> > 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




^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-05-11 15:37       ` Rostislav Svoboda
@ 2022-05-11 18:13         ` Maxime Devos
  2022-05-11 18:22         ` Maxime Devos
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 22+ messages in thread
From: Maxime Devos @ 2022-05-11 18:13 UTC (permalink / raw)
  To: Rostislav Svoboda; +Cc: 54852

[-- Attachment #1: Type: text/plain, Size: 1550 bytes --]

Rostislav Svoboda schreef op wo 11-05-2022 om 17:37 [+0200]:
> > > 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).



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-05-11 15:37       ` Rostislav Svoboda
  2022-05-11 18:13         ` Maxime Devos
@ 2022-05-11 18:22         ` Maxime Devos
  2022-05-11 18:30         ` Maxime Devos
  2022-09-27 14:17         ` bug#54852: " Maxim Cournoyer
  3 siblings, 0 replies; 22+ messages in thread
From: Maxime Devos @ 2022-05-11 18:22 UTC (permalink / raw)
  To: Rostislav Svoboda; +Cc: 54852

[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]

Rostislav Svoboda schreef op wo 11-05-2022 om 17:37 [+0200]:
> [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

> ...
> 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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [bug#54852] [PATCH] gnu: Add openjdk18.
  2022-05-11 15:37       ` Rostislav Svoboda
  2022-05-11 18:13         ` Maxime Devos
  2022-05-11 18:22         ` Maxime Devos
@ 2022-05-11 18:30         ` Maxime Devos
  2022-09-27 14:17         ` bug#54852: " Maxim Cournoyer
  3 siblings, 0 replies; 22+ messages in thread
From: Maxime Devos @ 2022-05-11 18:30 UTC (permalink / raw)
  To: Rostislav Svoboda; +Cc: 54852

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

Rostislav Svoboda schreef op wo 11-05-2022 om 17:37 [+0200]:
> > > ;; 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).

> 
> > > 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:

> 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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#54852: [PATCH] gnu: Add openjdk18.
  2022-05-11 15:37       ` Rostislav Svoboda
                           ` (2 preceding siblings ...)
  2022-05-11 18:30         ` Maxime Devos
@ 2022-09-27 14:17         ` Maxim Cournoyer
  3 siblings, 0 replies; 22+ messages in thread
From: Maxim Cournoyer @ 2022-09-27 14:17 UTC (permalink / raw)
  To: Rostislav Svoboda; +Cc: 54852-done, Maxime Devos

Hello!

Thanks for the heads up regarding openjdk18.  I've pushed a series of
change that removed the duplication in our different openjdk packages,
and slimmed its weigh from 345 to 116 MiB.  I also added openjdk18 on
top and made it the default version in Guix.

See commits from e33ab2dd9e to fb6173b7c0.

Thank you!

Closing.

Maxim




^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2022-09-27 16:01 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-11 12:53 [bug#54852] [PATCH] gnu: Add openjdk18 Rostislav Svoboda
2022-04-11 13:43 ` Maxime Devos
2022-04-12 13:03   ` Rostislav Svoboda
2022-04-11 13:44 ` Maxime Devos
2022-04-12 13:24   ` Rostislav Svoboda
2022-04-21 10:27     ` Rostislav Svoboda
2022-04-21 16:38       ` Maxime Devos
2022-04-22 10:59         ` Rostislav Svoboda
2022-04-23 14:38           ` Maxime Devos
2022-04-23 15:11             ` Rostislav Svoboda
2022-04-23 16:10               ` Maxime Devos
2022-04-11 14:15 ` Julien Lepiller
2022-04-13  7:51   ` Björn Höfling
2022-05-08 16:41 ` Maxime Devos
2022-05-09 19:11 ` Maxime Devos
2022-05-09 22:20   ` Rostislav Svoboda
2022-05-10  6:59     ` Maxime Devos
2022-05-11 15:37       ` Rostislav Svoboda
2022-05-11 18:13         ` Maxime Devos
2022-05-11 18:22         ` Maxime Devos
2022-05-11 18:30         ` Maxime Devos
2022-09-27 14:17         ` bug#54852: " Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).