You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scala CLI version: 1.0.0-RC1
Scala version (default): 3.2.2
Describe the bug
In a project which one file with main method imports another file which imports a lib, exporting to a mill or sbt project fails:
❯ scli export --mill --project testrepro -o testrepro .
The 'export' sub-command 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
Exporting to a mill project...
Error: java.nio.file.FileAlreadyExistsException: /Users/cdepaula/repos/scala-playground/zio/test/testrepro/testrepro/src/Helpers.scala
For more details, please see '/Users/cdepaula/repos/scala-playground/zio/test/.scala-build/stacktraces/1680786544-2919053400650754756.log'
The project is:
❯ tree
[ 564] ./
├── [ 180] Helpers.scala
└── [ 160] sample1.scala
340 used in 1 directory, 2 files
❯ cat *
────────────────────────────────────────────────────────────────────────────────────────────────────
File: Helpers.scala
Size: 180 B
────────────────────────────────────────────────────────────────────────────────────────────────────
//> using scala "3.3.0-RC3"
//> using option "-source:future"
//> using lib "dev.zio::zio:2.0.10"
package testrepro
import zio.*
def printMy(msg: String): Unit =
println(msg)
────────────────────────────────────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────────────────────────────────────
File: sample1.scala
Size: 160 B
────────────────────────────────────────────────────────────────────────────────────────────────────
//> using scala "3.3.0-RC3"
//> using file "Helpers.scala"
//> using option "-source:future"
package testrepro
@main
def main() =
printMy("Hello, world!")
────────────────────────────────────────────────────────────────────────────────────────────────────
If I comment (remove) the using lib and import from Helpers.scala, it exports successfully or if I remove the sample 1 file, it also exports successfully.
Expected behaviour
Be able to export rojects that use both libs and local files.
I believe the reason behind the error is that the Helpers.scala file in the example is in fact passed twice: once through the using file directive and once from the command line with ..
So a quick workaround would be to just export it like this:
Version(s)
Scala CLI version: 1.0.0-RC1
Scala version (default): 3.2.2
Describe the bug
In a project which one file with main method imports another file which imports a lib, exporting to a mill or sbt project fails:
The project is:
If I comment (remove) the
using lib
and import from Helpers.scala, it exports successfully or if I remove the sample 1 file, it also exports successfully.Expected behaviour
Be able to export rojects that use both libs and local files.
The stacktrace mentioned shows:
The text was updated successfully, but these errors were encountered: