Shade zinc.

Review Request #2268 - Created May 24, 2015 and submitted

Information
John Sirois
pants
jsirois/zinc/shade
1584, 1593
bd3737d...
Reviewers
pants-reviews
areitz, benjyw, fkorotkov
Zinc can run javac in-process and when it does so it uses no
classpath isolation mechanisms and so can cause annotation processors
run under javac to come into conflict with its own classpath.  This
change shades zinc to avoid the problem altogether.

In so doing, a few changes were needed:
+ Turn on the local artifact cache for bootstrap in the
  pantsbuild/pants repo.  Although the junit-runner shade time is ~5s
  the zinc shade time is ~30s making the need for this acute.
+ Refactor ScalaCompile to explicitly ask for classpaths for
  sbt-interface and compiler-interface.  This work inlines ZincUtils
  which was slated for this.

Along the way some unused lazy tool classpath methods were killed and
a new tool_jar helper was added for tool classpaths that are
expected to have exactly one entry.

 3rdparty/jvm/com/typesafe/sbt/BUILD                                      |  36 +++++++-------
 BUILD.tools                                                              |  17 +++++++
 pants.ini                                                                |   9 ++++
 src/python/pants/backend/jvm/subsystems/jvm_tool_mixin.py                |  13 ++----
 src/python/pants/backend/jvm/tasks/BUILD                                 |   6 ++-
 src/python/pants/backend/jvm/tasks/bootstrap_jvm_tools.py                |  23 +++++++--
 src/python/pants/backend/jvm/tasks/jvm_compile/BUILD                     |   1 +
 src/python/pants/backend/jvm/tasks/jvm_compile/scala/scala_compile.py    |  86 +++++++++++++++++++++++++++-------
 src/python/pants/backend/jvm/tasks/jvm_compile/scala/zinc_utils.py       | 127 --------------------------------------------------
 src/python/pants/backend/jvm/tasks/jvm_tool_task_mixin.py                |  40 ++++++++++++----
 src/scala/org/pantsbuild/zinc/BUILD                                      |  13 ++++--
 tests/python/pants_test/backend/jvm/tasks/jvm_compile/BUILD              |  10 ----
 tests/python/pants_test/backend/jvm/tasks/jvm_compile/test_zinc_utils.py |  30 ------------
 tests/python/pants_test/util/test_dirutil.py                             |  14 ++++--
 14 files changed, 189 insertions(+), 236 deletions(-)
I dogfooded the shading by using the new ':main' target to build a
zinc binary jar and then use that to compile itself by pointing
BUILD.tools to its file:// URL.

CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/63980386

Issues

  • 0
  • 0
  • 2
  • 2
Description From Last Updated
Benjy Weinberger
Andy Reitz
John Sirois
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Fedor Korotkov

   
3rdparty/jvm/com/typesafe/sbt/BUILD (Diff revision 2)
 
 
 
 
 
 
 
 
 
 
 
 

can we do

target(
name='incremental-compiler',
dependencies=[
'//:incremental-compiler'
'//:sbt-interface',
'//:scala-compiler',
'//:scala-library',
]
)

?

  1. Nope, but almost: https://rbcommons.com/s/twitter/r/2279/
    What I'd really love is an answer to the TODO I added though about why the intransitive shenanigans at all.
Loading...