Upgrade to Pro — share decks privately, control downloads, hide ads and more …

sbt 2.0: takeoff

sbt 2.0: takeoff

'sbt 2.0: takeoff' given at Scala Days Berlin 2026 (2026-10-12).

Avatar for Eugene Yokota

Eugene Yokota

October 12, 2026

Other Decks in Programming

Transcript

  1. • sbt 2.0 w s rele sed in June 2026!

    a a • sbt 2.1.0-RC1 is here too
  2. 1. build.sbt DSL 2. sbtn + sbt server 3. T

    sk ch nges 4. C ching a a a a 5. Plugin migr tion 1
  3. Mythology of the build de inition • sbt 0.7: Build

    s build.properties + Sc l code p oject.name=Unf lte ed Web Toolkit sbt.ve sion=0.7.4 build.scala.ve sions=2.8.0 2.7.7 lazy val lib a y = p oject("lib a y", "Unf lte ed", new Unf lte edModule(_) { val codec = "commons codec" % "commons codec" % "1.4" }) • sbt 0.10: Build s inspect ble settings using <<=, <++= oper tor etc inside project/Build.sc l lib a yDependencies < = scalaVe sion(v Sha ed.specsDep(v) % "test" Seq( type-s fe, inspect ble settings, dv nced plugins )) • sbt 0.13: Uni ied tow rds .v lue nd := oper tor, nd AutoPlugin m de plugins compos ble • sbt 1.x: Uni ied tow rds multi-project build.sbt, introduced sl sh synt x ThisBuild / sc l Version • sbt 2.x: Resurgence of b re settings, t sks re c ched by def ult a a a a a a a f a a a r i a a a a r a a a i - > = a r r a a r a a a a - a r + + r r = a : a a i r r f i r f r r = r . : a r . . r r name "unf lte ed" scalaVe sion "3.9.0"
  4. sbt 2.x: common settings _ scalaVe sion o ganization "3.9.0"

    name.value + "aa" B re settings These will be prepended to ll subprojects, which emul tes dyn mic disp tch of RHS expressions lazy val sub1 = p oject .settings(name "sub1") r = : r r a = = a : : = : = : a r a r a lazy val sub2 = p oject .settings( name "sub2", publish doPublish(o ganization.value), )
  5. Client-server by default _ sbt r r a - -

    - - a a sbt sbt 1.x sbt 2.x sbt ✅ sbt shell (1 process) ✅ sbtn + sbt server (2 processes) sbt compile ⚠ sbt b tch mode (1 process) ✅ sbtn + sbt server (2 processes) client compile sbtn + sbt server (2 processes) sbtn + sbt server (2 processes) se ve sbt b tch mode (1 process) sbt b tch mode (1 process) compile
  6. sbt server: Performance Testing with Pekko (42 subprojects + too

    many local plugins) sbt 2.1.0-RC1 Cold lo d time sbt se ve exit W rm lo d (second time) time sbt se ve exit r r r r - - - - a a a sbtn time sbt exit time sbt exit 77.2s 14.0s 0.32s
  7. sbt server "Because a build is just a giant, shared,

    mutable, state device." — Josh Suereth user or gent from the termin l shell sbtn sbt server IDE a a a a a a a IDEs sh re the s me build sem ntics s CI foo/test publish b r/test ...
  8. update task _ sbt 1.x sbt 2.0 sbt 2.1 Coursier

    ✅ ✅ ✅ BOM (bill of m teri ls) support ❌ ✅ ✅ dependency locking ❌ ⚠ ⚠ r - - r r r a a r r r r lib a yDependencies += ("com.faste xml.jackson" % "jackson bom" % "2.21.0").pomOnly() lib a yDependencies += "com.faste xml.jackson.co e" % "jackson co e" % "*"
  9. compile task _ sbt 1.x sbt 2.0 sbt 2.1 compile

    Sc l 2.10 - 3.x ✅ ✅ ✅ c ching ⚠ (requires explicit pull/ push) ✅ ✅ • S me s sbt 1.x, it supports Sc l 2.10, 2.11, 2.12, 2.13, nd 3.x, where compiler bridge for 2.13 nd 3.x re m int ined by Sc l compiler te m (LAMP nd VirtusL b). a a a a a a a a a a a a a a a a a a a a a • Disk c ched by def ult. Option lly remote c ched.
  10. _ run sbt 1.x sbt 2.0 sbt 2.1 ⚠ ✅

    ✅ • In sbt 1.x, run t sk blocks the server; in sbt 2.x, run t sk def ults to client-side run where sbtn forks fresh JVM on its own. IDE sbt server sbtn a a a pp a a run task
  11. console task _ sbt 1.x sbt 2.0 sbt 2.1 ⚠

    ✅ ✅ console a a a a a a a a a a a • In sbt 1.x, console t sk blocks the server; in sbt 2.x, console t sk def ults to clientside run where sbtn forks fresh JVM on its own. This is p rticul rly useful to support JLine upd te in Sc l 3.9 ( nd l ter).
  12. test task (1): incremental test _ supports multiple test fr

    meworks increment l full sbt 1.x sbt 2.0 sbt 2.1 ✅ ✅ ✅ ⚠ testQuick ✅ test < rg> (c ched) ✅ test < rg> (c ched) testFull / testOnly test < rg> --c che_test_result=f lse test New in 2.1 a a a a a a a a a a a a • In sbt 2.x, the test results re c ched by def ult.
  13. test task (2): query _ $ sbt /test U iSpec

    subproject test suite $ sbt foo /test U iSpec subproject $ sbt @platfo m=sjs1@scalaBina yVe sion=3/test r . . . r r r . r . . . . . r . . . . . . . . . subproject New in 2.1 U iSpec
  14. test task (3): summary _ $ sbt New in 2.1

    : r r r r r r o ] Test summa y (3 test tasks failed) o ] scoptJS / Test / testQuick o ] scopttest.U iSpec FAIL o ] scoptJVM / Test / testQuick o ] scopttest.U iSpec FAIL o ] scoptNative / Test / testQuick o ] scopttest.U iSpec FAIL o ] o ] failed: total 3, failed 3, e o s 0, passed 0, cached 0 o ] elapsed time: 14 s, cache 87%, 73 disk cache hits, 10 onsite tasks r . . . r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r [e [e [e [e [e [e [e [e [e [e /test
  15. test task (4): summary _ New in 2.1 $ sbt

    /test test_summa y=success : r r r r r r r r r - - . . . r r r r r r r r r r r r r r r r r r r r r r r r r r r [e o ] Test summa y (3 test tasks failed) [e o ] scoptJS / Test / testQuick [e o ] scopttest.ImmutablePa se Spec [e o ] scopttest.Issue239 [e o ] scopttest.Issue264 [e o ] scopttest.Issue312 [e o ] scopttest.MonadicPa se Spec [e o ] scopttest.MutablePa se Spec [e o ] scopttest.U iSpec .... (cached) PASS (cached) PASS (cached) PASS (cached) PASS (cached) PASS (cached) PASS FAIL
  16. test task (5): forked test _ forked test sbt 1.x

    sbt 2.0 sbt 2.1 ⚠ ⚠ ✅ • In sbt 1.x nd 2.0, forked tests typic lly run 1 subproject t time; in sbt 2.1, this c n be con igured using workerM xInst nces setting (def ult 2). a a a a a a a a a f • Subprojects c n set Test / testTopology to TestTopology.subprojectExclusive or TestTopology.subprojectSplit(n). New in 2.1
  17. publish task _ publish to M ven Centr l etc

    sbt 1.x sbt 2.0 sbt 2.1 ✅ ✅ ✅ a a a New in 2.1 • sbt 2.0 still uses Ap che Ivy for publishing; sbt 2.1 is Ivyless
  18. clean task _ sbt 1.x sbt 2.0 sbt 2.1 resets

    t sk c che, e.g. for compile ✅ ❌ ✅ full cle n cle nFull cle nFull a a a a a a a a a a a New in 2.1 • In sbt 2.1 cle n cts s one-time c che inv lid tor
  19. sbt 2.x (remote) caching _ CI (Jenkins etc) Remote C

    che • sbt 1.x executes t sks in p r llel L ptop1 • In sbt 2.x, t sks c n be c ched L ptop2 • sbt 2.x c ches the compil tion nd test results by def ult L ptop3 git a a a a a a a a a a a a a a a a a a Illustr tion purpose only. Your mile ge m y v ry.
  20. chimney microbenchmark _ sbt 1.x sbt 2.1 test 125s (w

    llclock) 123s (w llclock) test (2nd time) + empty disk c che + w rm remote c che _ 11s (w llclock) a a a a a a a a • Using GitHub Actions Linux im ge: https://github.com/sbt/sbt/ ctions/ runs/38068598286. ymmv
  21. sttp microbenchmark _ sbt 2.1 (w llclock) c che %

    test hit r te test (1st) 80s 28% 0 / 37 test (2nd time) + empty disk c che + w rm remote c che 19s 100% 37 / 37 70% 29 / 37 (78%) test (3nd time) + revert commit + empty disk c che + w rm remote c che 45s • Running " ll core/test c ts/test fs2/test" a a a a a a a a a a a a a • Using GitHub Actions Linux im ge: https://github.com/sbt/sbt/ ctions/runs/ 38068598286. ymmv
  22. Bazel-compatible caching Disk cache and/or remote cache • You c

    n dminister n open source remote c che, or choose from c che hosting services: a a a a a a a New in 2.1 • sbt 2.1 supports HTTP server s remote c che.
  23. All tasks are cached: AST forms Merkle tree task 3

    is cached by default task3 { val t1 = task1.value val t2 = task2.value other settings and cached tasks t1 + t2 } static shape of the code New in 2.1 task 5 sho t ci cuits in sbt 2.1 task5 task4.value r - r = = : : / dynamic task is uncached / / / sbt 2.x: tasks provide structural caching
  24. declaring the output capturing the IO e ect someTask {

    val conv = f leConve te .value val out: java.nio.f le.Path = c eateFile( ) val vf: xsbti.Vi tualFile = conv.toVi tualFile(out) Def.decla eOutput(vf) M teri lize the ile on c che hit 1 } . . . r r r a r ff i a r i f r = : a a This will just memorize the t sk output
  25. sbt 2.x provides multiple ways to opt out of caching

    1. Per t sk inst nce val someKey = taskKey[St ing]("something") someKey Def.uncached { } 2. Per t sk-key @t ansient val someKey = taskKey[St ing]("something") . . . r r . . . a = = : : a a r someKey will not be cached someKey { } / / opting-out of caching
  26. sbt 2.x provides multiple ways to opt out of caching

    New in 2.1 1. As build user opt out of caching cacheSto es Nil 2. Per t sk s build user opt out of compilation cache Compile / compile / cacheSto es Nil Test / compile / cacheSto es Nil = Nil : = : r = : r r = : r a / / a / opt out of test cache Test / test / cacheSto es / / / opting-out of caching (2) New in 2.1
  27. plugin migration _ number of plugins sbt 0.13 sbt 1.x

    sbt 2.x sbt 2.1 ~390 (5 ye rs) ~795 (9 ye rs) ~182 (4 months*) ??? • Plugins re often prerequisite to build migr tion • E ch m jor rele se "burns the forest" a a a a a a a a • In 2017, the community migr ted 116 plugins from sbt 0.13 to 1.x
  28. _ • M jor plugins centr lized to GitHub sbt

    org niz tion. Bintr y shutdown in 2021 cceler ted this. • sbt 2.x plugin migr tion wiki p ge w s cre ted to coordin te community e ort in October 2024, when sbt 2.0.0-M2 c me out • sbt 2.0.0-RC1 w s rele sed in August 2025 to lock down ABI with sbt 2.0 • An tolii Kmetiuk (Sc l Center) cre ted sbt2-comp t plugin to id cross building • Mix of direct involvement (Sc l .JS migr tion by Rikito T niguchi t VirtusL b, sbtn tive-p ck ger by Eugene Yokot nd Jo o Ferreir ) nd community e orts ff a ff a a a a a a a a a a a a a ã a a a a a a a a a a a a a a a a a a a a • Once sbt 2.1 comes out we should republish on Sc l 3.9 LTS a a plugin migration
  29. future outlook _ • Keep ixing bugs (213 bug ixes

    since 2.0.0, mix of old nd new) • RFC-5: test scheduling (persistent worker etc) • Forked compil tion • Better coordin tion with IDEs a f a a a a f • Perform nce optimiz tions
  30. Get involved How can I get help / help? •

    Try it out: sbt.version=2.1.0-RC1 • Improve the docs: 'The Book of sbt' • Help other users t work, St ckover low, Discord • Write plugins / port plugins • Report bugs / join discussion • Fix bugs f a a a a a • Don te to Sc l Center
  31. Plugin p rk r ngers a a a a a

    a a à a a a a a a a a a a a a a ã a a a a a sbt 2.x contributors 834 Eugene Yokot (eed3si9n) 373 Kenji Yoshid (xuwei-k) 146 Adrien Piquerez 55 An tolii Kmetiuk 51 Jerry T n (friendseeker) 43 Bri n Hotopp 22 Albert Meltzer 16 St s Shevchenko 14 M i Huy Ho ng 14 Y suhiro T tsuno 12 M tt Dziub n 10 Jo o Ferreir 9 Anton Sviridov 9 M tthi s Kurz nd m ny others a a Speci l th nks to the former m int iners M rk H rr h, Josh Suereth, D le Wijn nd Questions?
  32. Early era 2009 - 2012 • Led by M rk

    H rr h, then Types fe tooling te m (M rk, Josh Suereth) • sbt 0.4/0.5 (2009) p r llel execution, %% oper tor • sbt 0.7 (2010) l uncher with independent Sc l version, ++ oper tor • sbt 0.10 (2011) introduced • build.sbt build de inition using <<= oper tor • API-b sed increment l compil tion • sbt 0.12 (2012) forked test, increment l test, o ici l inst llers a a a a a a a ff a a a a a a a a a f a a a a a a • Josh Suereth nd Antonio Cunei (Types fe) developed Dbuild (2012)
  33. sbt 0.13 era 2013 - 2016 • Led by Types

    fe tooling te m (Josh Suereth, then Eugene Yokot nd D le Wijn nd) • sbt 0.13 (2013) introduced .v lue synt x, in ddition to <<= oper tor • Types fe rele sed irst version of Activ tor, browser-b sed editor • sbt 0.13.2 (2014) Grzegorz Koss kowski dded n me-h shing increment l compiler • sbt 0.13.5 (2014) Josh Suereth designed AutoPlugin th t tr cks plugin dependencies • sbt 0.13.7 (2014) W rs w Sc l Enthusi sts removed bl nk lines in build.sbt a a a a a a a a a a a a a a a a a a a a a a a a f a a a a a • sbt 0.13.13 (2016) dded sbt new for Giter8 integr tion
  34. sbt 1.x era 2017 - 2020 • Led by Lightbend

    tooling te m, then Eugene Yokot nd Sc l Center • sbt 1.0 (2017) shipped with bin ry comp tibility promise, still holding for 9 ye rs • Split Zinc to its own repository. cl ss-b sed n me-h shing • sbt 1 migr tion st tus (2017) mentioned plugin migr tion e ort by Kenji Yoshid et l • sbt 1.1 (2018) uni ied sl sh synt x nd sbt server • sbt 1.3 (2019) Coursier bec me the def ult libr ry m n gement engine, super shell a a a a a a a a ff a a a a a a a a a a a a a a a a a a a a a f a a a • sbt 1.4 (2020) Eth n Atkins dded sbtn, Adrien Piquerez (Sc l Center) dded BSP support, c ched compil tion
  35. Estuary era 2021 - 2024 • Led by Eugene Yokot

    nd Sc l Center • sbt 1.5 (2021) Adrien Piquerez (Sc l Center) dded built-in Sc l 3 support • Eugene: sudori p rt 1 to 3 post (2021) documenting Sc l 3 port of sbt m cros • Bintr y, which previously hosted plugins, shutdown in 2021. Eugene led the migr tion to Artif ctory nd M ven Centr l • Eugene: 'sbt 2.0 ide s' post (2023) for Tooling Summit, sbt 2.0.0- lph 7 • sbt 1.10.0 (2024) Luk s Rytz dded SIP-51 support for Sc l 2.13 evolution a a a a a a a a a a a a a a a a a a a a a a a a a a a a a • Eugene: 'sbt 2.x remote c che with B zel comp tibility' (2024), sbt 2.0.0-M2
  36. Current era 2025 - current • Led by Eugene Yokot

    nd Sc l Center • M ny contributors like Kenji Yoshid , St s Shevchenko, M i Huy Ho ng, Albert Meltzer • sbt 1.11.0 (2025) dded Son type publishing integr tion • sbt 2.0.0-RC2 (2025) rele sed with bin ry comp tibility with 2.x • sbt 2.0 gr nted Sovereign Tech Fund (2025) long with Scover ge etc • sbt 1.12.0 (2026) dded Sc l 3.8 REPL support à a a a a a a a a a a a a a a a a a a a a a • sbt 2.0.0 (2026) rele sed
  37. • For e ective c ching, we need super repe

    t ble build. In B zel lingo, build th t is st ble g inst m chine- nd time is c lled hermetic. • No bsolute p ths, timest mps, rbitr ry network c lls, system properties, or system libr ries a a a a a a a a a a a a a a a a a ff a a a • All build t kes pl ce on 2010-01-01 a a caching is hermeticity-hard
  38. 2011 2008 2010 sbt 0.9.0 sbt 0.3.1 2009 sbt 0.4.0

    sbt 0.7.0 sbt 0.10.0 l uncher sbt 0.11.0 2022 2024 2020 2015 2014 2026 sbt 1.5.0 sbt 1.10.0 sbt 1.4.0 sbt 0.13.5 sbt 0.13.8 2013 2017 sbt 2.0.0 2012 CVE ix 2023 SIP-51 2025 BSP 2018 2019 2021 sbt 0.13.0 AutoPlugins sbt 1.0.0 2016 sbt 0.12.0 sbt 1.1.0 sbt 1.3.0 sbtn sbt 1.5.0 sbt 1.9.0 sbt 1.11.0 Sc l 2.10 sbt 0.13.13 Sc l 2.12 Sl sh Coursier remote Sc l 3 support POM consistency Centr l Repo h rr h jsuereth gkoss kowski eed3si9n dwijn nd Duhemm jvic n e tkins dpi2 Friendseeker xuwei-k n toliykmetyuk • I'm Eugene (eed3si9n), third-gener tion m int iner for sbt in my free time a a a a a a a a a a a f a a a a a a a a a a a a • sbt is 18 ye rs old, nd I joined in its 6th ye r fter writing m ny plugins a a a About the author