Skip to content

Run all cross builds when --cross is passed#3808

Merged
Gedochao merged 5 commits intoVirtusLab:mainfrom
Gedochao:feature/cross-tweaks
Mar 5, 2026
Merged

Run all cross builds when --cross is passed#3808
Gedochao merged 5 commits intoVirtusLab:mainfrom
Gedochao:feature/cross-tweaks

Conversation

@Gedochao
Copy link
Contributor

@Gedochao Gedochao commented Jul 29, 2025

Fixes #3590
Fixes #3026

Given smth.sc like this

//> using scala 3 2.13 2.12
println("Hello")

Before these changes, running with --cross would compile against all cross versions, but only run against the first one passed (with no indication via logs, either):

scala-cli smth.sc
# Compiling project (Scala 3.7.1, JVM (23))
# Compiled project (Scala 3.7.1, JVM (23))
# Hello
scala-cli clean .
scala-cli smth.sc --cross --power
# The `--cross` option is experimental
# Please bear in mind that non-ideal user experience should be expected.
# If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli
# Compiling project (Scala 3.7.1, JVM (23))
# Compiled project (Scala 3.7.1, JVM (23))
# Compiling project (Scala 2.13.16, JVM (23))
# Compiled project (Scala 2.13.16, JVM (23))
# Compiling project (Scala 2.12.20, JVM (23))
# Compiled project (Scala 2.12.20, JVM (23))
# Hello

Now it actually gets run for each configuration, as it should (and there're some logs for sanity's sake):

scala-cli smth.sc 
# Compiling project (Scala 3.7.1, JVM (23))
# Compiled project (Scala 3.7.1, JVM (23))
# Cross-building is disabled, ignoring 2 builds:
#   Scala 2.13, JVM
#   Scala 2.12, JVM
# Cross builds are only available when the --cross option is passed.
# Defaulting to Scala 3.7.1, JVM
# Hello
scala-cli clean .
scala-cli smth.sc --cross --power
# The `--cross` option is experimental
# Please bear in mind that non-ideal user experience should be expected.
# If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli
# Compiling project (Scala 3.7.1, JVM (23))
# Compiled project (Scala 3.7.1, JVM (23))
# Compiling project (Scala 2.13.16, JVM (23))
# Compiled project (Scala 2.13.16, JVM (23))
# Compiling project (Scala 2.12.20, JVM (23))
# Compiled project (Scala 2.12.20, JVM (23))
# Hello
# Hello
# Hello

@Gedochao Gedochao force-pushed the feature/cross-tweaks branch 4 times, most recently from 782f14a to 7b2fcab Compare September 8, 2025 11:51
@Gedochao Gedochao force-pushed the feature/cross-tweaks branch from 7b2fcab to d3adfdd Compare September 24, 2025 09:26
@Gedochao Gedochao force-pushed the feature/cross-tweaks branch from d3adfdd to 9557c8d Compare September 24, 2025 10:10
@Gedochao Gedochao force-pushed the feature/cross-tweaks branch from 3b9e15c to ab83f93 Compare March 4, 2026 13:17
Copy link
Contributor Author

@Gedochao Gedochao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Managed to merge main back here and make it work, it seems.

@Gedochao Gedochao marked this pull request as ready for review March 5, 2026 08:00
@Gedochao Gedochao requested review from tgodzik and zielinsky March 5, 2026 08:02
@Gedochao Gedochao merged commit f49df22 into VirtusLab:main Mar 5, 2026
89 of 90 checks passed
@Gedochao Gedochao deleted the feature/cross-tweaks branch March 5, 2026 12:15
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.

run should actually run each of the cross-compiled configurations with --cross Add extra logging for --cross

3 participants