[WIP] openjdk 9 and 10

  • Done
  • quality assurance status badge
Details
4 participants
  • Björn Höfling
  • Brett Gilio
  • Danny Milosavljevic
  • Julien Lepiller
Owner
unassigned
Submitted by
Julien Lepiller
Severity
normal
J
J
Julien Lepiller wrote on 10 Oct 2018 23:40
(address . guix-patches@gnu.org)
20181010234059.337d3496@lepiller.eu
Hi, here are two patches that add openjdk9 and openjdk10. The patches
must be applied on top of core-updates (or master once core-updates is
merged) because of an issue with gcc on master. I haven't tested them
too much, and they were probably too easy to build, so I wouldn't be
surprised if we found something bad in them.
From b91996c2c84581253f113e5fc81ab0e32b3ad4ce Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Wed, 10 Oct 2018 22:29:50 +0200
Subject: [PATCH 2/2] gnu: Add openjdk10.

* gnu/packages/java.scm (openjdk10): New variable.
---
gnu/packages/java.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index e53168713..36d7fcb2c 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1795,6 +1795,41 @@ new Date();"))
"This package provides the Java development kit OpenJDK.")
(license license:gpl2+)))
+(define-public openjdk10
+ (package
+ (inherit openjdk9)
+ (name "openjdk")
+ (version "10+46")
+ (source (origin
+ (method url-fetch)
+ (uri "http://hg.openjdk.java.net/jdk/jdk/archive/6fa770f9f8ab.tar.bz2")
+ (file-name (string-append name "-" version ".tar.bz2"))
+ (sha256
+ (base32
+ "0zywq2203b4hx4jms9vbwvjcj1d3k2v3qpx4s33729fkpmid97r4"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments openjdk9)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (invoke "bash" "./configure"
+ (string-append "--with-freetype=" (assoc-ref inputs "freetype"))
+ "--disable-freetype-bundling"
+ "--disable-warnings-as-errors"
+ "--disable-hotspot-gtest"
+ "--with-giflib=system"
+ "--with-libjpeg=system"
+ "--with-native-debug-symbols=zipped"
+ (string-append "--prefix=" (assoc-ref outputs "out")))
+ #t))))))
+ (native-inputs
+ `(("openjdk9" ,openjdk9)
+ ("openjdk9:jdk" ,openjdk9 "jdk")
+ ("unzip" ,unzip)
+ ("which" ,which)
+ ("zip" ,zip)))))
+
(define-public icedtea icedtea-8)
--
2.18.0
B
B
Brett Gilio wrote on 11 Oct 2018 01:23
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 33008@debbugs.gnu.org)
87o9c1crnb.fsf@posteo.net
Julien Lepiller writes:

Toggle quote (260 lines)
> Hi, here are two patches that add openjdk9 and openjdk10. The
> patches
> must be applied on top of core-updates (or master once
> core-updates is
> merged) because of an issue with gcc on master. I haven't tested
> them
> too much, and they were probably too easy to build, so I
> wouldn't be
> surprised if we found something bad in them.
> From 4d83922aa5e02b17e6af860aa827f24131476c81 Mon Sep 17
> 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Wed, 10 Oct 2018 22:26:39 +0200
> Subject: [PATCH 1/2] gnu: Add openjdk9.
>
> * gnu/packages/java.scm (openjdk9): New variable.
> ---
> gnu/packages/java.scm | 123
> ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 123 insertions(+)
>
> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
> index 93f5bb6af..e53168713 100644
> --- a/gnu/packages/java.scm
> +++ b/gnu/packages/java.scm
> @@ -46,6 +46,7 @@
> #:use-module (gnu packages cpio)
> #:use-module (gnu packages cups)
> #:use-module (gnu packages compression)
> + #:use-module (gnu packages elf)
> #:use-module (gnu packages fontutils)
> #:use-module (gnu packages gawk)
> #:use-module (gnu packages gettext)
> @@ -1672,6 +1673,128 @@ new Date();"))
> '("jdk" "openjdk-src" "corba-drop" "jaxp-drop"
> "jaxws-drop"
> "jdk-drop" "langtools-drop"
> "hotspot-drop")))))))
>
> +(define-public openjdk9
> + (package
> + (name "openjdk")
> + (version "9+181")
> + (source (origin
> + (method url-fetch)
> + (uri
> "http://hg.openjdk.java.net/jdk/jdk/archive/3cc80be736f2.tar.bz2")
> + (file-name (string-append name "-" version
> ".tar.bz2"))
> + (sha256
> + (base32
> +
> "01ihmyf7k5z17wbr7xig7y40l9f01d5zjgkcmawn1102hw5kchpq"))))
> + (build-system gnu-build-system)
> + (outputs '("out" "jdk" "doc"))
> + (arguments
> + `(#:tests? #f; require jtreg
> + #:imported-modules
> + ((guix build syscalls)
> + ,@%gnu-build-system-modules)
> + #:phases
> + (modify-phases %standard-phases
> + (delete 'patch-source-shebangs)
> + (replace 'configure
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + ;; TODO: unbundle libpng and lcms
> + (invoke "bash" "./configure"
> + (string-append "--with-freetype="
> (assoc-ref inputs "freetype"))
> + "--disable-freetype-bundling"
> + "--disable-warnings-as-errors"
> + "--disable-hotspot-gtest"
> + "--with-giflib=system"
> + "--with-libjpeg=system"
> + (string-append "--prefix=" (assoc-ref
> outputs "out")))
> + #t))
> + (replace 'build
> + (lambda _
> + (with-output-to-file ".src-rev"
> + (lambda _
> + (display ,version)))
> + (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "yes")
> + (invoke "make" "all")
> + #t))
> + ;; Some of the libraries in the lib/ folder link to
> libjvm.so.
> + ;; But that shared object is located in the server/
> folder, so it
> + ;; cannot be found. This phase creates a symbolic
> link in the
> + ;; lib/ folder so that the other libraries can find
> it.
> + ;;
> + ;; See:
> + ;;
> https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
> + ;;
> + ;; FIXME: Find the bug in the build system, so that
> this symlink is
> + ;; not needed.
> + (add-after 'install 'install-libjvm
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + (let* ((lib-out (string-append (assoc-ref outputs
> "out")
> + "/lib"))
> + (lib-jdk (string-append (assoc-ref outputs
> "jdk")
> + "/lib")))
> + (symlink (string-append lib-jdk
> "/server/libjvm.so")
> + (string-append lib-jdk "/libjvm.so"))
> + (symlink (string-append lib-out
> "/server/libjvm.so")
> + (string-append lib-out "/libjvm.so")))
> + #t))
> + (replace 'install
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let ((out (assoc-ref outputs "out"))
> + (jdk (assoc-ref outputs "jdk"))
> + (doc (assoc-ref outputs "doc"))
> + (images (car (find-files "build"
> ".*-server-release"
> + #:directories?
> #t))))
> + (copy-recursively (string-append images
> "/images/jdk") jdk)
> + (copy-recursively (string-append images
> "/images/jre") out)
> + (copy-recursively (string-append images
> "/images/docs") doc))
> + #t))
> + (add-after 'install 'strip-zip-timestamps
> + (lambda* (#:key outputs #:allow-other-keys)
> + (use-modules (guix build syscalls))
> + (for-each (lambda (zip)
> + (let ((dir (mkdtemp!
> "zip-contents.XXXXXX")))
> + (with-directory-excursion dir
> + (invoke "unzip" zip))
> + (delete-file zip)
> + (for-each (lambda (file)
> + (let ((s (lstat file)))
> + (unless (eq?
> (stat:type s) 'symlink)
> + (format #t "reset
> ~a~%" file)
> + (utime file 0 0 0
> 0))))
> + (find-files dir #:directories?
> #t))
> + (with-directory-excursion dir
> + (let ((files (find-files "." ".*"
> #:directories? #t)))
> + (apply invoke "zip" "-0" "-X"
> zip files)))))
> + (find-files (assoc-ref outputs "doc")
> ".*.zip$"))
> + #t)))))
> + (inputs
> + `(("alsa-lib" ,alsa-lib)
> + ("cups" ,cups)
> + ("fontconfig" ,fontconfig)
> + ("freetype" ,freetype)
> + ("giflib" ,giflib)
> + ("lcms" ,lcms)
> + ("libelf" ,libelf)
> + ("libjpeg" ,libjpeg)
> + ("libice" ,libice)
> + ("libpng" ,libpng)
> + ("libx11" ,libx11)
> + ("libxcomposite" ,libxcomposite)
> + ("libxi" ,libxi)
> + ("libxinerama" ,libxinerama)
> + ("libxrender" ,libxrender)
> + ("libxt" ,libxt)
> + ("libxtst" ,libxtst)))
> + (native-inputs
> + `(("icedtea-8" ,icedtea-8)
> + ("icedtea-8:jdk" ,icedtea-8 "jdk")
> + ("unzip" ,unzip)
> + ("which" ,which)
> + ("zip" ,zip)))
> + (home-page "http://openjdk.java.net/projects/jdk9/")
> + (synopsis "Java development kit")
> + (description
> + "This package provides the Java development kit OpenJDK.")
> + (license license:gpl2+)))
> +
> (define-public icedtea icedtea-8)
>
>
> --
> 2.18.0
>
> From b91996c2c84581253f113e5fc81ab0e32b3ad4ce Mon Sep 17
> 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Wed, 10 Oct 2018 22:29:50 +0200
> Subject: [PATCH 2/2] gnu: Add openjdk10.
>
> * gnu/packages/java.scm (openjdk10): New variable.
> ---
> gnu/packages/java.scm | 35 +++++++++++++++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
>
> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
> index e53168713..36d7fcb2c 100644
> --- a/gnu/packages/java.scm
> +++ b/gnu/packages/java.scm
> @@ -1795,6 +1795,41 @@ new Date();"))
> "This package provides the Java development kit OpenJDK.")
> (license license:gpl2+)))
>
> +(define-public openjdk10
> + (package
> + (inherit openjdk9)
> + (name "openjdk")
> + (version "10+46")
> + (source (origin
> + (method url-fetch)
> + (uri
> "http://hg.openjdk.java.net/jdk/jdk/archive/6fa770f9f8ab.tar.bz2")
> + (file-name (string-append name "-" version
> ".tar.bz2"))
> + (sha256
> + (base32
> +
> "0zywq2203b4hx4jms9vbwvjcj1d3k2v3qpx4s33729fkpmid97r4"))))
> + (arguments
> + (substitute-keyword-arguments (package-arguments
> openjdk9)
> + ((#:phases phases)
> + `(modify-phases ,phases
> + (replace 'configure
> + (lambda* (#:key inputs outputs
> #:allow-other-keys)
> + (invoke "bash" "./configure"
> + (string-append "--with-freetype="
> (assoc-ref inputs "freetype"))
> + "--disable-freetype-bundling"
> + "--disable-warnings-as-errors"
> + "--disable-hotspot-gtest"
> + "--with-giflib=system"
> + "--with-libjpeg=system"
> + "--with-native-debug-symbols=zipped"
> + (string-append "--prefix=" (assoc-ref
> outputs "out")))
> + #t))))))
> + (native-inputs
> + `(("openjdk9" ,openjdk9)
> + ("openjdk9:jdk" ,openjdk9 "jdk")
> + ("unzip" ,unzip)
> + ("which" ,which)
> + ("zip" ,zip)))))
> +
> (define-public icedtea icedtea-8)
>
>

Hi Julien,

Could you, or somebody, perhaps explain to me what the difference
between the IcedTea distribution and OpenJDK is?


--
Brett M. Gilio
Free Software Foundation, Member
https://gnu.org/s/guix/| https://emacs.org
J
J
Julien Lepiller wrote on 11 Oct 2018 10:23
(name . Brett Gilio)(address . brettg@posteo.net)(address . 33008@debbugs.gnu.org)
8f40672032e45bfaa5c513fbd28e877c@lepiller.eu
Toggle quote (5 lines)
> Hi Julien,
>
> Could you, or somebody, perhaps explain to me what the difference
> between the IcedTea distribution and OpenJDK is?

OpenJDK is the free software version of Oracle's (or Sun's) JDK. It used
to lack a few components to be buildable and runnable with only free
software, and was a collection of separate components that were hard to
build. IcedTea is a project to build a coherent collection of these
components, and it also implemented a few missing components. IcedTea is
only available for Java 6 to 8. From java 9, oracle did provide enough
free software components and buildable sources, so we can build OpenJDK
without a project like IcedTea.

D
D
Danny Milosavljevic wrote on 11 Oct 2018 10:48
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 33008@debbugs.gnu.org)
20181011104855.7539e01f@scratchpost.org
Hi Julien,

do you know how to find javadoc in icedtea? After I invoked
"guix build -S icedtea" I only got some kind of meta builder which mentions
javadoc in copy-files.txt but does not actually directly have it.

(I want to fix the reproducibility problem in javadoc-generated output)

Maybe openjdk has the same problem (current timestamp in comment in generated
html). It's easy to find using "guix build --rounds=2" in the doc output.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlu/DncACgkQ5xo1VCww
uqVVGAf/fWuaZ1dfOwPwXb+Z2l2K2qE3jvc5onn62or3K7Q5woNPa2wGHS4E9WSa
pdnFX83wYFfzphbDBaB3ZdcBsHXRUpnWmNy1KXlIo7+eV+c0WMY29dMrd5MCLGvp
3qXbfv4MByE0MNFIz3MzVNMPdVEdJjjNwFF8LXLLBhEXG4320W8OzGjg4HCF+nZU
Ep74Q5gNJQxFBNn6MNsrmyHEmCJBa87Kyfs3BmcOtItdLlSPuYcYWyUQn5cP3uVw
QLsfifSTgaP2ChgZOyu0d8LdsZl0PjUBxOUV7XBkAzUbBoMf4PlkF8pKOE2rUBeh
KuJ0s3IbgEoIywYLwiAN3FKpyotdew==
=w9+a
-----END PGP SIGNATURE-----


J
J
Julien Lepiller wrote on 11 Oct 2018 11:27
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 33008@debbugs.gnu.org)
a76e66127c08d7dd3854c4ef1bc71e86@lepiller.eu
Le 2018-10-11 10:48, Danny Milosavljevic a écrit :
Toggle quote (14 lines)
> Hi Julien,
>
> do you know how to find javadoc in icedtea? After I invoked
> "guix build -S icedtea" I only got some kind of meta builder which
> mentions
> javadoc in copy-files.txt but does not actually directly have it.
>
> (I want to fix the reproducibility problem in javadoc-generated output)
>
> Maybe openjdk has the same problem (current timestamp in comment in
> generated
> html). It's easy to find using "guix build --rounds=2" in the doc
> output.

Sorry, I have no idea. Javadoc is built in icedtea, but I don't know how
it is invoked.
B
B
Björn Höfling wrote on 18 Oct 2018 13:57
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 33008@debbugs.gnu.org)
20181018135718.66615cec@alma-ubu
On Wed, 10 Oct 2018 23:40:59 +0200
Julien Lepiller <julien@lepiller.eu> wrote:

Toggle quote (6 lines)
> Hi, here are two patches that add openjdk9 and openjdk10. The patches
> must be applied on top of core-updates (or master once core-updates is
> merged) because of an issue with gcc on master. I haven't tested them
> too much, and they were probably too easy to build, so I wouldn't be
> surprised if we found something bad in them.

Hi Julien,

thanks for caring about JDK! I'm positively surprised that it works
without any Icedtea-efford. The package definition doesn't look too
complicated and it doesn't take too much time to build. And, no, I
haven't found something awfully "bad" in there :-)

I could even play with the module system and build my own mini-JRE with
only the core modules. I wonder if this new feature of JDK9 would be
useful in Guix one day.

It builds reproducibly, besides from the docs. Maybe we can fix
that with the newest Icedtea patch from Gabor? I haven't yet looked
into that patch.

Version:
(version "9+181")

Where does that "+181" come from? When I look here:


I find 9.0.1 and 9.0.4. But maybe that's the versioning of the
precompiled releases?

Also, the "+" is not very user-friendly:

./pre-inst-env guix build openjdk@9
guix build: error: openjdk: package not found for version 9

Whereas for icedtea I'm used to say: guix build icedtea@1

When I temporarily change that to "9.181" it works. I think there was
some functionality within the "@"-logic that matches versions modulo
dots. You get what I mean?

Also, as I don't know where the version comes from, I couldn't check
weather this one is the latest or not.

[] Binaries included? If yes, created a snipped?
find . -name "*.rar" -or -name "*.pdf" -or -name "*.bin" -or -name "*.pdf" -or -name "*.dsy" -or -name "*.jar" -or -name "*.exe"

There is one exe, many test jars. Two test bins,
and two jars in the main:

find hotspot/src/ -name "*.jar"
hotspot/src/share/tools/IdealGraphVisualizer/branding/modules/org-netbeans-core-windows.jar
hotspot/src/share/tools/IdealGraphVisualizer/branding/core/core.jar

But that looks like being part of some tool anyway.

Can you strip some/all away? I haven't investigated further. As we are
currently not running any tests, stripping away the test jars should be
fine.

Is there a reason you removed this phase:
(delete 'patch-source-shebangs)

Homepage: Use HTTPS
Donload-URL: Use HTTPS

License: I think you missed the classpath thing, cmp. IcedTea:

;; IcedTea is released under the GPL2 + Classpath exception, which is the
;; same license as both GNU Classpath and OpenJDK.

When I check with licencechecker there are some files under BSD-3:

nashorn/samples/*
jdk/make/netbeans/*
jdk/src/demo/*
test/fmw/gest/include/gtest/internal/*

though I'm not sure if they are relevant, as they all are in "test" or
"make" or "demo".

Björn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlvIdR4ACgkQvyhstlk+X/1IeACePV8aFk32fm/JS8foh+d7ViSW
OTgAn0VXFi354p9zzAJMMOLa3tfxFtpr
=D1dU
-----END PGP SIGNATURE-----


J
J
Julien Lepiller wrote on 18 Oct 2018 16:06
(name . Björn Höfling)(address . bjoern.hoefling@bjoernhoefling.de)(address . 33008@debbugs.gnu.org)
4bb98def64df6bad5d7c2c320638ab27@lepiller.eu
Le 2018-10-18 13:57, Björn Höfling a écrit :
Toggle quote (34 lines)
> On Wed, 10 Oct 2018 23:40:59 +0200
> Julien Lepiller <julien@lepiller.eu> wrote:
>
>> Hi, here are two patches that add openjdk9 and openjdk10. The patches
>> must be applied on top of core-updates (or master once core-updates is
>> merged) because of an issue with gcc on master. I haven't tested them
>> too much, and they were probably too easy to build, so I wouldn't be
>> surprised if we found something bad in them.
>
> Hi Julien,
>
> thanks for caring about JDK! I'm positively surprised that it works
> without any Icedtea-efford. The package definition doesn't look too
> complicated and it doesn't take too much time to build. And, no, I
> haven't found something awfully "bad" in there :-)
>
> I could even play with the module system and build my own mini-JRE with
> only the core modules. I wonder if this new feature of JDK9 would be
> useful in Guix one day.
>
> It builds reproducibly, besides from the docs. Maybe we can fix
> that with the newest Icedtea patch from Gabor? I haven't yet looked
> into that patch.
>
> Version:
> (version "9+181")
>
> Where does that "+181" come from? When I look here:
>
> https://jdk.java.net/archive/
>
> I find 9.0.1 and 9.0.4. But maybe that's the versioning of the
> precompiled releases?

This page says the binary comes from the tag jdk-9.0.4+12, but there
is no such tag in the repository here:


But maybe I'm not looking at the right place?

Toggle quote (12 lines)
>
> Also, the "+" is not very user-friendly:
>
> ./pre-inst-env guix build openjdk@9
> guix build: error: openjdk: package not found for version 9
>
> Whereas for icedtea I'm used to say: guix build icedtea@1
>
> When I temporarily change that to "9.181" it works. I think there was
> some functionality within the "@"-logic that matches versions modulo
> dots. You get what I mean?

Ok, I'll change the version number to 9.181.

Toggle quote (4 lines)
>
> Also, as I don't know where the version comes from, I couldn't check
> weather this one is the latest or not.

It's the latest tag in the list and I don't expect any new release now.

Toggle quote (18 lines)
>
> [] Binaries included? If yes, created a snipped?
> find . -name "*.rar" -or -name "*.pdf" -or -name "*.bin" -or -name
> "*.pdf" -or -name "*.dsy" -or -name "*.jar" -or -name "*.exe"
>
> There is one exe, many test jars. Two test bins,
> and two jars in the main:
>
> find hotspot/src/ -name "*.jar"
> hotspot/src/share/tools/IdealGraphVisualizer/branding/modules/org-netbeans-core-windows.jar
> hotspot/src/share/tools/IdealGraphVisualizer/branding/core/core.jar
>
> But that looks like being part of some tool anyway.
>
> Can you strip some/all away? I haven't investigated further. As we are
> currently not running any tests, stripping away the test jars should be
> fine.

I'll try that, thanks for noticing :)

Toggle quote (24 lines)
>
> Is there a reason you removed this phase:
> (delete 'patch-source-shebangs)
>
> Homepage: Use HTTPS
> Donload-URL: Use HTTPS
>
> License: I think you missed the classpath thing, cmp. IcedTea:
>
> ;; IcedTea is released under the GPL2 + Classpath exception, which is
> the
> ;; same license as both GNU Classpath and OpenJDK.
>
> When I check with licencechecker there are some files under BSD-3:
>
> nashorn/samples/*
> jdk/make/netbeans/*
> jdk/src/demo/*
> test/fmw/gest/include/gtest/internal/*
>
> though I'm not sure if they are relevant, as they all are in "test" or
> "make" or "demo".
>
> Björn
J
J
Julien Lepiller wrote on 1 Nov 2018 21:43
(address . 33008-done@debbugs.gnu.org)
20181101214358.1c255eb3@lepiller.eu
Le Wed, 10 Oct 2018 23:40:59 +0200,
Julien Lepiller <julien@lepiller.eu> a écrit :

Toggle quote (6 lines)
> Hi, here are two patches that add openjdk9 and openjdk10. The patches
> must be applied on top of core-updates (or master once core-updates is
> merged) because of an issue with gcc on master. I haven't tested them
> too much, and they were probably too easy to build, so I wouldn't be
> surprised if we found something bad in them.

Pushed to core-updates with some modifications: I removed bundled
binaries in a snippet and re-enabled the patch-source-shebangs phase.
One of the files should not have been modified though, so I added a
phase to reverse the shebang of that file.
Closed
?