Some resources to review:
Explore bootstrappability of Gradle #5
Investigating https://github.com/laura240406/lauras-channel/blob/master/laura/packages/gradle.scm; so far I can't get the common-cli-1.0 dependency to build, e.g.:
(define-public java-commons-cli-1.0
(package
(inherit java-commons-cli-1.2)
(version "1.0")
(source
(origin
(method url-fetch)
(uri (string-append "https://archive.apache.org/dist/commons/cli/old/v"
version "/commons-cli-" version "-src.tar.gz"))
(sha256
(base32 "1j4fwmd2647qdvrk7501g0k2cgcbm4hrj3gkg5b9ssl91j2z0jzs"))))))
=>
starting phase `build'
Buildfile: /tmp/guix-build-java-commons-cli-1.0.drv-0/commons-cli-1.0/build.xml
compile:
[mkdir] Created dir: /tmp/guix-build-java-commons-cli-1.0.drv-0/commons-cli-1.0/build/classes
[javac] Compiling 31 source files to /tmp/guix-build-java-commons-cli-1.0.drv-0/commons-cli-1.0/build/classes
[javac] /tmp/guix-build-java-commons-cli-1.0.drv-0/commons-cli-1.0/src/java/org/apache/commons/cli/TypeHandler.java:69: error: package org.apache.commons.lang does not exist
[javac] import org.apache.commons.lang.NumberUtils;
[javac] ^
[javac] /tmp/guix-build-java-commons-cli-1.0.drv-0/commons-cli-1.0/src/java/org/apache/commons/cli/TypeHandler.java:178: error: cannot find symbol
[javac] return NumberUtils.createNumber(str);
[javac] ^
[javac] symbol: variable NumberUtils
[javac] location: class TypeHandler
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 2 errors
BUILD FAILED
/tmp/guix-build-java-commons-cli-1.0.drv-0/commons-cli-1.0/build.xml:1: Compile failed; see the compiler error output for details.
Total time: 0 seconds
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "ant" arguments: ("jar") exit-status: 1 term-signal: #f stop-signal: #f>
phase `build' failed after 0.4 seconds
command "ant" "jar" failed with status 1
I think I can probably use java-commons-cli-1.2, already packaged in Guix instead. I then get:
[ivy:cachepath] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:cachepath] :: UNRESOLVED DEPENDENCIES ::
[ivy:cachepath] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:cachepath] :: org.apache.ivy#ivy;2.0.0.beta2_20080305165542: not found
[ivy:cachepath] :: org.apache.ant#ant-launcher;1.7.0: not found
[ivy:cachepath] :: org.apache.ant#ant-junit;1.7.0: not found
[ivy:cachepath] :: commons-io#commons-io;1.3.1: not found
[ivy:cachepath] :: commons-lang#commons-lang;2.3: not found
[ivy:cachepath] :: commons-httpclient#commons-httpclient;3.0: not found
[ivy:cachepath] :: slide#webdavlib;2.0: not found
[ivy:cachepath] :: ch.qos.logback#logback-classic;0.9.8: not found
[ivy:cachepath] :: org.tmatesoft.svnkit#svnkit;1.1.6: not found
[ivy:cachepath] :: org.tmatesoft.svnkit#svnkit-javahl;1.1.6: not found
[ivy:cachepath] ::::::::::::::::::::::::::::::::::::::::::::::
Gradle 5.1.1 is now building successfully from the wip-gradle branches of our guix-more and guix forks. So far I've:
- gotten the relevant parts of guix-more working with guix master (adjusting for guix changes since 2021)
- completed roptat's work on a gradle 4.9.0 -> 5.1.1 upgrade (~1y newer)
- packaged several new subprojects and updated existing subprojects for the upgrade
- restored/added several old java dependencies, notably groovy 2.x
Build from within a Guix checkout with: ./pre-inst-env env GUIX_PACKAGE_PATH=/path/to/guix-more guix build gradle
The current changes are the minimum necessary to build Gradle. The result isn't useful on its own yet:
% /gnu/store/8kcdwbdmwlk0d5jxik47cr405r3rydjz-gradle-5.1.1/bin/gradle --version
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/gradle/launcher/GradleMain has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access100ドル(URLClassLoader.java:74)
at java.net.URLClassLoader1ドル.run(URLClassLoader.java:369)
at java.net.URLClassLoader1ドル.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)
zsh: exit 1 /gnu/store/8kcdwbdmwlk0d5jxik47cr405r3rydjz-gradle-5.1.1/bin/gradle --version
The next step is to resolve these class-file version mismatch errors (from packages being built with various JDK versions), after which we'll likely run into problems similar to the ones noted by Julien from their original Gradle 4.9.0 work.
(Hours logged are from W48 -- today)
gradle --version runs successfully with more dependencies accessible and some Kotlin integration patched out. There are missing runtime dependencies preventing a full project build from starting.
~/src/drongo(master)% /gnu/store/l8w6snczbw3avgpkxcmnxrl7xdp64kmj-gradle-5.1.1/bin/gradle --version
------------------------------------------------------------
Gradle 5.1.1
------------------------------------------------------------
Build time: 1971年01月01日 00:00:00 UTC
Revision: cf7821a6f79f8e2a598df21780e3ff7ce8db2b82
Kotlin DSL: 5.1.1
Kotlin: 1.3.11
Groovy:
Ant: Apache Ant(TM) version 1.9.15 compiled on November 21 2025
JVM: 9-internal (Oracle Corporation 9-internal+0-adhoc..source)
OS: Linux 6.17.0-nonfree amd64
~/src/drongo(master)% /gnu/store/l8w6snczbw3avgpkxcmnxrl7xdp64kmj-gradle-5.1.1/bin/gradle --no-daemon --stacktrace jar
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type ClassLoaderRegistry using GlobalScopeServices.createClassLoaderRegistry().
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.internal.service.ServiceCreationException: Could not create service of type ClassLoaderRegistry using GlobalScopeServices.createClassLoaderRegistry().
[...]
at org.gradle.launcher.GradleMain.main(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Cannot find JAR 'hamcrest-core-1.3.jar' required by module 'gradle-testing-jvm' using classpath or distribution directory '/gnu/store/l8w6snczbw3avgpkxcmnxrl7xdp64kmj-gradle-5.1.1'
at org.gradle.api.internal.classpath.DefaultModuleRegistry.findDependencyJar(Unknown Source)
[...]
Collecting some information from Debian packaging for reference:
- Debian is at v4.4: https://salsa.debian.org/java-team/gradle and https://tracker.debian.org/pkg/gradle
- open (and not active?) PR for v8.11: https://salsa.debian.org/java-team/gradle/-/merge_requests/12; I also didn't find any discussion or information about this or other efforts in Debian, but maybe I don't know where to look (does seem rather slow or dead for a year)
- the
debian/patchesdirectory probably the most interesting pieces we could use https://salsa.debian.org/jpd/gradle/-/tree/upgrade-to-8.11.1/debian/patches (very different from v4 set); see also the more readable list here https://udd.debian.org/patches.cgi?src=gradle&version=4.4.1-22 - regarding above error for hamcrest, I can see references to providing a Debian artifact for this dependency, e.g. https://salsa.debian.org/jpd/gradle/-/blob/upgrade-to-8.11.1/debian/patches/verification-metadata.patch in the v8 PR (might not be needed in Debian's v4 as I didn't see something similar there)
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?