Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a JDK11 and JDK12 build to the Travis matrix #1953

Merged
merged 10 commits into from
Jul 21, 2019
Merged

Add a JDK11 and JDK12 build to the Travis matrix #1953

merged 10 commits into from
Jul 21, 2019

Conversation

farmdawgnation
Copy link
Member

Given that JDK 11 is the new LTS release of the JDK, we should ensure our tests pass in it. The runtime bytecode is guaranteed to be compatible, but there are some changes to the default classpath that could affect our behavior.

@farmdawgnation
Copy link
Member Author

Ah, right. sbt.

@Shadowfiend
Copy link
Member

🙃

@farmdawgnation
Copy link
Member Author

Sure enough we're failing on JDK11!

[error] Error: Total 309, Failed 0, Errors 1, Passed 308, Pending 27
[error] Error during tests:
[error] 	net.liftweb.mongodb.record.MongoFieldSpec
[error] (lift-webkit / Test / compileIncremental) Compilation failed
[error] (lift-mongodb-record / Test / test) sbt.TestsFailedException: Tests unsuccessful

I'm taking a look.

@farmdawgnation farmdawgnation self-assigned this Jul 13, 2019
Given Oracle's recent licensing changes, we probably want to switch to
using OpenJDK since a *lot* of folks will be switching to using OpenJDK
When running in jdk11, the lines method returns a java Stream.
linesIterator appears to return the Scala iterator we expect
@farmdawgnation
Copy link
Member Author

Couldn't repro the mongodb record failure locally so I'm guessing that was transient. Fixed the compile issues in webkit.

We're experiencing a stack overflow in Travis when running the mongo
field spec on JDK11. It seems like it's a specs2 issue so I'm going to
attempt a version bump to see if that fixes the issue.
@farmdawgnation
Copy link
Member Author

Holy crap the build is green

@farmdawgnation farmdawgnation changed the title Add a JDK11 build to the Travis matrix Add a JDK11 and JDK12 build to the Travis matrix Jul 13, 2019
@farmdawgnation
Copy link
Member Author

Ok, JDK 12 is now also in the mix. JDK 13 is fresh off the presses but we'll give it a bit before we try that out.

Copy link
Member

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple of remarks, not 100% approve-ready but I think we're close.

sudo: false

scala:
- 2.11.11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like 2.11.12 is a thing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to version bump that later but this has been languishing awhile, let's not hold it up.

@@ -153,7 +153,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito {

js.toJsCmd must be matching("""(?s)\Qlift.onEvent("lift-event-js-\E[^"]+\Q","event",function(event) {doStuff;});
|lift.onEvent("hello","event",function(event) {doStuff2;});
|lift.onEvent("lift-event-js-\E[^"]+\Q","event",function(event) {doStuff3;});\E""".stripMargin('|').lines.mkString("\n").r
|lift.onEvent("lift-event-js-\E[^"]+\Q","event",function(event) {doStuff3;});\E""".stripMargin('|').linesIterator.mkString("\n").r
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This turns out to be because of this guy: scala/bug#11125

A note from that issue:

note that it isn't safe to rely on the compiler to catch bad uses of .lines, you want to search your source code and find all of them

yes, often the compiler will catch it, e.g. s.lines.toVector fails to compile because Java's Stream doesn't have toVector

but more devious is something like s.lines.filter(...) == .... Java's Stream has filter, and == isn't type-safe, so if you're lucky you'll get a "are unrelated: they will most likely never compare equal" warning ... if you're lucky... and if you're lucky enough to spot the warning in your code's big pile of warnings it already generates that you tune out now...

I guess a Scalafix rewrite could help here, and wouldn't have false positives if you are using .lines method on something other than a String

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oy vey.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I just realized this probably means we've got to hunt all uses of lines down. ffffff

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like I can pick this particular issue up in the 2.13 PR, since I think that'll catch issues? Not sure.

scalaVersion in ThisBuild := "2.12.6"
crossScalaVersions in ThisBuild := Seq("2.12.6", "2.11.11")
scalaVersion in ThisBuild := "2.12.8"
crossScalaVersions in ThisBuild := Seq("2.12.8", "2.11.11")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto re: 2.11.12.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to version bump that later but this has been languishing awhile, let's not hold it up.

Copy link
Member

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's start up our cross-build and deal with the other two tidbits separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants