Skip to content

Commit 33e98e1

Browse files
author
Stu Hood
authored
Zinc 1.0.0-X20 upgrade: JVM portion (pantsbuild#4728)
### Problem Pants is on an older version of zinc (one that does not use class-based name-hashing), and the modern zinc project is moving quickly thanks to @jvican and others. We had previously been on `X7` but it was reverted in pantsbuild#4510 because benchmarks showed that no incremental compilation was happening for scala code. ### Solution * Upgrade to zinc `1.0.0-X20` * Use the zinc `AnalysisMappers` API described on pantsbuild#4513 to make analysis files portable without parsing * Extract options parsing out of the `Settings` object and into its own module, to allow for reuse in multiple binary entrypoints * Refactor and split our zinc wrapper into `zinc-compiler` and `zinc-extractor` to support parsing the `product_deps_by_src` and `classes_by_source` products directly (in order to move toward making analysis a black box) * Switch to usage of new builder-pattern APIs for constructing zinc objects * Remove the `Loggers`/`Reporters` facades in favor of built in support for filtering log messages ### Result The new version of the zinc wrapper correctly supports incremental compile (with the exception of sbt/zinc#355), and the python portions of pants no longer require any internal knowledge of zinc analysis. The python half of this change will remove that code.
1 parent 4f7c91c commit 33e98e1

39 files changed

+1555
-1595
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
2+
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3+
4+
jar_library(
5+
name='scala',
6+
jars = [
7+
scala_jar(org='com.fasterxml.jackson.module', name='jackson-module-scala', rev='2.8.4'),
8+
]
9+
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
2+
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3+
4+
jar_library(
5+
name='scala-java8-compat',
6+
jars=[
7+
scala_jar(org='org.scala-lang.modules', name='scala-java8-compat', rev='0.8.0'),
8+
],
9+
)

3rdparty/jvm/org/scala-sbt/BUILD

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1+
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
2+
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3+
14
jar_library(
25
name='zinc',
36
jars=[
4-
scala_jar(org='org.scala-sbt', name='zinc', rev='1.0.0-X7',
7+
scala_jar(org='org.scala-sbt', name='zinc', rev='1.0.0-X20',
58
excludes=[
69
exclude(org='org.scala-sbt', name='io_2.11'),
710
exclude(org='org.scala-sbt', name='util-logging_2.11'),
811
]),
912
],
13+
dependencies=[
14+
':io',
15+
':util-logging',
16+
],
1017
)
1118

1219
jar_library(
1320
name='util-logging',
1421
jars=[
1522
# TODO: `zinc` only declares a dep on the `tests` classifier for
1623
# util-logging for some reason. We redefine the dep here to get the full package.
17-
scala_jar(org='org.scala-sbt', name='util-logging', rev='1.0.0-M17', force=True),
24+
scala_jar(org='org.scala-sbt', name='util-logging', rev='1.0.0-M27', force=True),
1825
],
1926
)
2027

@@ -23,6 +30,6 @@ jar_library(
2330
jars=[
2431
# TODO: `zinc` only declares a dep on the `tests` classifier for
2532
# io. We redefine the dep here to get the full package.
26-
scala_jar(org='org.scala-sbt', name='io', rev='1.0.0-M9', force=True),
33+
scala_jar(org='org.scala-sbt', name='io', rev='1.0.0-M13', force=True),
2734
],
2835
)

src/scala/org/pantsbuild/zinc/AnalysisMap.scala

Lines changed: 0 additions & 186 deletions
This file was deleted.

0 commit comments

Comments
 (0)