!aRKdLCkUeIFjRPZuJT:nixos.org

NixOS JVM

133 Members
28 Servers

Load older messages


SenderMessageTime
6 May 2026
@britter:yatrix.orgBenedikt Ritter (britter)Thanks for providing those links. I've been part of the other side of the franken gradle discussion. The Gradle team just doesn't see any value in providing a bootstrap that is binary free. Especially since they've navigated themselves so deeply into a pkace where it's impossible recreate that chain: another layer of this issue is the gradle wrapper which is a binary checked into the repository that downloads a gradle version of a particular version. During development (and sometimes even when releasing milestones or RCs) they used to use snapshot distribution in order to dog food new features in their own build. Unfortunately distribution snapshots are evicted from the store after a period of time. So nowadays when you check out an old commit you can't even build it without modification 🤷‍♂️05:57:24
@britter:yatrix.orgBenedikt Ritter (britter)I don't think the situation with maven is much better since it also builds with itself.05:57:50
@msgilligan:matrix.orgmsgilliganThe Debian developer that works on Gradle works very hard and never gives up. But he's still stuck at 4.4.1. I periodically read his reports. I think Maven can be built from earlier versions which can be built from source.06:01:25
@britter:yatrix.orgBenedikt Ritter (britter) I wonder if coming from old versions is the right approach here. maybe it's better to start from a recent version and try to generate a shell script that calls the java compiler on the various Gradle subprojects in the right order so create something that behaves like Gradle. Lets call this Bootstrap Gradle. Then you use that so run the real gradle distribution build.
Of course you need to somehow put Scala and Kotlin in the mix. But I think you could leave the former out in order to build the Bootstrap Gradle.
06:07:59
@msgilligan:matrix.orgmsgilligan My understanding is that Kotlin has very similar issues to Gradle. Although I generally prefer Gradle to Maven, I have decided that I want to move important/foundational/library projects (for me bitcoinj and secp256k1-jdk) from Gradle to Maven. But when you have Gradle working it's easy to put of the conversion and work on new features or cleaning up the actual Java code. But I expect both projects to move by the end of the year. 06:14:15
@msgilligan:matrix.orgmsgilliganThe other bootstrappability thing I need to learn how to do (with Nix) is pull in Java libraries built from source into the dependency chain. secp256k1-jdk has only 3 build-time/run-time dependencies: JSpecify and either Bouncy Castle or libsecp256k1 (C library) depending upon which run-time implementation you choose. (lib) secp256k1 is already in Nix and built from source. JSpecify is there, but with binary provenance. Bouncy Castle is not in Nixpkgs at all. So it seems doable. It's not on the top of my list, but maybe it will happen by the end of the year or early next year. 06:28:03
@msgilligan:matrix.orgmsgilliganHas anyone built or seen a Nixpkgs Java package that pulls one/some/all JAR dependencies from Nixpkgs rather than Maven Central?06:29:55
@msgilligan:matrix.orgmsgilligan(And both JSpecify and Bouncy Castle use Gradle for their builds so there would still be some binary turtles in there.)06:38:22
@britter:yatrix.orgBenedikt Ritter (britter)if the ability to bootstrap is a big concern to you then maven if probably an easier toolchain than Gradle. Although it's still not trivial.06:53:35
@britter:yatrix.orgBenedikt Ritter (britter)Regarding building Java from source: There are two things I've been thinking of. 1) a buildJava hook that can build a java application from source without going through another build tool. That would be great by itself to write small utilities in Java. 2) Far more complicated: providing a way to inject jars build by Nix into the dependency FODs of Maven or Gradle. I don't think either supports this. But it's probably what you need.06:55:24
@britter:yatrix.orgBenedikt Ritter (britter)Based on that we could have a java packages set like we have for python where you can essentially build the whole (java) dependency chain from source.06:56:09
@britter:yatrix.orgBenedikt Ritter (britter)Nice weekend project, I'd say.06:56:21
@msgilligan:matrix.orgmsgilliganIt looks like there is a mechanism to do something close to this with Ant: https://nixos.org/manual/nixpkgs/stable/#sec-language-java07:09:39
@msgilligan:matrix.orgmsgilliganI assume you are being sarcastic, but I don't know. You are an amazing developer.07:10:55
@msgilligan:matrix.orgmsgilliganI think approach 1 would be fun to build and would be a useful tool/hook for others, but for external projects would essentially require maintaining a parallel build.07:13:28
@msgilligan:matrix.orgmsgilligan* I think approach 1 would be fun to build and would be a useful tool/hook for others (for some subset of use-cases), but for external projects it would essentially require maintaining a parallel build.07:14:55
@msgilligan:matrix.orgmsgilliganThis blog post also seems relevant: https://fzakaria.com/2025/04/02/nix-that-looks-like-bazel07:39:08
@britter:yatrix.orgBenedikt Ritter (britter)Yes, this would only be for orgs that work in a mono repo where nix is the build tool that drives everything and they just have a few java things. I think if your going polyglot nix is probably your best bet 🤷‍♂️08:07:04
@britter:yatrix.orgBenedikt Ritter (britter)It's nice for you to say this, thank you. Honestly I often feel like I have no idea what I'm doing. I just ask a lot of silly questions to people that know more than I do.08:08:07
@britter:yatrix.orgBenedikt Ritter (britter)Imposter syndrome hits hard, I guess.08:08:23
@msgilligan:matrix.orgmsgilligan

I just ask a lot of silly questions to people that know more than I do.

That's what I'm doing right now.

08:09:04
@britter:yatrix.orgBenedikt Ritter (britter)

Nixpkgs already has this great concept that any JAR placed in share/java gets automatically added to the CLASSPATH during compilation in a mkDerivation.

What??? TIL

08:10:53
@msgilligan:matrix.orgmsgilliganIt's late here, so I'm going to call it a night. As far as Nixpkgs go, I need to do some updating to my machine so I can run tests, then I want to try to review some PRs and try to submit a few PRs to update some of the JDKs that need updates (e.g. Zulu) After that I should probably try adding a build-from-source package (using the Bouncy Castle Gradle build.) Baby steps...08:11:55
@britter:yatrix.orgBenedikt Ritter (britter)This was a great read. Thank you for sharing it!08:12:41
@msgilligan:matrix.orgmsgilligan

What??? TIL

I think this is mentioned in the Ant section of the Nixpkgs manual that I linked above.

08:12:59
@msgilligan:matrix.orgmsgilliganFarid lives in the same town as me and I met him at Planet Nix last year. He's awesome and has some awesome blogs and posts.08:13:41
@msgilligan:matrix.orgmsgilliganRedacted or Malformed Event08:15:44
@britter:yatrix.orgBenedikt Ritter (britter)All these little tricks that you need to know with nixpks... it's crazy. Like last week I learned about versionCheckHook. So now I need to replace a bunch of passthru.tests.version things 😅08:19:26
@britter:yatrix.orgBenedikt Ritter (britter)I gave packaging a java app using GraalVM via Nix a spin this week and wrote about what I learned here: https://britter.dev/blog/2026/05/06/jfmt-nixvim/09:23:33
@msgilligan:matrix.orgmsgilligan * 13:46:37

Show newer messages


Back to Room ListRoom Version: 6