scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

using packaging.packageType native does not imply --native

Open j-mie6 opened this issue 8 months ago • 0 comments

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.

j-mie6 avatar Dec 19 '23 14:12 j-mie6