Skip to content

run should actually run each of the cross-compiled configurations with --cross #3590

@Gedochao

Description

@Gedochao

Is your feature request related to a problem? Please describe.
Currently, passing --cross with run cross-compiles against all configured Scala versions, but only runs the first one.

//> using scala 2.13.16 2.13.15 2.13.14
object Main extends App {
  println(util.Properties.versionNumberString)
}
scala-cli run . --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 2.13.16, JVM (23))
# Compiled project (Scala 2.13.16, JVM (23))
# Compiling project (Scala 2.13.15, JVM (23))
# Compiled project (Scala 2.13.15, JVM (23))
# Compiling project (Scala 2.13.14, JVM (23))
# Compiled project (Scala 2.13.14, JVM (23))
# 2.13.16

Describe the solution you'd like
I would expect to not just cross-compile against each version, but also run each of them.
So I'd expect:

scala-cli run . --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 2.13.16, JVM (23))
# Compiled project (Scala 2.13.16, JVM (23))
# Compiling project (Scala 2.13.15, JVM (23))
# Compiled project (Scala 2.13.15, JVM (23))
# Compiling project (Scala 2.13.14, JVM (23))
# Compiled project (Scala 2.13.14, JVM (23))
# 2.13.16
# 2.13.15
# 2.13.14

Describe alternatives you've considered
The current behaviour is counter-intuitive (and inconsistent with how test or publish behave, where they respectively test or publish against all cross-compiled versions), but if we were to skip on running each option, we should at least log an explanation on what and why, as per:

Additional context

Metadata

Metadata

Assignees

Labels

--crossIssues tied to cross compilation/the --cross option.experimentalTickets tied to experimental features.missing featureSomething should have been implemented, but wasn't.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions