guix_mirror_bot pushed a commit to branch gnome-team
in repository guix.

commit b90c274d1ba04a25865d56f279062d3927b89088
Author: Maxim Cournoyer <[email protected]>
AuthorDate: Fri Oct 23 11:54:52 2026 +0900

    gnu: openjdk11: Bootstrap with openjdk9.
    
    OpenJDK 10 has a bug that would frequently cause
    java.util.ConcurrentModificationException errors when building JDK 11.  This
    change removes it from the bootstrap chain.
    
    * gnu/packages/java.scm (openjdk11)
    [source]: Order patches.
    [#:configure-flags]: Add --with-boot-jdk.
    [#:phases] {adjust-for-bootstrap-version}: New.
    [native-inputs]: Replace openjdk10 with openjdk9.
    * gnu/packages/java.scm (openjdk17) [#:phases]
    {adjust-for-bootstrap-version}: Adjust phase.
    
    Fixes: #10850
---
 gnu/packages/java.scm | 36 ++++++++++++++++++++++++++++++++----
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index f02f02bce8a..327f6d8f392 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1217,9 +1217,9 @@ new Date();"))))
                (search-patches "openjdk-10-module3-reproducibility.patch"
                                "openjdk-10-module4-reproducibility.patch"
                                "openjdk-10-char-reproducibility.patch"
-                               "openjdk-11-classlist-reproducibility.patch"
                                "openjdk-10-jar-reproducibility.patch"
                                "openjdk-10-jtask-reproducibility.patch"
+                               "openjdk-11-classlist-reproducibility.patch"
                                "openjdk-currency-time-bomb2.patch"))))
     (build-system gnu-build-system)
     (outputs '("out" "jdk" "doc"))
@@ -1241,6 +1241,10 @@ new Date();"))))
       ;; TODO package jtreg
       #:configure-flags
       #~(list
+         (string-append "--with-boot-jdk="
+                        (dirname
+                         (dirname
+                          (search-input-file %build-inputs "bin/javac"))))
          "--disable-hotspot-gtest"      ;not currently running tests
          ;; Add flags for compilation with gcc >= 10.
          #$(string-append "--with-extra-cflags=-fcommon"
@@ -1271,6 +1275,20 @@ new Date();"))))
                         #$(this-package-input "freetype") "/lib"))
       #:phases
       #~(modify-phases %standard-phases
+          (add-after 'unpack 'adjust-for-bootstrap-version
+            (lambda _
+              ;; This allows building with non-standard bootstrap versions.
+              (let ((bootstrap-version #$(version-major
+                                          (package-version
+                                           (this-package-native-input
+                                            "openjdk")))))
+                (substitute* "make/autoconf/version-numbers"
+                  (("^(DEFAULT_ACCEPTABLE_BOOT_VERSIONS)=.*" _ var)
+                   (format #f "~a=~a~%" var bootstrap-version)))
+                (substitute* "make/autoconf/boot-jdk.m4"
+                  (("^(\\s*BOOT_JDK_SOURCETARGET)=.*" _ var)
+                   (format #f "~a=\"-source ~a -target ~a\"~%"
+                           var bootstrap-version bootstrap-version))))))
           (add-after 'patch-source-shebangs 'fix-java-shebangs
             (lambda _
               ;; This file was "fixed" by patch-source-shebangs, but it 
requires
@@ -1465,7 +1483,7 @@ new Date();"))))
            libxtst))
     (native-inputs
      (list autoconf
-           `(,openjdk10 "jdk")
+           `(,openjdk9 "jdk")
            pkg-config
            unzip
            which
@@ -1657,10 +1675,20 @@ blacklisted.certs.pem"
              (inherit (package-source base))
              (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"))))
    (arguments
-    (substitute-keyword-arguments (package-arguments base)
+    (substitute-keyword-arguments arguments
       ((#:implicit-inputs? _ #t) #t)    ;restore default
-      ((#:phases phases)
+      ((#:phases phases '%standard-phases)
        #~(modify-phases #$phases
+           (replace 'adjust-for-bootstrap-version
+             (lambda _
+               ;; This allows building with non-standard bootstrap versions.
+               (let ((bootstrap-version #$(version-major
+                                           (package-version
+                                            (this-package-native-input
+                                             "openjdk")))))
+                 (substitute* "make/conf/version-numbers.conf"
+                   (("^(DEFAULT_ACCEPTABLE_BOOT_VERSIONS)=.*" _ var)
+                    (format #f "~a=~a~%" var bootstrap-version))))))
            (replace 'fix-java-shebangs
              (lambda _
                ;; 'blacklisted' was renamed back to 'blocked'.

Reply via email to