Skip to content

Commit

Permalink
oss: update all projects with JDK 11 support and travis builds
Browse files Browse the repository at this point in the history
Problem

We want to be able to build and test using JDK 11, but
Dodo and Scrooge do not use compatible Scala and SBT
versions.

Solution

Update Scala and SBT versions used by dodo and scrooge
from Scala 2.10.6 to 2.10.7 and SBT from 0.13.16 to
0.13.18. Each SBT file will contain GC options that
are compatible with the active JDK version. Some logic
has been updated to fix runtime behavior in JDK 11.

Result

Projects can be compiled and tested by both JDK 8 and JDK 11.

JIRA Issues: CSL-8513

Differential Revision: https://phabricator.twitter.biz/D365075
  • Loading branch information
enbnt authored and jenkins committed Oct 24, 2019
1 parent 123452d commit 04def84
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ scala:

jdk:
- openjdk8
- openjdk11

notifications:
slack:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Unreleased
Runtime Behavior Changes
~~~~~~~~~~~~~~~~~~~~~~~~

* finagle: Add initial support for JDK 11 compatibility. ``PHAB_ID=D365075``

* finagle: Upgrade to caffeine 2.8.0 ``PHAB_ID=D384592``

Breaking API Changes
Expand Down
23 changes: 23 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ def travisTestJavaOptions: Seq[String] = {
}

def gcJavaOptions: Seq[String] = {
val javaVersion = System.getProperty("java.version")
if (javaVersion.startsWith("1.8")) {
jdk8GcJavaOptions
} else {
jdk11GcJavaOptions
}
}

def jdk8GcJavaOptions: Seq[String] = {
Seq(
"-XX:+UseParNewGC",
"-XX:+UseConcMarkSweepGC",
Expand All @@ -115,6 +124,20 @@ def gcJavaOptions: Seq[String] = {
)
}

def jdk11GcJavaOptions: Seq[String] = {
Seq(
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSParallelRemarkEnabled",
"-XX:+CMSClassUnloadingEnabled",
"-XX:ReservedCodeCacheSize=128m",
"-XX:SurvivorRatio=128",
"-XX:MaxTenuringThreshold=0",
"-Xss8M",
"-Xms512M",
"-Xmx3G"
)
}

val withTwoThirteen = Seq(
crossScalaVersions += "2.13.0",
libraryDependencies += scalaCollectionCompat
Expand Down

0 comments on commit 04def84

Please sign in to comment.