scala-cli
scala-cli copied to clipboard
using packaging.packageType native does not imply --native
Version(s) 1.1.0
Describe the bug
In a cross-built project with multiple platforms, setting the package type to be native does not force the compiler to compile with the native platform, instead requiring --native
to be passed. Without the flag, the output is:
Compiling project (Scala 2.13.12, JVM (11))
Compiled project (Scala 2.13.12, JVM (11))
Error: Could not find or load main class scala.scalanative.cli.ScalaNativeLd
Caused by: java.lang.ClassNotFoundException: scala.scalanative.cli.ScalaNativeLd
Error: scala.build.errors.ScalaNativeBuildError: Error compiling with Scala Native
To Reproduce A project.scala file with the following:
//> using platform jvm native
//> using packaging.packageType native
Expected behaviour
I would expect that running scala-cli package .
with the above configuration would use the native platform to compile, since this necessarily requires native compilation. Instead, scala-cli package . --native
must be used instead, redundantly.