Add Scala 3.7.4 cross-build#110
Draft
Copilot wants to merge 3 commits into
Draft
Conversation
Copilot
AI
changed the title
[WIP] Add cross-build support for Scala 3.3.7
Add Scala 3.3.7 cross-build
May 27, 2026
alexarchambault
requested changes
May 27, 2026
alexarchambault
left a comment
Member
There was a problem hiding this comment.
Actually, add support for 3.7.4 instead, and use the @unroll annotation
Author
Done in the latest commit:
|
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.
Adds Scala 3.7.4 as a cross-build target alongside the existing 2.12/2.13 builds, eliminating the need for
CrossVersion.for3Use2_13workarounds in downstream projects.Key challenges
data-classis Scala 2 only:io.github.alexarchambault::data-class:0.2.7has no_3artifact. All files using@dataannotations must be handled separately.Streamremoved in Scala 3: replaced byLazyList.Approach: version-specific source directories
Source files are split into
src/(version-agnostic),src-2/(Scala 2.x), andsrc-3/(Scala 3):Version.scalaStream→LazyList,@data class→case classVersionInterval.scala@data class→case classModuleMatcher.scala@data class→case class,@unrollonattributeMatchersModuleMatchers.scala@data class→case class,@unrollonincludeByDefault(replaces@since)VersionConstraint.scala@data class→case classforLazy/Eager; add explicitwithLatesttoEager(previously generated by@data)build.millchangesscala3 = "3.7.4"toDepVersionssourcestask selectssrc-2/orsrc-3/based on Scala versioncompileMvnDepsskipsdata-classfor Scala 3mvnDepsincludescom.lihaoyi:::unroll-annotation:0.3.0for Scala 3 (no compiler plugin needed with Scala 3.7+)scalacOptionsuses-release 8(single dash) for Scala 3 vs--release 8for Scala 2Binary compatibility
The
@unrollannotation (fromcom.lihaoyi:::unroll-annotation:0.3.0) is used on Scala 3 case class parameters with default values to generate binary-compatible constructor/apply/copyoverloads — replacing the role that@sinceplayed withdata-classin the Scala 2 version.