From d4454f233914d0a7586da8c5d07575d8b63124fe Mon Sep 17 00:00:00 2001 From: John Sirois Date: Mon, 24 Aug 2015 16:09:53 -0600 Subject: [PATCH] Upgrade to pants 0.0.44. The release notes are here: https://pypi.python.org/pypi/pantsbuild.pants/0.0.44 Of particular interest to twitter/commons is the graduation of the isolated jvm compile strategy to a viable out-of-the-box solution for java & scala compiles. This change includes a switch over to that strategy which necessitated an upgrade to scala 2.10. Testing Done: CI went green here: https://travis-ci.org/twitter/commons/builds/77066466 Bugs closed: 410 Reviewed at https://rbcommons.com/s/twitter/r/2691/ --- 3rdparty/jvm/com/twitter/BUILD | 4 +-- 3rdparty/jvm/com/twitter/common/BUILD | 7 ---- 3rdparty/jvm/org/pantsbuild/BUILD | 21 ++++++++++++ 3rdparty/jvm/org/scala-lang/BUILD | 2 +- 3rdparty/jvm/org/scala-tools/testing/BUILD | 6 ++-- 3rdparty/jvm/org/scalatest/BUILD | 2 +- BUILD.tools | 4 +-- pants.ini | 33 +++++++++++++++++-- tests/java/com/twitter/common/metrics/BUILD | 2 +- .../twitter/common/metrics/HistogramTest.java | 2 +- .../stats/ApproximateHistogramTest.java | 2 +- tests/java/com/twitter/common/stats/BUILD | 2 +- .../common/stats/WindowedStatsTest.java | 2 +- .../twitter/common/testing/junit/rules/BUILD | 2 +- .../common/testing/junit/rules/RetryTest.java | 3 +- 15 files changed, 67 insertions(+), 27 deletions(-) create mode 100644 3rdparty/jvm/org/pantsbuild/BUILD diff --git a/3rdparty/jvm/com/twitter/BUILD b/3rdparty/jvm/com/twitter/BUILD index a4a1b49a0..4fd3593ea 100644 --- a/3rdparty/jvm/com/twitter/BUILD +++ b/3rdparty/jvm/com/twitter/BUILD @@ -14,7 +14,7 @@ # limitations under the License. # ================================================================================================== -SCALA_REV = '2.9.2' +SCALA_REV = '2.10' def make_lib(name, rev, scala_rev=None, excludes=None, deps=None): @@ -77,7 +77,7 @@ make_util_lib('util-jvm') make_lib('jsr166e', '1.0.0') -make_lib('ostrich', '9.1.2') +make_lib('ostrich', '9.1.2', scala_rev=SCALA_REV) make_lib('twitter-text', '1.5.0') diff --git a/3rdparty/jvm/com/twitter/common/BUILD b/3rdparty/jvm/com/twitter/common/BUILD index c2a76fa3b..d1ab9b2c0 100644 --- a/3rdparty/jvm/com/twitter/common/BUILD +++ b/3rdparty/jvm/com/twitter/common/BUILD @@ -19,10 +19,3 @@ jar_library(name='metrics-data-sample', jar(org='com.twitter.common', name='metrics-data-sample', rev='0.0.1'), ] ) - -jar_library(name='junit-runner-annotations', - jars=[ - jar(org='com.twitter.common', name='junit-runner-annotations', rev='0.0.6'), - ] -) - diff --git a/3rdparty/jvm/org/pantsbuild/BUILD b/3rdparty/jvm/org/pantsbuild/BUILD new file mode 100644 index 000000000..82c46f693 --- /dev/null +++ b/3rdparty/jvm/org/pantsbuild/BUILD @@ -0,0 +1,21 @@ +# ================================================================================================== +# Copyright 2015 Twitter, Inc. +# -------------------------------------------------------------------------------------------------- +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this work except in compliance with the License. +# You may obtain a copy of the License in the LICENSE file, or at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ================================================================================================== + +jar_library(name='junit-runner-annotations', + jars=[ + jar(org='org.pantsbuild', name='junit-runner-annotations', rev='0.0.4') + ] +) diff --git a/3rdparty/jvm/org/scala-lang/BUILD b/3rdparty/jvm/org/scala-lang/BUILD index c533d70b6..5d2b96458 100644 --- a/3rdparty/jvm/org/scala-lang/BUILD +++ b/3rdparty/jvm/org/scala-lang/BUILD @@ -14,7 +14,7 @@ # limitations under the License. # ================================================================================================== -REV = '2.9.3' +REV = '2.10.5' def make_lib(name): jar_library(name=name, diff --git a/3rdparty/jvm/org/scala-tools/testing/BUILD b/3rdparty/jvm/org/scala-tools/testing/BUILD index 2992c3170..1beefbca1 100644 --- a/3rdparty/jvm/org/scala-tools/testing/BUILD +++ b/3rdparty/jvm/org/scala-tools/testing/BUILD @@ -14,17 +14,15 @@ # limitations under the License. # ================================================================================================== -jar_library(name='specs_2.9', +jar_library(name='specs', jars=[ # This arrangement gets our version of scalatest playing well with specs; without this, # a scala-library inconsistency - _despite_ matching 2.9.3 monikers at the dep roots - creeps # in. - jar(org='org.scala-tools.testing', name='specs_2.9.3', rev='1.6.9') + jar(org='org.scala-tools.testing', name='specs_2.10', rev='1.6.9') .exclude(org='org.scalatest', name='scalatest'), ], dependencies=[ '3rdparty/jvm/org/scalatest' ] ) - -target(name='specs', dependencies=[':specs_2.9']) diff --git a/3rdparty/jvm/org/scalatest/BUILD b/3rdparty/jvm/org/scalatest/BUILD index 58060d1bf..1f5300dc3 100644 --- a/3rdparty/jvm/org/scalatest/BUILD +++ b/3rdparty/jvm/org/scalatest/BUILD @@ -16,6 +16,6 @@ jar_library(name='scalatest', jars=[ - jar(org='org.scalatest', name='scalatest_2.9.3', rev='1.9.2') + jar(org='org.scalatest', name='scalatest_2.10', rev='1.9.2') ] ) diff --git a/BUILD.tools b/BUILD.tools index 470c2ebd5..e3ad129cf 100644 --- a/BUILD.tools +++ b/BUILD.tools @@ -99,9 +99,9 @@ make_lib('com.google.code.java-allocation-instrumenter', 'java-allocation-instru # ScalaRepl -make_lib('org.scala-lang', 'scala-compiler', '2.9.3', lib_name='scala-repl', +make_lib('org.scala-lang', 'scala-compiler', '2.10.5', lib_name='scala-repl', jars=[ - jar(org='org.scala-lang', name='jline', rev='2.9.3'), + jar(org='org.scala-lang', name='jline', rev='2.10.5'), ] ) diff --git a/pants.ini b/pants.ini index 0fd135ecf..ffe28acba 100644 --- a/pants.ini +++ b/pants.ini @@ -8,7 +8,7 @@ ; pants_workdir: the scratch space used to for live builds in this repo [DEFAULT] -pants_version: 0.0.42 +pants_version: 0.0.44 plugins: [ 'pantsbuild.pants.contrib.scrooge==%(pants_version)s', @@ -120,6 +120,13 @@ config: %(buildroot)s/build-support/scalastyle/scalastyle_config.xml excludes: %(buildroot)s/build-support/scalastyle/excludes.txt +[compile.apt] +strategy: isolated + + +[compile.java] +use_jmake: False + [compile.zinc] # We explicitly list no plugins here since the python and pants ini file handling defaults ini # options from the DEFAULT section. In this case the DEFAULT ini section defines the `plugins` @@ -128,6 +135,29 @@ excludes: %(buildroot)s/build-support/scalastyle/excludes.txt # https://github.com/pantsbuild/pants/issues/1803 plugins: [] +strategy: isolated +worker_count: 4 +zinc: [':zinc'] +jvm_options: [ + '-Xmx2g', '-XX:MaxPermSize=256m', '-XX:+UseConcMarkSweepGC', '-XX:ParallelGCThreads=4', + # bigger cache size for our big projects (default is just 5) + '-Dzinc.analysis.cache.limit=10', + ] + +args: [ + '-S-encoding', '-SUTF-8', + '-S-g:vars', + ] +warning_args: [ + '-S-deprecation', + '-S-unchecked', + # request warnings for http://www.scala-lang.org/api/2.10.4/index.html#scala.language$ + '-S-feature', + ] +no_warning_args: [ + '-S-nowarn', + ] + [jvm-platform] platforms: { @@ -164,4 +194,3 @@ interpreter_requirement: CPython>=2.7,<3 [python-repos] # The custom repo is only needed for antlr-python-runtime. repos: ['https://raw.github.com/twitter/commons/binaries/pants/third_party/python/index.html'] - diff --git a/tests/java/com/twitter/common/metrics/BUILD b/tests/java/com/twitter/common/metrics/BUILD index 4ca096e82..335ddd01e 100644 --- a/tests/java/com/twitter/common/metrics/BUILD +++ b/tests/java/com/twitter/common/metrics/BUILD @@ -17,8 +17,8 @@ java_tests(name = 'metrics', dependencies = [ '3rdparty/jvm/com/google/guava', - '3rdparty/jvm/com/twitter/common:junit-runner-annotations', '3rdparty/jvm/junit', + '3rdparty/jvm/org/pantsbuild:junit-runner-annotations', 'src/java/com/twitter/common/metrics', 'src/java/com/twitter/common/objectsize', 'src/java/com/twitter/common/stats', diff --git a/tests/java/com/twitter/common/metrics/HistogramTest.java b/tests/java/com/twitter/common/metrics/HistogramTest.java index bf8eeecc8..7731e611a 100644 --- a/tests/java/com/twitter/common/metrics/HistogramTest.java +++ b/tests/java/com/twitter/common/metrics/HistogramTest.java @@ -17,8 +17,8 @@ package com.twitter.common.metrics; import org.junit.Test; +import org.pantsbuild.junit.annotations.TestParallel; -import com.twitter.common.junit.annotations.TestParallel; import com.twitter.common.quantity.Amount; import com.twitter.common.quantity.Data; import com.twitter.common.quantity.Time; diff --git a/tests/java/com/twitter/common/stats/ApproximateHistogramTest.java b/tests/java/com/twitter/common/stats/ApproximateHistogramTest.java index b9c40c8af..1471551e6 100644 --- a/tests/java/com/twitter/common/stats/ApproximateHistogramTest.java +++ b/tests/java/com/twitter/common/stats/ApproximateHistogramTest.java @@ -8,8 +8,8 @@ import com.google.common.collect.ImmutableList; import org.junit.Test; +import org.pantsbuild.junit.annotations.TestParallel; -import com.twitter.common.junit.annotations.TestParallel; import com.twitter.common.objectsize.ObjectSizeCalculator; import com.twitter.common.quantity.Amount; import com.twitter.common.quantity.Data; diff --git a/tests/java/com/twitter/common/stats/BUILD b/tests/java/com/twitter/common/stats/BUILD index c80e45a7d..82cc7bdd3 100644 --- a/tests/java/com/twitter/common/stats/BUILD +++ b/tests/java/com/twitter/common/stats/BUILD @@ -18,9 +18,9 @@ java_tests(name = 'stats', dependencies = [ '3rdparty/jvm/org/easymock', '3rdparty/jvm/com/google/guava', - '3rdparty/jvm/com/twitter/common:junit-runner-annotations', '3rdparty/jvm/junit', '3rdparty/jvm/org/mockito', + '3rdparty/jvm/org/pantsbuild:junit-runner-annotations', 'src/java/com/twitter/common/quantity', 'src/java/com/twitter/common/objectsize', 'src/java/com/twitter/common/stats', diff --git a/tests/java/com/twitter/common/stats/WindowedStatsTest.java b/tests/java/com/twitter/common/stats/WindowedStatsTest.java index f87c4ddd1..99d304eb3 100644 --- a/tests/java/com/twitter/common/stats/WindowedStatsTest.java +++ b/tests/java/com/twitter/common/stats/WindowedStatsTest.java @@ -1,8 +1,8 @@ package com.twitter.common.stats; import org.junit.Test; +import org.pantsbuild.junit.annotations.TestParallel; -import com.twitter.common.junit.annotations.TestParallel; import com.twitter.common.quantity.Amount; import com.twitter.common.quantity.Time; import com.twitter.common.stats.WindowedStatistics; diff --git a/tests/java/com/twitter/common/testing/junit/rules/BUILD b/tests/java/com/twitter/common/testing/junit/rules/BUILD index 5245a8da5..6593c0cfe 100644 --- a/tests/java/com/twitter/common/testing/junit/rules/BUILD +++ b/tests/java/com/twitter/common/testing/junit/rules/BUILD @@ -19,7 +19,7 @@ junit_tests( dependencies=[ '3rdparty/jvm/junit', '3rdparty/jvm/com/google/code/findbugs:jsr305', - '3rdparty/jvm/com/twitter/common:junit-runner-annotations', + '3rdparty/jvm/org/pantsbuild:junit-runner-annotations', 'src/java/com/twitter/common/testing/junit/rules', ], sources=globs('*.java') diff --git a/tests/java/com/twitter/common/testing/junit/rules/RetryTest.java b/tests/java/com/twitter/common/testing/junit/rules/RetryTest.java index 4d8cd15f9..c7f1ad370 100644 --- a/tests/java/com/twitter/common/testing/junit/rules/RetryTest.java +++ b/tests/java/com/twitter/common/testing/junit/rules/RetryTest.java @@ -31,8 +31,7 @@ import org.junit.rules.MethodRule; import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.Statement; - -import com.twitter.common.junit.annotations.TestSerial; +import org.pantsbuild.junit.annotations.TestSerial; // SUPPRESS CHECKSTYLE:OFF IllegalThrows public class RetryTest {