From 494f1e6161881d13c7bd29441efcba62d794ae7a Mon Sep 17 00:00:00 2001 From: Adam Singer Date: Thu, 11 Mar 2021 01:05:10 +0000 Subject: [PATCH] [SCALA] Upgrade source to Scala 2.12.13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem ======= Upgrade source to https://github.com/scala/scala/releases/tag/v2.12.13 from https://github.com/scala/scala/releases/tag/v2.12.12. This upgrade includes a highlighted feature of configurable warnings and errors (https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html / https://github.com/scala/scala/pull/9248). Other noticable changes our code based will experience * Exhaustivity warnings for patterns involving tuples * Better type checking for `CharSequence` arguments https://github.com/scala/scala/pull/9292 * Simplified Reporters https://github.com/scala/scala/pull/8338 * Promotion of `-deprecation` to `-Xlint:deprecation` https://github.com/scala/scala/pull/7714 * Improves performance of building `immutable.{TreeMap,TreeSet}` by using mutation within the builder https://github.com/scala/scala/pull/8794 Full list of changes can be found at https://github.com/scala/scala/pulls?q=is%3Amerged+milestone%3A2.12.13+ Solution ======== * Bump `BUILD` file `SCALA_REV` && `SCALAC_REV_FOR_DEPS`. * Depdnencies which are not built for scala 2.12.13 needed to be bumped `SEMANTICDB_PLUGIN_REV` && `SEMANTICDB_REV` && `SCALAFIX_REV`. * Include `-S-Xlint:-deprecation` to `pants.ini` preventing build failures on deprecated annotations (existing behavior) * Bump `cache_key_gen_version` in `pants.ini` for newly built artifacts on different scala version. * Removed scalafix plugin (`scalac-profiling`) which is not built for 2.12.13. `scalac-profiling` code looks abandoned by ~3 years. * Updated all failing tests that could have depended or expected ordered sequences when the sequence was generated from non ordered collections. Notes ===== It seems a few tests and golden files in source have depended or tested against a stable sort order when sorted order is not guaranteed. This has been seen in a few places such as output json objects (map key fields), code that uses `groupBy` for rekeying results to the user and transforming into sequences, strings built from sequences or maps that are not guaranteed to be ordered. The following PR are related to this change in expectations https://github.com/scala/scala/pull/8794 https://github.com/scala/scala/pull/8948 https://github.com/scala/scala/pull/9218 https://github.com/scala/scala/pull/9376 https://github.com/scala/scala/pull/9091 https://github.com/scala/scala/pull/9216 We took the liberty updating tests with what the current map order would be or updating the test in a way that wouldn't depend on order. Since we may not fully understand all the context of the tests we are hoping this either signals to the owners that there might be some issue with assumed order or signal that upgrading might break implementations due to bug in scala 2.12.13. {D611202} will improve the files changed for workflow builder outside of this change. Please feel to reach out directly and discuss the changes here or bring up issues with this upgrade. Slack [[https://app.slack.com/client/T86S8GHEG/C01NZAFRLFK|#scala-upgrade-2-12-13]] JIRA Issues: SCALA-25 Differential Revision: https://phabricator.twitter.biz/D607826 --- .../scala/com/twitter/finatra/kafka/test/utils/PollUtils.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kafka/src/test/scala/com/twitter/finatra/kafka/test/utils/PollUtils.scala b/kafka/src/test/scala/com/twitter/finatra/kafka/test/utils/PollUtils.scala index 0b94954511..524119cf2a 100644 --- a/kafka/src/test/scala/com/twitter/finatra/kafka/test/utils/PollUtils.scala +++ b/kafka/src/test/scala/com/twitter/finatra/kafka/test/utils/PollUtils.scala @@ -9,7 +9,7 @@ object PollUtils extends Logging { func: => T, sleepDuration: Duration = 100.millis, timeout: Duration = 60.seconds, - @deprecated("Use timeout") maxTries: Int = -1, + @deprecated("Use timeout", since = "2020-03-02") maxTries: Int = -1, pollMessage: String = "", exhaustedTimeoutMessage: => String = "", exhaustedTriesMessage: (T => String) = (_: T) => ""