commit 97b6085820acda4150bd0978c874a93a175ce52c Author: Stu Hood Date: Sat Jun 1 22:56:23 2019 -0700 Sort entries in output zinc jars (#7834) ### Problem The jars produced by the `zinc` `-jar` flag were not ending up sorted due to conversion to a `Map` before writing. Additionally, they contained a duplicate entry (that `findbugs` would choke on) as an artifact of how relativization was happening. ### Solution Preserve the sorted order that is created by the `TreeSet` that we collect entries into, and do not create an entry for the "root" directory of the inputs. ### Result Pants is able to consume the `-jar` option successfully in #7833. .../org/pantsbuild/zinc/compiler/OutputUtils.scala | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) commit f5eedbc48b40d61b92385d7fbb544775e3f44c77 Author: Daniel Wagner-Hall Date: Thu Nov 22 15:07:06 2018 +0000 Remove unused CompilerCacheKey (#6805) .../pantsbuild/zinc/compiler/CompilerUtils.scala | 24 ---------------------- .../org/pantsbuild/zinc/compiler/InputUtils.scala | 2 +- 2 files changed, 1 insertion(+), 25 deletions(-) commit 46590dbbbd8b7a4271cd1b17a9a096dd0d00b6a6 Author: Daniel Wagner-Hall Date: Mon Nov 19 23:03:18 2018 +0000 Add nailgun-specific main which uses paths in calling process (#6792) This means that if you have a nailgun'd zinc started, and call it from a client in another directory, it will use the client's working directory. src/scala/org/pantsbuild/zinc/compiler/Main.scala | 15 +++++++ .../org/pantsbuild/zinc/compiler/Settings.scala | 49 +++++++++++++++++++++- 2 files changed, 63 insertions(+), 1 deletion(-) commit fda7b875819b50cac47062c1dc52ee4d8e526f01 Author: Borja Lorente Date: Tue Sep 11 16:51:51 2018 +0200 Add bootstrapper jar to compile the compile-bridge. (#6462) ### Problem The `_zinc_cache_dir` option relies on the homedir existing to work, which is a blocker for remoting. Discussion in #6155 . ### Solution Implement a new Scala tool, `bootstrapper`, that takes the relevant jars as arguments and compiles the compiler bridge. This will be called, possibly remotely, from the `zinc` subsystem. ### Result - A bit of refactoring of the `compiler` project. - The creation of a `bootstrapper` target. This PR is related to #6463 ### Acknowledgements This work was made together with @dotordogh and @illicitonion. Even if we used my fork for convenience, we programmed most of the code together. This work is based on @ity's work on the same problem. .../pantsbuild/zinc/compiler/CompilerUtils.scala | 50 +--------------------- .../org/pantsbuild/zinc/compiler/InputUtils.scala | 12 ++++-- .../org/pantsbuild/zinc/compiler/Settings.scala | 35 ++------------- 3 files changed, 13 insertions(+), 84 deletions(-) commit 25db39372a8437868f31edb7f40b95e9dbb87226 Author: Dorothy Ordogh Date: Wed Aug 29 15:32:11 2018 +0200 Change zinc logging so it doesn't error out (#6409) * Add Jorje's suggested fix * fix comment src/scala/org/pantsbuild/zinc/compiler/Main.scala | 5 +++++ 1 file changed, 5 insertions(+) commit b95a3a7c03298aa69bee22188c4b97d92efd4ac8 Author: Ity Kaul Date: Tue Jul 24 09:28:04 2018 -0700 Add functionality to create jars in zinc wrapper (#6094) ### Problem Invocations of zinc do not support jars. ### Solution Add functionality to the zinc wrapper to jar up the contents of _classesDirectory when an option is specified. .../org/pantsbuild/zinc/compiler/InputUtils.scala | 6 +- src/scala/org/pantsbuild/zinc/compiler/Main.scala | 8 ++ .../org/pantsbuild/zinc/compiler/OutputUtils.scala | 126 +++++++++++++++++++++ .../org/pantsbuild/zinc/compiler/Settings.scala | 32 ++++-- 4 files changed, 156 insertions(+), 16 deletions(-) commit 2fce30b3fb28b6be7657c038f1e636ffe5607288 Author: Stu Hood Date: Tue May 8 18:07:20 2018 -0700 Bump to zinc 1.1.7 (#5794) ### Problem We're a few months behind on zinc releases... although they have not yet been incorporated anyway (pending #4729). ### Solution Bump to the latest, and fix a deprecation. src/scala/org/pantsbuild/zinc/compiler/CompilerUtils.scala | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) commit 62bd2a2b7c328dc647d40454b6522725ebc37f7a Author: Stu Hood Date: Fri Nov 3 23:11:25 2017 -0700 Pass the `color` option through to the report factory. (#5055) ### Problem The color flag is currently being respected for console logging, but not for compiler/reporter logging. ### Solution Pass `--color` through to the `ReporterConfig` using the builder API. ### Result #4729 is unblocked, and: ``` ./pants compile --no-colors testprojects/src/java/org/pantsbuild/testproject/dummies:compilation_failure_target ``` results in no color, as expected. src/scala/org/pantsbuild/zinc/compiler/InputUtils.scala | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) commit a965d45170875a1884f522a637b24df90054b842 Author: Stu Hood Date: Fri Aug 11 14:23:21 2017 -0700 Zinc 1.0.0-RC3 memory and output improvements (#4807) ### Problem While working through #4477, it became obvious that: 1. the performance achieved when the analysis cache is missed is pretty abysmal 2. a `log4j` JMX error was being logged during startup 3. the `forkJava` and `javaHome` settings are redundant: the only reason to pass `javaHome` would be to trigger forking Java 4. a large amount of unnecessary classloading was happening due to #4744 ### Solution 1. Set the default `zinc.analysis.cache.limit` value to `Int.MaxValue`, which will allow users who want to cap the size to set it lower, but otherwise not lead to performance cliffs when a target has more dependencies than the current limit. 2. Implicitly disable log4j JMX usage by setting the `log4j2.disable.jmx` property if it is not already set. 3. Remove the `forkJava` setting, to prepare to use the `javaHome` setting explicitly in #4729 4. Enable usage of `ClassLoaderCache` ### Result Fixes #4744, and removes a few more blockers for #4729. src/scala/org/pantsbuild/zinc/compiler/CompilerUtils.scala | 11 ++++++++--- src/scala/org/pantsbuild/zinc/compiler/Main.scala | 4 ++++ src/scala/org/pantsbuild/zinc/compiler/Settings.scala | 2 -- 3 files changed, 12 insertions(+), 5 deletions(-) commit 33e98e1869c64ad277130807afe989988e83063c Author: Stu Hood Date: Tue Jul 18 16:50:30 2017 -0700 Zinc 1.0.0-X20 upgrade: JVM portion (#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 #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 #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 https://github.com/sbt/zinc/issues/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. .../pantsbuild/zinc/compiler/CompilerUtils.scala | 154 ++++++++++ .../org/pantsbuild/zinc/compiler/InputUtils.scala | 206 +++++++++++++ src/scala/org/pantsbuild/zinc/compiler/Main.scala | 131 +++++++++ .../org/pantsbuild/zinc/compiler/Settings.scala | 319 +++++++++++++++++++++ 4 files changed, 810 insertions(+)