-
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
Strict Deps smart mode #335
Comments
Adding a bit more detail: the plan is to take Dependency.scala from zinc and copy it to rules_scala. I think this is a great way to test the idea of using zinc's dependency analysis for strict deps implementation. However, once validated, i think the best would be to refactor zinc so it can output dependencies in its protobuf format without involving the rest of incremental compilation. The cost of maintaing a fork of Depedency.scala long term will be high: it's a very tricky logic. |
When you say refactor zinc you mean pushing it upstream?
…On Mon, 13 Nov 2017 at 1:50 Grzegorz Kossakowski ***@***.***> wrote:
Adding a bit more detail: the plan is to take Dependency.scala from zinc
and copy it to rules_scala. I think this is a great way to test the idea of
using zinc's dependency analysis for strict deps implementation. However,
once validated, i think the best would be to refactor zinc so it can output
dependencies in its protobuf format without involving the rest of
incremental compilation. The cost of maintaing a fork of Depedency.scala
long term will be high: it's a very tricky logic.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#335 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF1EoKDP5g6XHBjz2uNHj20Lanc4rks5s14RWgaJpZM4QY6fV>
.
|
Yes, refactor upstream zinc to have a mode in which only dependencies are
collected and not api objects that are expensive to compute.
On 12 November 2017 at 21:53, Ittai Zeidman <[email protected]>
wrote:
… When you say refactor zinc you mean pushing it upstream?
On Mon, 13 Nov 2017 at 1:50 Grzegorz Kossakowski ***@***.***
>
wrote:
> Adding a bit more detail: the plan is to take Dependency.scala from zinc
> and copy it to rules_scala. I think this is a great way to test the idea
of
> using zinc's dependency analysis for strict deps implementation. However,
> once validated, i think the best would be to refactor zinc so it can
output
> dependencies in its protobuf format without involving the rest of
> incremental compilation. The cost of maintaing a fork of Depedency.scala
> long term will be high: it's a very tricky logic.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/bazelbuild/rules_scala/issues/
335#issuecomment-343779083>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/
ABUIF1EoKDP5g6XHBjz2uNHj20Lanc4rks5s14RWgaJpZM4QY6fV>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#335 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAQeYZ8WvQWbPHJckVOSiflClKXuZHPks5s19lVgaJpZM4QY6fV>
.
--
gkk
|
Hi @gkk-stripe , |
Yes, it sounds right about having In what case would you see dependencies on |
I think you are correct about your statement on bazel. So in sbt it's different? |
Yes, in Sbt/Maven/etc you work with class directories. Packaging into jars
is done before publishing or building a deployment artifact.
…On Sun, Mar 4, 2018 at 7:54 AM Natan Silnitsky ***@***.***> wrote:
I think you are correct about your statement on bazel.
So in sbt it's different?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#335 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAQeSkZYnPsf_r7o6omAe38RH0zBF4pks5tbA5QgaJpZM4QY6fV>
.
|
@gkossakowski, we are testing the plugin by using
I've tried using
Sample code here Seems like am I correct? |
Hi @gkk-stripe , When running the expression is of kind: Can you please direct me to which tree type I should use to match against for this kind of expression? |
Removing callback is fine. In zinc/sbt it's there to isolate the two scala versions: one used to compile and run sbt and the other one used for compiling the scala project. In bazel you have only one scala version at the time so you don't need to worry about cross-classloader boundries. Regarding matching on |
I just looked briefly at the zinc's source code and it seems like this is a bug in zinc. Nice catch! |
We want to improve the current state of the dependency analyzer compiler plugin for strict deps,
Currently the plugin looks at which jars were loaded by the compiler, in order to assess if the target should be a direct dependency. This strategy is quite coarse-grained and over-approximates which targets are needed.
In order to improve the plugin, the proposal by @gkk-stripe is to utilize code from Zinc that analyzes source code which has much higher accuracy.
Plan is to use the zinc code callbacks mechanism to output the dependencies to a file and have a separate action that emits the relevant error messages to the user of missing dependencies
The text was updated successfully, but these errors were encountered: