-
Notifications
You must be signed in to change notification settings - Fork 277
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
Unused dependecies checker does not detect specs2 compile deps #1048
Comments
@ittaiz do you happen to know if it's possible to specify deps for things using |
I'm actually not very familiar with |
I think generally there are definitely issues where external dependencies don't declare their deps as deps (which @ittaiz I think you fixed some of). So there could be well another issue. I guess the other possibility is that however maven_install does declare the deps, but we are not catching them due to an internal bug (though that did not seem to be the case as far as I could tell) |
Actually I’m not sure I understand what your hunch is here @Jamie5 |
In the provided repro, I wonder if the Because in https://github.com/wix-playground/scala-unused-deps/blob/master/specs2/MockingBird.scala we only reference Meanwhile, the interface of I hope this makes sense as it feels a bit rambly. |
I took another look at our internal layout. |
The actual problem is in Specs2 project, where I assume there will be more such cases with other libs. I guess at some point we should provide a recommendation how to deal with such cases in docs.
I guess this issue has to be closed, as not much can be done from rules_scala side, right? |
I think so but small question. |
@ittaiz wondering if this would be an example where +1 isn't good enough (it sounds like if we translated the situation to plus-one, the plus-one deps of someone including (regardless of the situation that is actually happening here, which sounds like it may be something else) |
I thought about it as well. |
Not really sure about third party specifically, but it seems like something similar could occur even in a non-third-party situation, and hence we want to make it work (was kind of hoping we'd never run into a scenario like this in real life but that was kind of foolish). Though perhaps third party is different enough that this is still unlikely to happen within a project (though I don't see why that would be the case). When you say apply strict deps for third party not 100% sure what you mean but do you mean that external deps would use "transitive" mode for whatever they include, and dependency analyzer would analyze as if the option were "direct". |
I think it's an issue on third party loader, with some loaders like maven_install it's not even a problem. I see more value in keeping +1 behavior for third-party deps as it will have leaner classpath. At Wix we plan to fix such cases on our loader side. I would personally delay efforts toward complex heuristic implementation until some one else comes with more similar cases. Though having such implementation would be useful. |
Repro: https://github.com/wix-playground/scala-unused-deps/blob/master/specs2/
Some sepcs2 deps are required at compile time, but are incorrectly suggested to be removed.
With specs2-matcher and specs2-common:
Without specs2-matcher and specs2-common:
The text was updated successfully, but these errors were encountered: