-
Notifications
You must be signed in to change notification settings - Fork 281
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
[WIP] Scala import java info #517
Conversation
Currently this break strict deps:
|
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.
Haven't finished but thought you'd like the WIP thoughts as well
scala/scala_import.bzl
Outdated
exports_provider = _labels_to_provider(ctx.attr.exports) | ||
|
||
jars2labels = _collect_jar_labels(ctx) | ||
_add_labels_of_current_code_jars(depset(transitive=[jars_provider.full_compile_jars, exports_provider.full_compile_jars]), ctx.label, jars2labels) #last to override the label of the export compile jars to the current target |
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.
I think you want "regular" compile jars here and not "full"
scala/scala_import.bzl
Outdated
transitive_compile_jars = [] | ||
runtime_jars = [] | ||
compile_jars = [] | ||
def _labels_to_provider(labels): |
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.
labels here is overloaded. I thought it's the actual labels. Any other ideas?
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.
This the purpose of this method - take a list of labels and merge them to a single JavaInfo
scala/scala_import.bzl
Outdated
if JavaInfo in jar: | ||
fail("jars must contain only jar files") | ||
|
||
providers.append(_jar_to_provider(jar.files.to_list()[0])) |
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.
why only take the first file?
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.
WIP - the plan is to use only the code files
return java_common.merge(providers) | ||
|
||
def _jar_to_provider(jar): | ||
return JavaInfo( |
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.
Why are you building the JavaInfo
like this (without the deps
, exports
,runtime_deps
)?
I think that's not the correct semantics
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.
At this point there is only a jar file - not a JavaInfo
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.
I think I'm not done yet but I have a hunch that the changes that might come from the comments I've added so far will change the code greatly so I'm not sure I should continue before we discuss some more
providers = [] | ||
for jar in jars: | ||
if JavaInfo in jar: | ||
fail("jars must contain only jar files") |
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.
should we have a test for this negative case?
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.
and also the error message is about what it should contain but the check is about whether or not this has JavaInfo.
Isn't there a mix? Maybe have a failure here to say targets of jvm_rules aren't allowed here and add another check below to see that the files are only jar
files
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.
Thanks for this cleanup. Is it still a WIP?
Can you merge with master? There have been a number of merged PRs.
This is blocked since the JavaInfo skylark API doesn’t support creating a
JavaInfo of multiple output jars. There’s a thread about it in bazel jvm
sig.
…On Sat, 30 Jun 2018 at 1:34 P. Oscar Boykin ***@***.***> wrote:
***@***.**** commented on this pull request.
Thanks for this cleanup. Is it still a WIP?
Can you merge with master? There have been a number of merged PRs.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#517 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIFwv7PzrjuKWM7fGrrX2RE8-90iYTks5uBquFgaJpZM4Ukheu>
.
|
Can’t we make two JavaInfo instances and merge them? What does that result
in?
On Fri, Jun 29, 2018 at 21:24 Ittai Zeidman <[email protected]>
wrote:
This is blocked since the JavaInfo skylark API doesn’t support creating a
JavaInfo of multiple output jars. There’s a thread about it in bazel jvm
sig.
On Sat, 30 Jun 2018 at 1:34 P. Oscar Boykin ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
>
> Thanks for this cleanup. Is it still a WIP?
>
> Can you merge with master? There have been a number of merged PRs.
>
> —
> You are receiving this because you commented.
>
>
> Reply to this email directly, view it on GitHub
> <
#517 (review)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/ABUIFwv7PzrjuKWM7fGrrX2RE8-90iYTks5uBquFgaJpZM4Ukheu
>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#517 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEJdm3vtmrkA6DbG2EbZiNKWPdG2x7Tks5uBv1ogaJpZM4Ukheu>
.
--
P. Oscar Boykin, Ph.D. | http://twitter.com/posco | http://pobox.com/~boykin
|
No, merge drops the output jars.
See here for more info
https://groups.google.com/forum/#!topic/bazel-sig-jvm/THl2DRqyYW0
On Sat, Jun 30, 2018 at 7:53 AM P. Oscar Boykin <[email protected]>
wrote:
… Can’t we make two JavaInfo instances and merge them? What does that result
in?
On Fri, Jun 29, 2018 at 21:24 Ittai Zeidman ***@***.***>
wrote:
> This is blocked since the JavaInfo skylark API doesn’t support creating a
> JavaInfo of multiple output jars. There’s a thread about it in bazel jvm
> sig.
> On Sat, 30 Jun 2018 at 1:34 P. Oscar Boykin ***@***.***>
> wrote:
>
> > ***@***.**** commented on this pull request.
> >
> > Thanks for this cleanup. Is it still a WIP?
> >
> > Can you merge with master? There have been a number of merged PRs.
> >
> > —
> > You are receiving this because you commented.
> >
> >
> > Reply to this email directly, view it on GitHub
> > <
>
#517 (review)
> >,
> > or mute the thread
> > <
>
https://github.com/notifications/unsubscribe-auth/ABUIFwv7PzrjuKWM7fGrrX2RE8-90iYTks5uBquFgaJpZM4Ukheu
> >
> > .
> >
>
> —
> You are receiving this because you commented.
>
>
> Reply to this email directly, view it on GitHub
> <
#517 (comment)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AAEJdm3vtmrkA6DbG2EbZiNKWPdG2x7Tks5uBv1ogaJpZM4Ukheu
>
> .
>
--
P. Oscar Boykin, Ph.D. | http://twitter.com/posco |
http://pobox.com/~boykin
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#517 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF5PghNxkB6Afw_afSY71KwMb648Iks5uBwRZgaJpZM4Ukheu>
.
|
@anchlovi what is the status here? I think JavaInfo issues have been fixed, if I'm not mistaken. Would you have time to merge master and see what the state is? I appreciate your help. |
should we close this one or will you have time to merge master and take another stab at it. @ittaiz is this one of your team? |
Shachar is indeed on the build at Wix. I'll close this as #781 handled scala_import as well |
This changes
scala_import
to useJavaInfo