Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No build targets were detected in this workspace so most functionality won't work. #6686

Closed
the-nesen opened this issue Aug 16, 2024 · 7 comments · Fixed by #6687
Closed
Labels
improvement Not a bug or a feature, but something general we can improve
Milestone

Comments

@the-nesen
Copy link

the-nesen commented Aug 16, 2024

Describe the bug

I've tried to use Metals on WSL2:

JDK 17 & 21

Installed Metals extension
Opened g8 hello-world where the build sbt file is located
Run "Import build"
.bloop folder isn't created

see logs for details

Expected behavior

No response

Operating system

Linux

Editor/Extension

VS Code

Version of Metals

1.3.5

Extra context or search terms

2024.08.16 14:31:14 INFO Started: Metals version 1.3.5 in folders '/home/user/scalaProjects/hello-world' for client Visual Studio Code 1.92.2.�[0m
SLF4J(W): Class path contains multiple SLF4J providers.
SLF4J(W): Found provider [scribe.slf4j.ScribeServiceProvider@3f14192]
SLF4J(W): Found provider [ch.qos.logback.classic.spi.LogbackServiceProvider@2d824b52]
SLF4J(W): See https://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J(I): Actual provider is of type [scribe.slf4j.ScribeServiceProvider@3f14192]
2024.08.16 14:31:15 WARN Flyway upgrade recommended: H2 2.3.230 is newer than this version of Flyway and support has not been tested. The latest supported version of H2 is 2.2.220.�[0m
2024.08.16 14:31:17 INFO running '-Xmx4096m -Dbloop.export-jar-classifiers=sources bloopInstall'�[0m
2024.08.16 14:31:17 ERROR Running process '-Xmx4096m -Dbloop.export-jar-classifiers=sources bloopInstall' failed
java.io.IOException: Cannot run program "-Xmx4096m" (in directory "/home/user/scalaProjects/hello-world"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
at scala.meta.internal.process.SystemProcess$.run(SystemProcess.scala:48)
at scala.meta.internal.builds.ShellRunner.run(ShellRunner.scala:98)
at scala.meta.internal.builds.BloopInstall.runArgumentsUnconditionally(BloopInstall.scala:75)
at scala.meta.internal.builds.BloopInstall.$anonfun$runUnconditionally$1(BloopInstall.scala:49)
at scala.meta.internal.builds.BloopInstallProvider.bloopInstall(BloopInstallProvider.scala:24)
at scala.meta.internal.builds.BloopInstallProvider.bloopInstall$(BloopInstallProvider.scala:19)
at scala.meta.internal.builds.SbtBuildTool.bloopInstall(SbtBuildTool.scala:23)
at scala.meta.internal.builds.BloopInstall.runUnconditionally(BloopInstall.scala:46)
at scala.meta.internal.builds.BloopInstall.$anonfun$runIfApproved$3(BloopInstall.scala:148)
at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:470)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.lang.Thread.run(Thread.java:840)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.ProcessImpl.forkAndExec(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:314)
at java.lang.ProcessImpl.start(ProcessImpl.java:244)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
at scala.meta.internal.process.SystemProcess$.run(SystemProcess.scala:48)
at scala.meta.internal.builds.ShellRunner.run(ShellRunner.scala:98)
at scala.meta.internal.builds.BloopInstall.runArgumentsUnconditionally(BloopInstall.scala:75)
at scala.meta.internal.builds.BloopInstall.$anonfun$runUnconditionally$1(BloopInstall.scala:49)
at scala.meta.internal.builds.BloopInstallProvider.bloopInstall(BloopInstallProvider.scala:24)
at scala.meta.internal.builds.BloopInstallProvider.bloopInstall$(BloopInstallProvider.scala:19)
at scala.meta.internal.builds.SbtBuildTool.bloopInstall(SbtBuildTool.scala:23)
at scala.meta.internal.builds.BloopInstall.runUnconditionally(BloopInstall.scala:46)
at scala.meta.internal.builds.BloopInstall.$anonfun$runIfApproved$3(BloopInstall.scala:148)
at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:470)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.lang.Thread.run(Thread.java:840)
�[0m
2024.08.16 14:31:17 INFO time: ran 'sbt bloopInstall' in 29ms�[0m
2024.08.16 14:31:17 ERROR sbt command failed: -Xmx4096m -Dbloop.export-jar-classifiers=sources bloopInstall�[0m
2024.08.16 14:31:17 WARN no build target for: /home/user/scalaProjects/hello-world/project/project/metals.sbt�[0m
2024.08.16 14:31:17 WARN no build target for: /home/user/scalaProjects/hello-world/project/metals.sbt�[0m
2024.08.16 14:31:17 INFO no build target found for /home/user/scalaProjects/hello-world/project/metals.sbt. Using presentation compiler with project's scala-library version: 3.3.3�[0m
2024.08.16 14:31:17 INFO skipping build import with status 'Failed'�[0m
2024.08.16 14:31:18 INFO no build target found for /home/user/scalaProjects/hello-world/project/project/metals.sbt. Using presentation compiler with project's scala-library version: 3.3.3�[0m

@tgodzik
Copy link
Contributor

tgodzik commented Aug 16, 2024

Thanks for reporting! Did you by any chance change metals.sbtScript setting?

@tgodzik tgodzik added the needs more information Use if we need more information for a specific ticket label Aug 16, 2024
@the-nesen
Copy link
Author

Thank for the quick reply!

change metals.sbtScript setting?

I don't even know where it's located - so I didn't

@the-nesen
Copy link
Author

@tgodzik I have installed the Metals extension in WSL. Is this the correct way to do it, or should I have installed it locally?

@tgodzik
Copy link
Contributor

tgodzik commented Aug 16, 2024

I have installed the Metals extension in WSL. Is this the correct way to do it, or should I have installed it locally?

That should work

2024.08.16 14:31:17 ERROR sbt command failed: -Xmx4096m -Dbloop.export-jar-classifiers=sources bloopInstall�[0m

The weird thing here is that we normally run sbt jar or script, here it looks like it's either set to empty or to -Xmx 🤔

Could you check VS Code settings to see if there are any metals related changes either in workspace or machine config?

@tgodzik
Copy link
Contributor

tgodzik commented Aug 16, 2024

I looks like metals.sbtScript is set to empty somewhere , otherwise we add a bunch of additional arguments.

Adding a small improvement here #6687

@the-nesen
Copy link
Author

here it looks like it's either set to empty or to -Xmx 🤔

I found metals.sbtScript setting being empty.

After deleting this setting manually, the bloop server started working again. @tgodzik Thank you again for your quick response!

@tgodzik
Copy link
Contributor

tgodzik commented Aug 16, 2024

After the additional fix this should not happen again.

@tgodzik tgodzik added improvement Not a bug or a feature, but something general we can improve and removed needs more information Use if we need more information for a specific ticket labels Aug 19, 2024
@tgodzik tgodzik added this to the Metals v1.4.0 milestone Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Not a bug or a feature, but something general we can improve
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants