Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle: apply libudev fix via gradle.properties #6326

Open
britter opened this issue Jan 16, 2025 · 1 comment
Open

gradle: apply libudev fix via gradle.properties #6326

britter opened this issue Jan 16, 2025 · 1 comment
Assignees

Comments

@britter
Copy link
Contributor

britter commented Jan 16, 2025

Port the fix from NixOS/nixpkgs#358670 so that it's applied via gradle.properties

Description

Gradle introduced a feature lately that required pkgs.udev to be available. While this was fixed in nixpkgs for installations managed via Nix, most users manage Gradle by means of the Gradle wrapper. The result of this is that installations managed by the Gradle wrapper still suffer from libudev not being available thus logging on each invocation:

Did not find udev library in operating system.
Some features may not work.

To fix this, the jna.library.path system property can be configured to include a reference to pkgs.udev. I've done this for my personal configuration here: britter/nix-configuration@21adf57
This fixes the issue for Gradle wrapper installation because they honor the configuration from $GRADLE_HOME/gradle.properties.

@britter
Copy link
Contributor Author

britter commented Jan 16, 2025

I've tried to add this, but failed to get the tests working. Obviously adding something to the settings attrSet of the gradle module will result in something always being written to gradle.properties. This makes the gradle-empty-settings test fail. I tried to fix that by stubbing udev the same way we stub other packages here. However stubbing udev causes the build to fail because other required libraries can't be built. So I end up not having a clue how to correctly test this.

Also I wonder how this should work for a user. I think we need to configure the settings freeform type to have systemProp.jna.library.path be a listOf package, so it composes in case the users adds additional libraries. I also wonder whether there should be a config flag to deactivate adding udev in case somebody does not want that (for whatever reason).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants