Fix cases where transitivity is required despite strict_deps; enable within the repo for Java

Review Request #3125 - Created Nov. 14, 2015 and submitted

Information
Stu Hood
pants
2565
Reviewers
pants-reviews
benjyw, jsirois, nhoward_tw, zundel

This patch fixes two cases where transitive deps are required at compile time despite strict_deps:

  1. target aliases: the direct deps search now walks through aliases (but not fully transitively). In particular, when depending on the alias 3rdparty:protobuf-java, it is resolved to 3rdparty:protobuf-2.4.1
  2. "compiler plugins": for code that runs in the compiler, compiletime is actually runtime, so transitive deps must be provided

The patch also enabled strict_deps for Java code within the repo, and applies it explicitly to zinc.


There is one open question represented by a few TODOs in the patch: should it be possible for a target A, depended on by target B, to add additional deps for B? Some potential usecases represented by TODOs in the patch:

  • @Annotation interfaces seem to be required in cases where a class in package B inherits from an annotated class in package A
  • In codegen, it will frequently be the case that it is impossible to use the generated code in target A without importing a runtime library in target B
  • Also in codegen, there are cases where deps are directly inserted into the build graph without existing on disk (see wire-runtime), and where writing them out to disk (anywhere other than in BUILD.tools) would make it very likely for them to go out of sync with the in memory declaration.

https://travis-ci.org/pantsbuild/pants/builds/91487624

Issues

  • 0
  • 0
  • 2
  • 2
Description From Last Updated
Eric Ayers
Benjy Weinberger
Benjy Weinberger
Eric Ayers
Stu Hood
Review request changed

Status: Closed (submitted)

Change Summary:

merged as a31e175730dad9b6694204b4de7fbb9906542cbb

Loading...