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

.jnilib not loaded from the executable directory #6822

Open
kkriske opened this issue Jun 16, 2023 · 1 comment · May be fixed by #6823
Open

.jnilib not loaded from the executable directory #6822

kkriske opened this issue Jun 16, 2023 · 1 comment · May be fixed by #6823
Assignees
Labels

Comments

@kkriske
Copy link
Contributor

kkriske commented Jun 16, 2023

Describe the issue
As of #5932 native libs are loaded from the directory containing the native image. However on MacOS this only works for .dylib libraries and not for .jnilib because ClassLoaderHelper.mapAlternativeName is not considered for sysPath in this code:

String libname = System.mapLibraryName(name);
if (sysPath != null && loadLibrary0(new File(sysPath, libname), false)) {
return;
}
for (String path : usrPaths) {
File libpath = new File(path, libname);
if (loadLibrary0(libpath, false)) {
return;
}
File altpath = Target_jdk_internal_loader_ClassLoaderHelper.mapAlternativeName(libpath);
if (altpath != null && loadLibrary0(altpath, false)) {
return;
}
}

Steps to reproduce the issue
I don't have a minimal example, but the CI on this PR fails because of this: xerial/sqlite-jdbc#922

Describe GraalVM and your environment:

  • GraalVM version: GraalVM CE 17.0.7 and 20.0.1
  • OS: macos-latest on GitHub Actions

More details
N/A

@oubidar-Abderrahim
Copy link
Member

Thank you for reporting this.

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

Successfully merging a pull request may close this issue.

2 participants