A Poor Man's Solution to Gradle's Rich Console Issue on NixOS — Reproducible

1 Like

Why not just use auto-patchelf in your script instead of reimplementing part of it?

Libraries that already have a RUNPATH are left alone, so running it twice is harmless.

And what if the paths get garbage collected? Sounds like that’ll be an issue in the future. It should be fine to set every time as long as you’re only using --set-rpath.

Good catch! I’ve updated my script to always repatch if RUNPATH differs. I can’t use auto-patchelf here, because it’s a build hook, not a CLI that I can execute in my script. Or am I missing something?

1 Like

pkgs.autoPatchelfHook is a build hook that uses the pkgs.auto-patchelf CLI I linked. There’s actually probably not too much benefit in using it over your current setup, but it can be used outside of autoPatchelfHook.

You may also want to reflect these changes in the code snippet and pinned commit link in your blog post, FYI. Currently not only is the code block outdated, but the link to the directory in your nix-configuration repo is pinned to an older commit.

I’ve updated my blog post and also added another alternative that somebody on Mastodon suggested. Thanks again!

1 Like