!aRKdLCkUeIFjRPZuJT:nixos.org

NixOS JVM

121 Members
27 Servers

Load older messages


SenderMessageTime
12 Jul 2025
@plan9better:matrix.orgplan9better joined the room.11:05:56
13 Jul 2025
@msgilligan:matrix.orgmsgilliganDoes anyone on this list have the ability to merge PR #421362 (above) ? It's a straightforward version bump and has 2 approvals.23:58:08
@softmoonworld:matrix.org@softmoonworld:matrix.org joined the room.23:58:56
14 Jul 2025
@softmoonworld:matrix.org@softmoonworld:matrix.orghas anyone had any luck with using nix-ld within the context of using a flake as a java dev env? I could use some clarity since I'm new to nixOS and flakes 00:10:44
@msgilligan:matrix.orgmsgilligan * Does anyone on this list have the ability to merge PR #421362 (above) ? It's a straightforward version bump and has 2 approvals. Update: it's been merged! 15:54:14
@softmoonworld:matrix.org@softmoonworld:matrix.org

i think i don't need to use a flake, i'm going to focus on working with nix-shell and ensuring LD_LIBRARY_PATH is path.

15:58:35
@msgilligan:matrix.orgmsgilligan Can you describe the big picture of what you are trying to do? Why do you want to use nix-ld? I have used a C library from Java in Flake-based dev shell, but it was already in Nixpkgs. I have not used nix-ld before and just now read what it is. Can you describe your use case a little? 16:03:13
@softmoonworld:matrix.org@softmoonworld:matrix.org

of course! i'm working on a codebase that is written in Java, and that requires me to install JVM and gradle as you know. But this project when running needs to dynamically load a libGL library. However when it does it can't seem to locate it. I believe that if LD_LIBRARY_PATH is set, it should be able to find it

16:36:39
@softmoonworld:matrix.org@softmoonworld:matrix.org

nix-ld seems to be a way to draw in from external libraries for compiling a package? I need to spend more time wrapping my head around it

16:37:13
@emilazy:matrix.orgemily just add autoAddDriverRunpath to nativeBuildInputs 16:40:36
@emilazy:matrix.orgemily the path to our libGL will be patched in to the built binary automatically 16:40:44
@emilazy:matrix.orgemily(if you are building inside Nix)16:40:49
@emilazy:matrix.orgemily nix-ld is really only there for running awkward third-party binaries 16:41:01
@softmoonworld:matrix.org@softmoonworld:matrix.org

ahh thank you for that! hmm

16:41:42
@emilazy:matrix.orgemily if you're doing interactive development, then you should be able to just set LD_LIBRARY_PATH to include the path in your development shell hook 16:41:51
@softmoonworld:matrix.org@softmoonworld:matrix.org

i don't think i'm building inside of nix, i'm using the command line tools for running gradle inside of the project repository which i think is part of why it's not finding everything

16:42:55
@emilazy:matrix.orgemily e.g. export LD_LIBRARY_PATH=${addDriverRunpath.driverLink} 16:42:56
@softmoonworld:matrix.org@softmoonworld:matrix.org

ahh i see. okay! i'm going to do that. thanks!

16:43:32
@emilazy:matrix.orgemily $LD_LIBRARY_PATH will be used at runtime so it works inside a shell even with a binary that doesn't get the path patched in, and autoAddDriverRunpath would handle baking it in if you want a package built in Nix to install systemwide etc. 16:44:30
@msgilligan:matrix.orgmsgilliganThanks @emily. I've been using a hackier solution. Is this documented somewhere?16:45:19
@emilazy:matrix.orgemilyumm, good question :) if it is, I don't know about it because of the documentation16:46:05
@emilazy:matrix.orgemilythe answer is, uh, it's mentioned in passing in the documentation for CUDA maintenance!16:46:54
@emilazy:matrix.orgemilyand some release notes16:47:02
@emilazy:matrix.orgemilyit's usually only relevant for third-party binaries16:47:43
@emilazy:matrix.orgemily since "normal" software just links directly to libGL 16:47:49
@emilazy:matrix.orgemily but stuff doing dlopen at runtime needs LD_LIBRARY_PATH/runpath fixups 16:48:12
@emilazy:matrix.orgemily also, I said autoAddDriverRunpath but it probably wouldn't work for Java programs you're not building into a native executable with Graal or something because of course you just end up with a .jar and some shell scripts around it… 16:48:43
@emilazy:matrix.orgemily you would probably actually want to makeWrapper … --prefix LD_LIBRARY_PATH : ${addDriverRunpath.driverLink}/lib instead 16:49:22
@emilazy:matrix.orgemily also this is missing a /lib, sorry :) 16:49:27
@softmoonworld:matrix.org@softmoonworld:matrix.org

:)

16:49:55

Show newer messages


Back to Room ListRoom Version: 6