-
Notifications
You must be signed in to change notification settings - Fork 278
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
support neverlink in scala_library #213
Comments
This seems pretty straightforward to implement (just involves a little fiddling with setting up the jar lists in the provider). There might be a little incongruence with java interop until can safely use the new bazel CLs. Do you know how to test it? |
Stephen,
Wdyt about sending a PR where the only blocker is that it uses bazel from
head?
Will enable to start flushing out problems.
…On Fri, 2 Jun 2017 at 21:56 Stephen Twigg ***@***.***> wrote:
This seems pretty straightforward to implement (just involves a little
fiddling with setting up the jar lists in the provider). There might be a
little incongruence with java interop until can safely use the new bazel
CLs.
Do you know how to test it?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#213 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF9_AdrF84w8nKmSoZBmtC1AKcD2Mks5sAFrvgaJpZM4Nupc6>
.
|
What is neverlink? |
https://bazel.build/versions/master/docs/be/java.html#java_library.neverlink Basically, when included, the jar is added to the compile path of dependents but not the runtime path or dependents (direct or transitive). @ittaiz yes, a situation using neverlink just hasn't come up for me yet so would be aided by advice on testing it. (I suppose I could fake it by creating a neverlink target (with stub implementation) and then a similar target identical one (same interface, real implementation) that is included as a runtime_dep?) |
The problem with testing neverlink is that the problem we're trying to
solve in the lead target is potential and order based on the classpath. If
the leaf will have the "correct" "linked" version first then there
shouldn't be a problem.
I have an idea which isn't very pretty but should work- have two targets
with different names implement the same interface (can be same
implementation) and assert in the test that only one of them is in the
classpath.
The downside to this test is that it doesn't demonstrate why it's a problem
but because the problem is tricky to reproduce (the order of loading the
jars) I think it's ok alongside a comment.
…On Sat, 3 Jun 2017 at 0:32 Stephen Twigg ***@***.***> wrote:
https://bazel.build/versions/master/docs/be/java.html#java_library.neverlink
Basically, when included, the jar is added to the compile path of
dependents but not the runtime path or dependents (direct or transitive).
@ittaiz <https://github.com/ittaiz> yes, a situation using neverlink just
hasn't come up for me yet so would be aided by advice on testing it. (I
suppose I could fake it by creating a neverlink target (with stub
implementation) and then a similar target identical one (same interface,
real implementation) that is included as a runtime_dep?)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#213 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF302s3xPwW--w9lQGGG3GY5ukUVJks5sAH9YgaJpZM4Nupc6>
.
|
Do we have any progress on this ? It'd be very useful to strip down jars of Spark jobs. |
FWIW, we had the spark use case and were able to get unblocked by using https://docs.bazel.build/versions/master/be/java.html#java_binary.deploy_env |
Thanks for the tips. We've also succeeded in using |
@ittaiz Are we going to support neverlink for scala_library? |
We can. |
@ittaiz Is there someone who can help implement it? I am not at all versed with bazel code but can give it a shot if no one is available |
I will look into it |
Fixed by #1123 |
java rules support this, but we don't.
The text was updated successfully, but these errors were encountered: