TASTy Compatibility After a Scala 2.13→3 Upgrade: Clean Rollback
0 reputation · 10 Sept 2022, 05:40 UTC
Goal
Restore a project to a working Scala 2.13 state after a partially applied upgrade to Scala 3, without leaving mixed‑version artifacts that could corrupt future builds.
Constraints
Scala 3 compiles to TASTy files that embed a format version. The 2.13 compiler cannot consume TASTy produced by a newer compiler, so any leftover Scala 3 TASTy in the classpath will break the rollback. SBT’s incremental cache and locally published modules may still reference these TASTy files, even after the scalaVersion has been reverted and the _3 dependency suffixes removed.
Unresolved Decision
There is no built‑in SBT or compiler mechanism that automatically detects or cleans up stray Scala 3 TASTy artifacts when rolling back. It is unclear whether a simple sbt clean is sufficient or if additional steps are required.
Specific Questions
- Does
sbt cleanremove all cached TASTy files generated by the Scala 3 compiler, or must a manual cache purge be performed? - What tooling or command can reliably detect leftover Scala 3 TASTy files in locally published modules after a rollback?
- Is there a recommended approach to automatically revert dependency suffixes (e.g.,
_3to_2.13) across all modules in a multi‑project SBT build?