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

kt_jvm_test does not include native library paths in java.library.path #1088

Open
SanjayVas opened this issue Dec 9, 2023 · 2 comments
Open

Comments

@SanjayVas
Copy link

SanjayVas commented Dec 9, 2023

java_test collects the paths to native libraries from JavaInfo.transitive_native_libraries and specifies them in the java.library.path property. kt_jvm_test does not do this.

The current workaround if loading native libraries is to use a combination of java_test and kt_jvm_library instead. e.g.

kt_jvm_library(
    name = "my_test",
    srcs = ["MyTest.kt"],
)

java_test(
    name = "MyTest",
    test_class = "package.for.MyTest",
    runtime_deps = [":my_test"],
)
@restingbull
Copy link
Collaborator

Where are the native libraries coming from in the example?

@SanjayVas
Copy link
Author

SanjayVas commented Jan 8, 2024

Sorry, I guess I forgot to include that part in the workaround example. The native dep would be a shared library (cc_binary target with linkshared = True) specified in the deps of the library target.

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

2 participants