-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Fix Java shared library path for darwin #11792
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
Conversation
ee481d6
to
7cab213
Compare
ec73fa4
to
a7136f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @viren-nadkarni for considering the macOS particularities here :)
I can confirm that this patch resolves the test failures in host mode (e.g., aws.services.events.test_events_patterns.TestEventPattern.test_event_pattern_with_escape_characters
) 🙌
""" | ||
if java_home := self.get_java_home(): | ||
if is_mac_os(): | ||
return os.path.join(java_home, "Contents", "Home", "lib", "jli", "libjli.dylib") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: any particular reason why we use pathlib (e.g., Path
and get_*_path
) and os.path interchangeably ?
(/
-separated pathlib.Path look a little more readable to me than ,
-separated os.path)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the old code uses os.path
, including the packaging library. I think it's nice to maintain the consistency but I don't see any issues with migrating everything to pathlib
together.
Background
In #11139 we started using Temurin builds for Java. All Java applications were explicitly configured to use these JREs, not OS ones.
On Mac OS, it was discovered that Jpype was failing to start, and this was affecting LocalStack development on Mac OS.
Changes
Mac builds of Temurin have a different directory structure. Furthermore the shared library usage is also different. On Linux, it is simply
libjvm.so
. On Darwin, there is a passthrough interface, the so-called Java launcher interface akalibjli.dylib
, which invokes the JVM.This PR ensures that the Java installer accounts for these differences.