internal: Migrate build to sbt 2.0.1#4185
Merged
Merged
Conversation
sbt 2.x runs its build DSL on Scala 3 and changes several defaults (cached tasks, eviction-as-error, platform-aware %%), so the whole build tooling needed updating rather than a version bump alone. Plugin replacements, chosen to have real sbt 2.x artifacts: - sbt-scalajs-crossproject + sbt-scala-native-crossproject -> org.wvlet.uni:sbt-uni-crossproject - sbt-revolver (reStart) -> org.wvlet.uni:sbt-uni (uniRestart) - scalajs-env-jsdom-nodejs / PWEnv (no Scala 3 build) -> sbt-uni-playwright (PlaywrightJSEnv) - sbt-antlr4 (no sbt 2.x build) -> invoke the ANTLR4 tool directly from a sourceGenerators task in airframe-sql sbt-airframe has no published sbt 2.x artifact, so it is migrated in-repo (Scala 3.8.3, FileConverter/Def.uncached fixes) and consumed by the root build via SBT_AIRFRAME_VERSION. integrationTest keeps AirframeHttpPlugin because its purpose is to test that plugin's own client codegen. Source-level fixes for the Scala 3 build DSL: vararg splices (xs* ), parenthesized single-arg lambdas, PathFinder.get(), Def.uncached wrapping for File/JSEnv/CompileAnalysis-typed tasks, %%% -> %%, and evictionErrorLevel := Warn to restore sbt 1.x eviction behavior. Validated: projectDotty/compile, "++2.13; projectJVM/compile", projectJS/compile, projectNative/compile, sbt-airframe publishLocal, and airspecJVM/compile. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
sbt-airframe is now a Scala 3 plugin, so its release must publish the _3 (not _2.12) airframe libraries it depends on; fix the release workflow accordingly. Replace the machine-specific local dynver snapshot default for SBT_AIRFRAME_VERSION with the next release version (2026.1.8), matching the repo convention (a real, env-overridable release). Until that tag is published, local builds set SBT_AIRFRAME_VERSION to the snapshot from scripts/dynver.sh after sbt-airframe/publishLocal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Three CI failures surfaced on the migration PR:
- AirSpec (Scala.js): scalajs-test-interface is a plain Scala-versioned
artifact published only for 2.12/2.13, but sbt 2.x's platform-aware
%% (and .cross in a Scala.js project) appended a nonexistent _sjs1_
suffix. Pin the Scala binary suffix explicitly (Scala 3 -> 2.13).
- sbt-airframe scalafmt crashed ("last of empty IndexedSeq") because
sbt-airframe/.scalafmt.conf still pinned runner.dialect = scala212
while the migrated plugin now uses Scala 3 syntax; switch to scala3
and align the scalafmt version with the root config.
- The root build's metabuild needs the not-yet-released sbt-airframe
plugin to load, so every job that loads it failed to resolve
org.wvlet.airframe:sbt-airframe_sbt2_3:2026.1.8. This is a release
deadlock (the plugin can only be released from main after this merges).
Add a temporary composite action that publishes sbt-airframe locally
at that version and wire it into the affected jobs. Remove it once
sbt-airframe 2026.1.8 is on Maven Central.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- YamlReaderTest (and other resource-loading tests) failed because sbt 2.x defaults exportJars to true, packaging test resources into jars that file-based resource loaders (YamlReader) can't read. Restore the sbt 1.x class-directory classpath with exportJars := false. - RxRenderingTest asserted an exact attribute serialization order that jsdom happened to produce; under the PlaywrightJSEnv (real chromium) the order differs. Assert each attribute independently. The jsdom env can't be kept: it has no Scala 3 build and its latest release (1.1.1) is binary-incompatible with current Scala.js jsenv APIs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
TracerTest wrote to target/trace.json, which failed under sbt 2.x (FileNotFoundException) because the base target/ directory is no longer guaranteed to exist (sbt 2.x uses target/out/...). Create the parent directory in newTracer so the API is robust regardless of cwd layout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The openapi scripted test expected target/openapi.yaml, but the plugin default airframeHttpOpenAPITargetDir := target.value now resolves to sbt 2.x's versioned target/out/... directory. Restore the sbt 1.x location (baseDirectory/target) so the generated spec lands where users (and the scripted test) expect, and align the test's check task. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Tick the box to add this pull request to the merge queue (same as
|
sbt-airframe now supports only sbt 2.x (Scala 3), dropping sbt 1.x / Scala 2.12. Bump the referenced release to a new minor, 2026.2.0, to signal that consumer-visible change. Updates the SBT_AIRFRAME_VERSION defaults and the CI bootstrap version accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the entire repository build from sbt 1.12.2 → sbt 2.0.1. sbt 2.x runs its build DSL on Scala 3 and changes several defaults (all tasks cached, dependency eviction promoted to errors, platform-aware
%%,exportJarsdefault), so this touches build tooling across all six sub-builds: root,sbt-airframe,airspec, and the three example projects.Plugin replacements
sbt-scalajs-crossproject+sbt-scala-native-crossprojectorg.wvlet.uni:sbt-uni-crossproject2026.1.14sbt-revolver(reStart)org.wvlet.uni:sbt-uni2026.1.14—uniRestartbackground fork-runscalajs-env-jsdom-nodejs/PWEnv(no Scala 3 build)sbt-uni-playwright→PlaywrightJSEnvsbt-antlr4(no sbt 2.x build)sourceGeneratorstask inairframe-sqlsbt-pack0.23→1.0.0,sbt-mima1.1.4→1.1.6,sbt-jmh0.4.7→0.4.8,sbt-scalajs→1.22.0,sbt-scala-native→0.5.12,sbt-ide-settings→1.1.4Source-level fixes for the Scala 3 build DSL
xs: _*→xs*; parenthesized single-arg lambdas{ x: T => }→{ (x: T) => }PathFinder.get→.get();%%%→%%Def.uncached(...)wrapping forFile/JSEnv/CompileAnalysis-typed tasks (now cached by default)evictionErrorLevel := Warn(sbt 2.x promotes eviction conflicts to errors) andexportJars := false(sbt 2.x defaults it to true, which broke file-based resource loading e.g.YamlReader)ConflictWarning.disablein metabuilds (sbt-airframe → coursier pulls_2.13scala-xml vs_3)sbt-airframe— migrated in-repo, sbt-2-only, released as2026.2.0sbt-airframehas no published sbt 2.x artifact, so it is migrated in-repo (Scala 3.8.3;FileConverter+Def.uncachedfixes inAirframeHttpPlugin.scala; coursierfor3Use2_13+ module exclusions). It now supports only sbt 2.x (drops sbt 1.x / Scala 2.12), so the whole airframe suite is bumped a minor to2026.2.0to signal that. The root build,integrationTest, and the RPC examples consume it viaSBT_AIRFRAME_VERSION(default2026.2.0). Its release workflow now publishes the_3(not_2.12) airframe libraries it depends on.integrationTestdeliberately keepsAirframeHttpPlugin(not sbt-uni) because its purpose is to test that plugin's own client codegen.CI bootstrap (temporary)
The root metabuild needs
sbt-airframe 2026.2.0to load, but that can only be released frommainafter this merges — a release deadlock. A temporarybootstrap-sbt-airframecomposite actionpublishLocals it in the jobs that load the root build. Remove it oncesbt-airframe 2026.2.0is on Maven Central.Ship order
ruby ./scripts/release.rbonmain, entering2026.2.0at the prompt → tagv2026.2.0→ publishesorg.wvlet.airframe:sbt-airframe_sbt2_3:2026.2.0(and the rest of the suite) to Maven Central.SBT_AIRFRAME_VERSION=2026.2.0then resolves from Central).Validation
All 13 CI checks green: Code format; Scala 2.12/2.13/3/3.7.x/JDK25; Scala 3 Integration Test; Scala.js 2.12/2.13/3; Scala Native; AirSpec; sbt-airframe (scripted).
🤖 Generated with Claude Code