sbt 1.0.4 hotfix and the performance fixes

By Eugene Yokota (@eed3si9n) November 27, 2017

Hi everyone. For those living in the US, I hope you had a nice Thanksgiving weekend. It’s one of my favorite times of the year, cooking meals together with family and friends and exchanging stories.

I would also like to announce sbt 1.0.4, which is a hotfix to sbt 1.0.x series. This is a binary compatible release for sbt 1 focusing on bug fixes. sbt 1 is released under Semantic Versioning, and the plugins are expected to work for sbt 1.x series.

Performance regression fixes

Speaking of Thanksgiving, I am thankful to all the contributors to Scala tooling ecosystem: Not just for coding contributions to sbt but also thought-provoking blog posts (e.g. Haoyi’s So, what’s wrong with SBT?), talks (e.g. Jeff’s Beyond the Build Tool), documentations, IDEs/editor interations, and alternative build tools (e.g. Chris’s cbt). Rather being cynical and just saying “sbt sucks!” these folks are rolling up their sleeves to fix sbt or come up with alternative solutions.

A number of folks have jumped in to tackle some of the performance regressions reported for sbt 1.

  • Jorge (@jvican) from Scala Center has been looking into various perf improvements, and in Zinc 1.0.5 that is shipped with sbt 1.0.4, he provided the fix for classpath hashing performance by caching the hash result per JAR file.
  • Sam Halliday (@fommil)โ€ has also been working on the classpath hashing issue, providing a public reproduction project, and sending a few pull requests.
  • OlegYch (@OlegYch) fixed a performance regression of testQuick. #3680/#3720
  • Leonard Ehrenfried (@leonardehrenfried) has been also looking into a performance benchmark and created an automated running harness based on Sam’s work. In addition, he has send a fix for Ivy-log4j performance regression. #3711/util#132
  • From the Lightbend Tooling team, Dale (@dwijnand) has been looking into performance related issues, and getting insights from our in-house experts.

Here’s the no-op compile performance of sbt 1.0.4 using Leonard / Sam’s test project with 25 subprojects.

Note: I have subtracted the startup time from the benchmark report’s compile time, assuming you’d have sbt session already running:

sbt 0.13.16 sbt 1.0.3 sbt 1.0.4
startup 28s 38s 34s
no-op compile* 27s 46s 22s
no-op compile x2* 37s 80s 33s

As you can see, sbt 1.0.3 regressed in no-op compilation, and sbt 1.0.4 makes it 10 to 20% faster than 0.13.16.

Java 9 related fixes

sbt 1.0.4 removes some uses of reflection in Ivy that was causing warnings on Java 9, and Yoshida-san (@xuwei_k) fixed a bug we introduced in a previous version. With these changes propagated to both the launcher and library management, we should see fewer warnings.

Scala 2.13.0-M2 support

Adriaan (@adriaanm) has been improving the code structure around Scala’s REPL in Scala’s 2.13.x branch. This required some adjustment on sbt, and we are happy that we are addressing that while 2.13 is still at a milestone. This was a weird one since we had to confirm that it works by compiling the bridge using Scala 2.13.0-M2 using sbt 1.0.3, but sbt 1.0.3 can’t compile 2.13.0-M2 yet.

zinc#453 by @eed3si9n and @jan0sch

Other bug fixes

Participation

Thanks again to everyone who’s helped improve sbt and Zinc 1 by using them, reporting bugs, improving our documentation, porting builds, porting plugins, and submitting and reviewing pull requests.

sbt 1.0.4 was brought to you by 17 contributors, according to git shortlog -sn --no-merges v1.0.3..v1.0.4 on sbt, zinc, librarymanagement, util, io, and website: Eugene Yokota, Kenji Yoshida (xuwei-k), Jorge Vicente Cantero (jvican), Dale Wijnand, Leonard Ehrenfried, Antonio Cunei, Brett Randall, Guillaume Martres, Arnout Engelen, Fulvio Valente, Jens Grassel, Matthias Kurz, OlegYch, Philippus Baalman, Sam Halliday, Tim Underwood, Tom Most. Thank you!

For anyone interested in helping sbt, there are many avenues you could help, depending on your interest.

  • Migrate library builds to sbt 1, or update plugins.
  • Report bugs when you see them.
  • Send in fixes to bugs.
  • Update documentation.

If you’re interested in other ideas, come talk to us on sbt-contrib.