-
Notifications
You must be signed in to change notification settings - Fork 121
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
Generated BUILD files should use java_import
instead of java_library
#63
Comments
I think you are advocating for the https://github.com/johnynek/bazel-deps#options It is intentional that we assume runtime_deps to keep deps minimal and rebuilds minimal. We add I don't see this as something that should be changed currently. (Note, we are using this tool in production at Stripe in several repos, and it seems to be working rather well for us. Can you try one of the two proposals above?) |
Huh, I guess this connects back to bazelbuild/rules_scala#235, where It's true that a longer classpath makes longer builds, but is it significant in the case of Maven dependencies? I thought it needs to be hundreds / thousands of unnecessary jars to make a difference. Either way, I think a better user experience is to free the developer from having to add things manually to Are you open to a third |
@johnynek using deps instead of runtime_deps will indeed trigger more compilations if changes of that dependency propagate over the ijar. Other than that it should be the same since:
As you know that's why we've been putting so much effort into bringing this to rules_scala. |
@cgrushko how is your proposal different than |
No; I want to require users to |
Carmi by "what they import" you mean what they actually use in their
sources as opposed to arbitrary needs of the compiler, right?
…On Wed, 6 Sep 2017 at 23:42 cgrushko ***@***.***> wrote:
No; java_library.exports allows you to compile your code without
depending on the right things (it violates strict java deps, as defined in
https://blog.bazel.build/2017/06/28/sjd-unused_deps.html).
I want to require the user to depend on what they import, but not force
them to depend on what they don't import (here, "depend" means have an
entry in their deps attributes)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#63 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF2s0Go9FE3KkkqSUAfPFu-bkWCB7ks5sfwOsgaJpZM4PNncl>
.
|
So, I don't see what change you expect using |
@ittaiz yep, I use "import" as a simplification. @johnynek
This is not a requirement for I can construct a demo project, but it'll take me some time, so I prefer doing this as a last resort. |
So, I'm happy to take a PR that replaces |
Perhaps this can be closed in favour of #102? |
This one was actually first m, it seems. @tekumara this should not be too much work. If you want to try a PR I am happy to review or answer questions. |
That is, instead of
we should have
The reason is that
javac
sometimes needs to access symbols from the dependencies of a jar during a compilation. I can come up with an exact explanation, but waving my hands, one example is using an interface defined in the superclass of your superclass.Using
runtime_deps
will result in a broken build in this case.(you can ask bazel-deps to put everything in
exports
, but this hurts readability and maintainability, and I recommend against it)The text was updated successfully, but these errors were encountered: