3
0
Fork
You've already forked guix
0
forked from guix/guix

Explore bootstrappability of Gradle #5

Closed
opened 2025年11月26日 04:18:09 +01:00 by apteryx · 5 comments
Some resources to review: - https://github.com/laura240406/lauras-channel/blob/master/laura/packages/gradle.scm - https://framagit.org/tyreunom/guix-more/-/blob/master/more/packages/gradle.scm
apteryx added the due date 2025年12月01日 2025年11月26日 04:38:55 +01:00
Author
Owner
Copy link

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
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.: ```scheme (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 ```
apteryx stopped working 2025年12月02日 08:13:35 +01:00
1 hour 14 minutes
Author
Owner
Copy link

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] 		::::::::::::::::::::::::::::::::::::::::::::::
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] :::::::::::::::::::::::::::::::::::::::::::::: ```
apteryx stopped working 2025年12月02日 09:32:15 +01:00
59 minutes 20 seconds
apteryx added spent time 2025年12月03日 01:59:32 +01:00
30 minutes
apteryx added spent time 2025年12月03日 02:29:17 +01:00
30 minutes
lispwitch added spent time 2025年12月04日 02:51:24 +01:00
19 hours 30 minutes

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 5.1.1 is now building successfully from the wip-gradle branches of our [guix-more](https://codeberg.org/guixotic/guix-more/src/branch/wip-gradle) and [guix](https://codeberg.org/guixotic/guix/src/branch/wip-gradle) 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)
lispwitch added spent time 2025年12月04日 03:15:42 +01:00
45 minutes
lispwitch added spent time 2025年12月16日 03:35:23 +01:00
2 hours

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)
[...]
`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) [...] ```
lispwitch added spent time 2025年12月16日 04:02:08 +01:00
30 minutes

Collecting some information from Debian packaging for reference:

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/patches` directory 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)
podiki stopped working 2026年01月06日 17:07:38 +01:00
34 minutes 7 seconds
Sign in to join this conversation.
No Branch/Tag specified
master
add-taler-docs
update-gnunet
taler/add-exchange
add-vscode-langservers-extracted
add-forgejo-package-and-service
wip-sparrow-preview
guile-reinstate-gmp-support
keyring
add-gradle-importer-with-input-urls
sparrow20260401
wip-sparrow
fix-git-gettext
wip-gradle-build
jami-causing-shepherd-syslog-deadlock
icingaweb2-dominik-v1
icingaweb2-dominik-v2
wip-gradle-bootstrap
add-vcdimager
gradle
add-gtick
run-tests-in-pre-push
icecat-expose-gnu-store-in-sandbox
add-capabilities-support
wip-icingaweb2
parallel-langpacks
forgejo-in-container-with-make-systemd-constructor-fail-ipv6
gst-python-1.28.1-test-failures
sparrow20260122
v1.4.0+154701.013cc1952a8
v1.4.0+154511.1afbf48b25
base-for-issue-62196
v1.4.0
v1.4.0rc2
v1.4.0rc1
v1.3.0
v1.3.0rc2
v1.3.0rc1
v1.2.0
v1.2.0rc2
v1.2.0rc1
v1.1.0
v1.1.0rc2
v1.1.0rc1
bootstrap-20190815
v1.0.1
v1.0.0
v0.16.0
v0.15.0
v0.14.0
v0.13.0
v0.12.0
v0.11.0
v0.10.0
v0.9.0
v0.8.3
v0.8.2
v0.8.1
v0.8
v0.7
v0.6
v0.5
v0.4
v0.3
v0.2
v0.1
v0.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
3 participants
Notifications
Total time spent: 1 day 2 hours
apteryx
3 hours 13 minutes
podiki
34 minutes 7 seconds
lispwitch
22 hours 45 minutes
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

2025年12月01日

Dependencies

No dependencies set.

Reference
guixotic/guix#5
Reference in a new issue
guixotic/guix
No description provided.
Delete branch "%!s()"

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?