Sbt giter templates not working on Windows 11 with WSL2


Relatively new scala dev here, trying to get my development environment to a more workable state.

for my environment my pc is running Windows 11 and I am trying to do most of my development on the Windows Subsystem for Linux (wsl) 2 subenvironment. for my linux OS I chose Ubuntu 22.04.1 LTS (Jammy Jellyfish).

I followed the instructions on the Getting Started page Getting Started | Scala Documentation, using the linux curl command to download coursier and then run cs setup This gets me to a point where the cli output indicates I have ammonite, the scala3 compiler, sbt, coursier, scala, scala-cli, sbtn, and scalafmt locally.

Then I get to the next step in the setup instructions to create a new scala3 project in an empty directory and this is where I run into a problem. I run sbt new scala/scala3.g8 in my terminal and get the below output:

(base) ➜ why-func-matters sbt new scala/scala3.g8
[info] entering *experimental* thin client - BEEP WHIRR
[info] server was not detected. starting an instance
[warn] No sbt.version set in project/, base directory: /home/nsubordin81/code/scala_projects/why-func-matters
[info] welcome to sbt 1.8.0 ( Inc. Java 17.0.2)
[info] set current project to why-func-matters (in build file:/home/nsubordin81/code/scala_projects/why-func-matters/)
[info] sbt server started at local:///home/nsubordin81/.sbt/1.0/server/e07e166e6e98dd380606/sock
[info] terminate the server with `shutdown`
> new scala/scala3.g8
Error: Unknown argument 'sbtCompleteExec f86f6c4f-9466-4138-b098-0978b0057e7a'
Error: Unknown argument 'resumeFromFailure'
Error: Unknown argument 'sbtPopOnFailure'
Error: Unknown argument 'sbtReportResult f86f6c4f-9466-4138-b098-0978b0057e7a'
Error: Unknown argument 'shell'
Try --help for more information.
[info] disconnected

So it starts up the sbt server, attempts to run the template and then errors out citing several unknown arguments with a guuid I don’t recognize. doing as advised and running the command with --help only brings up the sbt command documentation. I wondered if it was succeeding anyway, but when I checked what was generated, I only have a project/, target/, and .bsp directory so it didn’t end up generating that src/main/scala/Main.scala and build.sbt etc. I was hoping for.

when I manually create the pieces of the template I’m missing I can perform an sbt run and get it to execute the main method, so I’ve at least ruled out it being an issue with compilation and running of scala programs. I can also import the build into vscode with metals and work with it there. I just don’t know why the template is not working with sbt. It is not limited to scala/scala3.g8, I have this issue with every giter template I’ve tried.

Thanks, I’m sure it is something silly I’m missing or maybe a bug with working with wsl and I have a workaround, I would just like to understand this better. Appreciate any insight you all can provide!

1 Like

You’re probably not missing something silly, it’s probably not well supported yet. You should report it here: Issues · scala/scala3.g8 · GitHub

1 Like

Thank you, will do!