Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

Commit

Permalink
Fix problems with SBT and Travis CI builds, update Scala and SBT vers…
Browse files Browse the repository at this point in the history
…ions

Problem

SBT builds for Finagle and associated projects were failing for a number of
reasons, including third-party dependency versions that had been updated for
Pants but not SBT, new tests that are run differently by the SBT test runner,
and changes to JSON serialization that don't work the same on Scala 2.10 and
2.11. Our SBT and Scala versions were also out of date.

Also Travis CI's container-based infrastructure currently has a bug that causes
the build to crash when getting the local hostname with IPv4 on OpenJDK 7
(reported in #3120 on GitHub). Moving back to the standard Travis infrastructure
is a trivial change, so I've included it here.

Solution

I've updated the SBT and Scala versions throughout, and have updated third-party
dependency versions to match the configuration in 3rdparty (note that I've
followed the last update to scrooge/project/build.properties in not updating the
custom SBT script for Scrooge). TwitterServer now uses scala.xml, which is a
separate module in Scala 2.11, so I've added a conditional dependency in the SBT
build.

The new ExitGuard tests were failing on SBT because clients were being left open
in other test suites. I've daemonized all of these clients so that they don't
create exit guards.

In JsonSinkTest in TwitterServer I've desugared an implicit conversion
provided by a view bound because Scala 2.11 prohibits Object as the target of an
implicit conversion.

Because Jackson doesn't correctly serialize Scala case classes that are defined
locally in vals on Scala 2.11, I've moved three case classes out of vals and
into the enclosing objects, changing names where necessary to avoid collisions,
and making each case class private to the object.

I've also switched all projects with a custom SBT script back to the standard
Travis CI infrastructure.

Result

We're on the most recent versions of Scala and SBT, the SBT builds actually
work, and Travis CI won't fail spuriously on OpenJDK 7.

RB_ID=619988
  • Loading branch information
travisbrown authored and jenkins committed Apr 6, 2015
1 parent 161ebed commit 3a88180
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
@@ -1,10 +1,8 @@
language: scala

sudo: false

scala:
- 2.10.4
- 2.11.4
- 2.10.5
- 2.11.6

jdk:
- oraclejdk7
Expand Down
3 changes: 2 additions & 1 deletion project/Build.scala
Expand Up @@ -13,7 +13,8 @@ object Ostrich extends Build {
name := "ostrich",
version := libVersion,
organization := "com.twitter",
crossScalaVersions := Seq("2.10.4", "2.11.4"),
scalaVersion := "2.10.5",
crossScalaVersions := Seq("2.10.5", "2.11.6"),
javacOptions ++= Seq("-source", "1.7", "-target", "1.7"),
javacOptions in doc := Seq("-source", "1.7"),
parallelExecution in Test := false,
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
@@ -1 +1 @@
sbt.version=0.13.7
sbt.version=0.13.8
4 changes: 2 additions & 2 deletions sbt
@@ -1,8 +1,8 @@
#!/bin/bash

sbtver=0.13.7
sbtver=0.13.8
sbtjar=sbt-launch.jar
sbtsha128=b407b2a76ad72165f806ac7e7ea09132b951ef53
sbtsha128=57d0f04f4b48b11ef7e764f4cea58dee4e806ffd

sbtrepo=http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch

Expand Down

0 comments on commit 3a88180

Please sign in to comment.