fix: Compilation error on default JDK8#41
Merged
Xuanwo merged 15 commits intoXuanwo:mainfrom Jan 6, 2026
Merged
Conversation
Contributor
Author
|
@Xuanwo I have fixed the CI checks, if needed I can split the changes |
EmilyFlarionIO
commented
Feb 6, 2025
| println!("cargo:rustc-link-search=native={jvm_path}"); | ||
|
|
||
| // Add JVM to rpath | ||
| println!("cargo:rustc-link-arg=-Wl,-rpath,{jvm_path}"); |
Contributor
Author
There was a problem hiding this comment.
Rust specs ensures this does not propagate upwards(unless it is a cdylib, which will then have this in its RPATH), so this is not a security concern, only relevant for tests and/or binaries from this crate.
It is also why we export the used path as metadata below, if another crate does need it, it can use it directly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This resolves an issue where header files are not found when compiling using the default JDK8 installation on Ubuntu(A problem which plague any JDK8 installation that does not set JAVA_HOME, I would presume), since
java-locatorwas searching for the Java Runtime binary, which on JDK8 was in thejresubfolder instead of the JDK root, whose bin folder only held a symlink.Using the
locate-jdk-onlyfeature,java-locatorsearches for thejavacbinary instead ofjava, which resolves this problem.In order to not break the build for systems that only have the JRE installed and just want to link against libhdfs, I've attached the
locate-jdk-onlyfeature to thevendoredfeature, where we would need the JDK anyway.This leaves an issue where the problem could still occur if libhdfs is not found and we only build it as a fallback, I've added a warning message there recommending enabling the "vendored" feature in case of header troubles.
You can read more in the java-locator PR:
astonbitecode/java-locator#7