-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
Update dependency inference for Python & JVM to have visibility by resolves for first-party code #14293
Comments
To implement this, we'll take a similar approach to how third-party dependency inference works: pants/src/python/pants/jvm/dependency_inference/artifact_mapper.py Lines 147 to 151 in c3dfc0d
That is, have a distinct "universe" of dependencies per resolve name. Our objective is to update this code so that we pass the resolve to both first-party mapping and third-party mapping: pants/src/python/pants/backend/java/dependency_inference/rules.py Lines 128 to 134 in c3dfc0d
That means we will need to change how -- A question I had is if the key should include the scala version - you can only infer a dep on something that shares the same scala version. Precisely, the key would be That would be great to keep this code path simpler. |
As described in #14293, dependency inference does not currently work properly for first-party sources when multiple resolves are configured. This PR fixes the issue for JVM (Java/Scala) first-party sources. The solution is similar to what was already done for third-party dependency inference: make the resolve part of the key in the symbol map. With this change, dependency inference looks up symbols by both name and resolve.
…4491) As described in pantsbuild#14293, dependency inference does not currently work properly for first-party sources when multiple resolves are configured. This PR fixes the issue for JVM (Java/Scala) first-party sources. The solution is similar to what was already done for third-party dependency inference: make the resolve part of the key in the symbol map. With this change, dependency inference looks up symbols by both name and resolve.
Closed by #14486 |
#13621 but for first-party targets this time. If you have a
python_source
target that uses Resolve A, but you use Resolve B, then we should not infer a dep from B to A because the resolves are incompatible.Key point! See the design doc for #13882 at https://docs.google.com/document/d/1mzZWnXiE6OkgMH_Dm7WeA3ck9veusQmr_c6GWPb_tsQ/edit#. What this means is that if you have a
python_source
target that works with both resolves A and B, really you will parametrize two distinct targets, one per resolve. Dependency inference will then infer whether to sue the A variant or the B variant, based on what the dependee uses itself. Without this change, we would have ambiguity that there are two providers of that file.We can implement this change before implementing parametrization.
The text was updated successfully, but these errors were encountered: