Skip to content

Update to Scala 2.13, drop Scala 2.12 support - #557

Open
lolgab wants to merge 3 commits into
masterfrom
scala-2.13-migration
Open

Update to Scala 2.13, drop Scala 2.12 support#557
lolgab wants to merge 3 commits into
masterfrom
scala-2.13-migration

Conversation

@lolgab

@lolgab lolgab commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Bumps scalaVersion/scalaBinaryVersion to 2.13, drops cross-building and 2.12-only compiler flags.
  • Fixes 2.13 collection API breakage across core, toolRepository-remote, and cli (breakOut, .to[X], mapValues, parallel collections module).
  • Bumps guardrail to 1.0.0-M1 (0.75.2's akka-http codegen emits invalid Scala under 2.13) and pins scalameta to keep the meta-build classpath consistent.
  • Bumps case-app to 2.1.0 (no 2.13 build exists below that) and rewrites CLIApp's CLI parsing off the removed case-app 1.x Command/CommandParser API onto the 2.x Parser/Help API. Splits Analyze's option case class into an AdvancedOptions group to stay under case-app's field-count ceiling.

Known issue - cli module does not compile

case-app 2.1.0's Parser/Help derivation macro crashes scalac 2.13 (LambdaLift, NoSuchElementException: key not found: package command) whenever derivation for two or more distinct option case classes happens in the same compiled package. Reproduced in isolation across many code shapes (nested/top-level, generic/non-generic, reduced field count, explicit/automatic derivation) - it is not fixable by restructuring this codebase. Also confirmed on Scala 2.13.18, so it isn't a scalac patch-version bug either.

Since the CLI needs to parse both analyze and validate-configuration, this blocks the cli module specifically. core, model, toolRepository-remote, and codacy-api-client all compile clean on 2.13.

Opening this to see what CI reports; the cli module build is expected to fail until case-app is replaced or the upstream bug is fixed.

Test plan

  • CI build (expected: cli module compile failure, other modules green)
  • Decide follow-up: replace case-app (scopt/decline) vs. wait on upstream fix

Bumps scalaVersion/scalaBinaryVersion to 2.13, removes cross-building
and 2.12-only compiler flags, and fixes the resulting 2.13 breakage:
removed collection APIs (breakOut, .to[X], mapValues), parallel
collections moved to a separate module, and guardrail bumped to
1.0.0-M1 (0.75.2's akka-http codegen emits invalid Scala under 2.13).

case-app is bumped to 2.1.0 (no 2.13 build exists below that) and
CLIApp's CLI parsing is rewritten off the removed case-app 1.x
Command/CommandParser API onto the 2.x Parser/Help API, with Analyze's
option case class split into an AdvancedOptions group to keep it under
case-app's field-count ceiling.

Known issue: case-app 2.1.0's Parser/Help derivation macro crashes
scalac 2.13 (LambdaLift, "key not found: package command") whenever
derivation for two or more distinct option types occurs in the same
compiled package - reproduced in isolation, unrelated to code shape,
and unaffected by bumping to 2.13.18. The cli module does not compile
as a result; core, model, toolRepository-remote and codacy-api-client
all build clean on 2.13.
@lolgab
lolgab requested a review from a team as a code owner August 24, 2026 12:12
@codacy-production

codacy-production Bot commented Aug 24, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 1 high · 2 minor

Results:
3 new issues

Category Results
ErrorProne 1 high
Comprehensibility 2 minor

View in Codacy

🟢 Metrics 4 duplication

Metric Results
Duplication 4

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

lolgab added 2 commits August 24, 2026 15:11
…ashes

Core: replace removed 2.13 collection APIs in tests (.to[X], breakOut).

Cli: case-app's Parser/Help derivation macro crashes scalac 2.13 in two
distinct, previously undiagnosed ways:
 - "key not found: package command" (LambdaLift) when the annotated
   case class is a bare top-level member of a package.
 - "assertion failed: static" (delambdafy) when Parser[X]/Help[X] are
   derived from a different object than the one X is declared in.

Both fixed by nesting the option case classes in an Options object and
declaring their derived Parser/Help vals right there, reused by the
parsing objects instead of re-deriving. Also adds the missing
CLIApp.parseCommand used by CLISpec since the case-app 2.x rewrite, and
fixes tests still constructing Analyze with fields that moved into the
nested AdvancedOptions group.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant