[2.x] ci: Handle undefined crossScalaVersions in publishLocalAllModule (#8491)

The publishLocalAllModule command fails with 'crossScalaVersions is
undefined' when the zinc submodule's compilerBridge project doesn't
have crossScalaVersions defined.

This is a long-standing issue that was reported in #4387 (2018) and
'magically resolved' when zinc happened to define the setting, then
resurfaced in #7607 (2024) when zinc changed.

The fix uses getOpt().getOrElse(Nil).toList instead of get().toList
to handle the case where crossScalaVersions is not defined, allowing
the command to proceed gracefully.

Fixes #7607
This commit is contained in:
MkDev11 2026-01-12 01:42:39 -05:00 committed by GitHub
parent 88812f27a3
commit 0ec500392f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -1060,7 +1060,8 @@ def customCommands: Seq[Setting[?]] = Seq(
}).toList :::
(zincOpt map { case ProjectRef(build, _) =>
val zincSv = get((ProjectRef(build, "zinc") / scalaVersion))
val csv = get((ProjectRef(build, "compilerBridge") / crossScalaVersions)).toList
val csv =
getOpt((ProjectRef(build, "compilerBridge") / crossScalaVersions)).getOrElse(Nil).toList
(csv flatMap { bridgeSv =>
s"++$bridgeSv" :: ("{" + build.toString + "}compilerBridge/publishLocal") :: Nil
}) :::