-
Notifications
You must be signed in to change notification settings - Fork 12
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
Compatibility with neverlink
#243
Comments
This probably involves switching to |
13 tasks
sgammon
added a commit
that referenced
this issue
Jan 14, 2024
- add transitive inputs for compile-time jars - mark applicable dependencies with `neverlink` Relates-To: #243 Signed-off-by: Sam Gammon <sam@elide.ventures>
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In rare cases, a
native-image
target needs various JARs available at native compile time only, so classes can be referenced for compile-time directive mechanisms like GraalVM Features.Most of the time these dependencies are inert on the compile or runtime classpath; because they export no usable functionality, directive classes are typically compiled out early and do not end up in the final binary. Keeping them on the classpath, then, is normally fine.
The problem arises when directive classes such as
Feature
s depend on classes within the SVM API. Such dependencies are embedded within GraalVM in addition to being made available via Maven. Whennative-image
is invoked, these classes are present automatically, but before that step, when Bazel is building the regular java withjavac
, it won't be able to find those symbols.The user's first impulse is probably to add
@maven//:org_graalvm_nativeimage_svm
to theirdeps
, but this yields a nasty warning from thenative-image
compiler (and rightfully so, since these dependencies must always align perfectly if they are provided on the classpath or modulepath):The user may sensibly try
neverlink
next, but, because of this issue, the following surfaces:Now Bazel can find the dependency and build it with
javac
, but Bazel considersnative-image
a run-phase task (I think?), and so omits the entire dependency from the classpath.The text was updated successfully, but these errors were encountered: