-
-
Notifications
You must be signed in to change notification settings - Fork 289
Add an option so we can indicate that no java source jars are produced #529
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
Conversation
@ianoc-stripe thanks for taking! this is a help. |
actually, can you add a test similar to this one: https://github.com/bazelbuild/rules_scala/blob/master/test/src/main/scala/scalarules/test/twitter_scrooge/BUILD#L194 to make sure the test saw the This would be easy to regress on. |
also a test_expect_failure kind where we have a srcjar with some java inside it (you can even check one in that has one file or something), and show that the build fails if we set the flag but find java. |
👍 This is great! |
the thrift grep test failed on buildkite:
|
Haven’t looked at the implementation yet but what’s the motivation?
…On Fri, 22 Jun 2018 at 3:57 P. Oscar Boykin ***@***.***> wrote:
the thrift grep test failed on buildkite:
//test/src/main/scala/scalarules/test/twitter_scrooge:java_jar_not_on_classpath FAILED in 3 out of 3 in 0.2s
--
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#529 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF00RqUzwB4s9kBGwcA8BMMLO0cLYks5t_ED-gaJpZM4Uy3ky>
.
|
Motivation is not to generate thousands of empty jars in our thrift builds.
If we know we have no java, no need to invoke the compiler and enlarge the
classpath. Especially with the N^2 bug on large classpath handling.
On Thu, Jun 21, 2018 at 17:31 Ittai Zeidman <notifications@github.com>
wrote:
Haven’t looked at the implementation yet but what’s the motivation?
On Fri, 22 Jun 2018 at 3:57 P. Oscar Boykin ***@***.***>
wrote:
> the thrift grep test failed on buildkite:
>
>
>
//test/src/main/scala/scalarules/test/twitter_scrooge:java_jar_not_on_classpath
FAILED in 3 out of 3 in 0.2s
> --
>
>
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <
#529 (comment)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/ABUIF00RqUzwB4s9kBGwcA8BMMLO0cLYks5t_ED-gaJpZM4Uy3ky
>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#529 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEJdoH8EkiozjdL9D4Cn20fqXb-0vjaks5t_GUXgaJpZM4Uy3ky>
.
--
P. Oscar Boykin, Ph.D. | http://twitter.com/posco | http://pobox.com/~boykin
|
…ough and the test is a broader target include
@johnynek sorry about that, there was a bug with it which caused some target stuff to fail. Its should all be good now. |
This is great, thanks! |
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.
@ianoc sorry for the late eyes but I don’t understand why you add the failures in the scalac run and the additional condition in “try to compile java”?
Can you just fail inside “try to compile java” if that code path is taken and the attribute is false? This will reduce logic from the ScalacProcessor.
My guess is this does have value and I’m mistaken but I couldn’t see it
javaFiles = getCommaList(argMap, "JavaFiles"); | ||
|
||
if (!expectJavaOutput && javaFiles.length != 0) { | ||
throw new RuntimeException("Cannot hava java source files when no expected java output"); |
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.
@ianof sorry for the late eyes but aren’t you missing a test for this case? IIUC this is where java files are on srcs “regularly” (not in srcjar)
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.
there is a test for this case: 1d00681#diff-9e850e1e0893c9ea027f87c0b45dffabR188
So, we can't see in the build rule if the srcjar has java or not, so we can't fail in there. We can in the scalac check, that is the actual execution, but the build rules are running at analysis time, where we don't actually have the srcjar. Currently we just assume a srcjar may have java. This patch allows you to assert you don't have java, but fail the build if that is false (which can only be detected at build time). |
@johnynek as we've been discussing, i think this would be the simplest change to add a flag to indicate the source jars/inputs to a scala_library rule do not contain any java files