Skip to content

Scala 3.10.0 and sbt 2.0.10 - #204

Merged
prabhu merged 9 commits into
mainfrom
scala-3.10
Oct 13, 2026
Merged

prabhu merged 9 commits into
mainfrom
scala-3.10

Conversation

@prabhu

@prabhu prabhu commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Moves chen to Scala 3.10.0 and sbt 2.0.10.

Most of the work is sbt 2 rather than Scala. sbt-antlr4 and sbt-github-packages have no sbt 2 builds, so a small in-process ANTLR task and a GitHub Packages auto-plugin take their place, and the build files are now Scala 3. A few sbt 2 defaults would have changed behaviour quietly, so they are pinned back:

  • bare settings in the root build.sbt now apply to every subproject, so publish / skip and createDistribution live on the root project (otherwise sbt publish publishes nothing)
  • suites run one at a time inside the forked test JVM (testForkedParallel := false), and test resources stay plain files (Test / exportJars := false)
  • packaged projects stage under their own target/universal/stage again, where the frontend scripts expect them
  • delombok gets lombok's jar explicitly, since sbt 2's test worker has a different java.class.path

CI runs testFull because sbt 2's test only reruns what changed, and calls sbt --server "a; b": on Windows the thin client exits 0 even when a command fails, and PowerShell hands "a;b" to sbt.bat unquoted, which splits it. COURSIER_REPOSITORIES now uses the pipe separator coursier expects.

Tested on macOS and Windows 11 ARM64 with testFull (the edga tests ran on macOS against a local edga build), createDistribution, and atom's suite against a local publish of this branch. Artifacts built with 3.10 need consumers on Scala 3.10 or later, so AppThreat/atom#281 should land with it.

- scalaVersion 3.9.0 -> 3.10.0; sbt 1.13.0 -> 2.0.10 (build definitions
  now compile with Scala 3, so project/*.scala files were ported)
- drop unmaintained plugins with no sbt 2.x builds:
  - sbt-antlr4 -> project/Antlr4.scala, an in-process ANTLR 4 codegen
    task wired into dataflowengineoss' sourceGenerators
  - sbt-github-packages -> project/GithubPackages.scala, a minimal
    auto-plugin keeping githubOwner/githubRepository -> publishTo
- bump sbt-native-packager 1.13.0, sbt-scalafmt 2.6.2, sbt-assembly 2.5.0
- sbt 2 porting: slash-syntax and Keys.platform clash in root build.sbt,
  Def.uncached for File-returning tasks, HashedVirtualFileRef mappings,
  BareBuildSyntax.dependsOn, FileChangesMacro-free javacc staleness
- Scala 3.10 fixes: auto-tupling removal (has(key, value), .of(value)
  instead of ->), null-only catch-alls, Cpg(using g), dropRightInPlace
…bok classpath

- add x2cpg TestResources: sbt 2 serves test resources from its
  content-addressed store as jar URLs, so tests that walk directories or
  hand paths to external tools now extract them to real temp dirs
  (jssrc2cpg astgen fixtures, edg2atom goldens, jimple2cpg unpacking)
- run suites sequentially (Test/parallelExecution := false): soot's Scene
  and other JVM-global state get corrupted when suites overlap in the
  forked test JVM, which sbt 2's runner lays out more aggressively
- Delombok: sbt 2 forks tests in a worker whose java.class.path only has
  the worker jars, so derive the fork classpath from the classloader
- purge the .chen ast-fragment cache between toolchain upgrades and
  ignore it
- root build.sbt: sbt 2 applies bare settings to every subproject, so
  `publish / skip` silenced publishing everywhere and createDistribution
  ran (and copied the zip) once per project; both now live on root
- GithubPackages: restore what sbt-github-packages did besides publishTo:
  the appthreat package registry resolver (cpg2 is only published there),
  scmInfo/homepage, pomIncludeRepository, and requires JvmPlugin
- Delombok: the classloader URLs were joined as file: URLs, which only
  worked on Unix by accident; keep java.class.path and add lombok's jar
  when the sbt 2 test worker's property lacks it
- tests: Test / testForkedParallel := false restores sbt 1's sequential
  suites without serializing in-process tests; Test / exportJars := false
  keeps resources as plain files, so TestResources goes away
- CI runs testFull: sbt 2's test only reruns what changed
- Versions.antlr comes from the ANTLR tool on the meta-build classpath
- drop the dead generateScaladocs task and SbtHelper, the unused
  javaCCTask fileInputs, and use Def.uncached consistently
# Conflicts:
#	.github/workflows/pr.yml
With ';' separators and the unknown ivy2-local alias coursier ignores the
whole variable and falls back to repo1-only defaults, so the launcher never
used the Google mirror. Same fix atom already carries.
sbt 2 moves every project's target under target/out/jvm/scala-<version>/
of the build root, which breaks the frontend launch scripts and
tests/querydb-test.sh that expect the sbt 1 staging layout.
On Windows the sbt 2 thin client exits 0 even when a command fails, and
PowerShell passes an argument without spaces unquoted, so sbt.bat split
"a;b" into separate words. --server runs sbt in-process as sbt 1 did,
and '; ' keeps the sequence one argument on every shell.
A stage directory keeps whatever an earlier stage left in it, so with the
sbt 1 layout restored a local createDistribution picked up the Scala 3.9
libraries of the last sbt 1 build next to the 3.10 ones.
@prabhu prabhu added enhancement New feature or request scala ai-auto A person set the task, and AI agents carried it through to completion labels Oct 13, 2026
@prabhu
prabhu added this pull request to the merge queue Oct 13, 2026
Merged via the queue into main with commit c08be77 Oct 13, 2026
@prabhu
prabhu deleted the scala-3.10 branch October 13, 2026 09:01
@prabhu prabhu added this to the v4.0.0 Pelorus milestone Oct 28, 2026
@prabhu prabhu moved this to Done in AppThreat roadmap Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-auto A person set the task, and AI agents carried it through to completion enhancement New feature or request scala

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant