Skip to content

Prepend to the system search path instead of overriding it#818

Open
cuttestkittensrule wants to merge 5 commits intowpilibsuite:mainfrom
cuttestkittensrule:fix-ld-library-path
Open

Prepend to the system search path instead of overriding it#818
cuttestkittensrule wants to merge 5 commits intowpilibsuite:mainfrom
cuttestkittensrule:fix-ld-library-path

Conversation

@cuttestkittensrule
Copy link

@cuttestkittensrule cuttestkittensrule commented Feb 14, 2026

  • Prepend the ldpath to LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, and DYLD_FALLBACK_LIBRARY_PATH
  • Don't put the original environment variable in the new one if the environment variable is not set
    • To ensure that the path environment variable doesn't contain null if the environment variable wasn't set

@ThadHouse
Copy link
Member

I'm not sure we actually want to do this. And if we did, we'd want it to be prepended instead of appended.

Do you have a use case that needs this?

@cuttestkittensrule
Copy link
Author

There are some GradleRIO tasks that reference system libraries (like running the simulation GUI requiring GTK). If these libraries aren't on the default search path, then LD_LIBRARY_PATH would be needed to get the library found by ld, so that the library can be resolved. This isn't really a problem on most Linux distributions, but it is a problem on NixOS, where libraries aren't on the normal search path for ld due to how the filesystem is layed out. If the ldpath is added to LD_LIBRARY_PATH, then it becomes relatively simple on NixOS to get GTK resolved, allowing the simulation GUI to open up.
If the original path should be prepended instead of appended, should the new java.library.path also be changed to be prepended instead of appended in this file?

@ThadHouse
Copy link
Member

We don't support NixOS. We could potentially be ok with an optional off by default flag to do this, but this is not something we would want to be on by default.

@cuttestkittensrule cuttestkittensrule changed the title Append to the system search path instead of overriding it Prepend to the system search path instead of overriding it Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants