From 78789cb6e26b59b3fb863854b7c8d99401dc7620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 21 Apr 2021 12:53:54 +0200 Subject: [PATCH] gnu: openjdk: Disallow references to the JDK used for build. This ensures JDKs don't unintentionally keep references to the one used to build them, as reported at and fixed by 97a43db8b4416a1450aa61737edba9cf4126cf1c. * gnu/packages/java.scm (icedtea-8)[arguments]: Add #:disallowed-references. (openjdk9)[arguments]: Likewise. (openjdk10)[arguments]: Likewise. (openjdk11)[arguments]: Likewise. --- gnu/packages/java.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 3cd976685c..8a1ba5f262 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1749,6 +1749,9 @@ (define-public icedtea-8 ((guix build ant-build-system) (guix build syscalls) ,@%gnu-build-system-modules) + + #:disallowed-references ((,icedtea-7 "jdk")) + ,@(substitute-keyword-arguments (package-arguments icedtea-7) ((#:modules modules) `((guix build utils) @@ -1902,6 +1905,9 @@ (define-public openjdk9 #:imported-modules ((guix build syscalls) ,@%gnu-build-system-modules) + + #:disallowed-references (,icedtea-8 (,icedtea-8 "jdk")) + #:phases (modify-phases %standard-phases (add-after 'patch-source-shebangs 'fix-java-shebangs @@ -2097,7 +2103,9 @@ (define-public openjdk10 "--with-libjpeg=system" "--with-native-debug-symbols=zipped" (string-append "--prefix=" (assoc-ref outputs "out"))) - #t)))))) + #t)))) + ((#:disallowed-references _ '()) + `(,openjdk9 (,openjdk9 "jdk"))))) (native-inputs `(("openjdk9" ,openjdk9) ("openjdk9:jdk" ,openjdk9 "jdk") @@ -2127,6 +2135,9 @@ (define-public openjdk11 (arguments `(#:imported-modules ((guix build syscalls) ,@%gnu-build-system-modules) + + #:disallowed-references (,openjdk10 (,openjdk10 "jdk")) + #:tests? #f; requires jtreg ;; TODO package jtreg #:configure-flags