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

Add a global --offline config key #3216

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Gedochao
Copy link
Contributor

Fixes #3024

@Gedochao Gedochao force-pushed the feature/global-offline-config-2 branch 2 times, most recently from 30e9e41 to 85c26a2 Compare October 1, 2024 14:12
@Gedochao
Copy link
Contributor Author

Gedochao commented Oct 2, 2024

This consistently fails on (for Linux/Windows platforms)

integration.test.jvm 4 tests failed: 
  scala.cli.integration.RunTestsDefault.Java code accepted as piped input scala.cli.integration.RunTestsDefault.Java code accepted as piped input
  scala.cli.integration.RunTestsDefault.Java code with multiple classes accepted as piped input scala.cli.integration.RunTestsDefault.Java code with multiple classes accepted as piped input
  scala.cli.integration.RunTestsDefault.snippets mixed with piped Scala code and existing sources allow for cross-references scala.cli.integration.RunTestsDefault.snippets mixed with piped Scala code and existing sources allow for cross-references
  scala.cli.integration.RunTestsDefault.Java URL scala.cli.integration.RunTestsDefault.Java URL

I've no idea what is the cause, but it smh is tied to running pure Java code.
Can't see how it's tied to the changes.
This also seems to not happen on MacOS for some reason.

The full (-v -v -v) output from the failing test on the CI (it seems to be a similar failure for all of the failing tests):

>==== Running 'Java code accepted as piped input' from RunPipedSourcesTestDefinitions
Reading stdin
Done reading stdin (110 B)
Ignoring error during setup-ide: Found virtual inputs: <stdin>-java-file
Checking for a running Bloop server at /home/runner/.local/share/scalacli/bloop/daemon ...
Attempting to connect to Bloop server /home/runner/.local/share/scalacli/bloop/daemon ...
Connection attempt result: Some(Right(java.nio.channels.SocketChannel[connected local= remote=/home/runner/.local/share/scalacli/bloop/daemon/socket]))
nailgun debug: Sending arguments '' to Nailgun server
nailgun debug: Sending environment variables to Nailgun server
nailgun debug: Sending working directory /home/runner/work/scala-cli/scala-cli/out/integration/tmpDirBase.dest/working-dir/run-1399714906/test-223 to Nailgun server
nailgun debug: Sending command to about Nailgun server
nailgun debug: Finished sending command information to Nailgun server
nailgun debug: Starting thread to read stdin...
nailgun debug: Received action Print([B@139f8548) from Nailgun server
nailgun debug: Received action Print([B@6302db3b) from Nailgun server
nailgun debug: Received action Print([B@55eb9bf6) from Nailgun server
nailgun debug: Received action Print([B@7ef1d4bb) from Nailgun server
nailgun debug: Received action Print([B@69287da6) from Nailgun server
nailgun debug: Received action Print([B@1c06a8bb) from Nailgun server
nailgun debug: Received action Exit(0) from Nailgun server
nailgun debug: Waiting for stdin thread to finish...
nailgun debug: Waiting for heartbeat thread to finish...
nailgun debug: Returning exit code...
Checking for a running Bloop server at /home/runner/.local/share/scalacli/bloop/daemon ...
Attempting to connect to Bloop server /home/runner/.local/share/scalacli/bloop/daemon ...
Connection attempt result: Some(Right(java.nio.channels.SocketChannel[connected local= remote=/home/runner/.local/share/scalacli/bloop/daemon/socket]))
Checking for a running Bloop server at /home/runner/.local/share/scalacli/bloop/daemon ...
Attempting to connect to Bloop server /home/runner/.local/share/scalacli/bloop/daemon ...
Connection attempt result: Some(Right(java.nio.channels.SocketChannel[connected local= remote=/home/runner/.local/share/scalacli/bloop/daemon/socket]))
nailgun debug: Sending arguments '' to Nailgun server
nailgun debug: Sending environment variables to Nailgun server
nailgun debug: Sending working directory /home/runner/work/scala-cli/scala-cli/out/integration/tmpDirBase.dest/working-dir/run-1399714906/test-223 to Nailgun server
nailgun debug: Sending command to about Nailgun server
nailgun debug: Finished sending command information to Nailgun server
nailgun debug: Starting thread to read stdin...
nailgun debug: Received action Print([B@1b421dc1) from Nailgun server
nailgun debug: Received action Print([B@5a8970cd) from Nailgun server
nailgun debug: Received action Print([B@4aff1e39) from Nailgun server
nailgun debug: Received action Print([B@4b32c35b) from Nailgun server
nailgun debug: Received action Print([B@401563e9) from Nailgun server
nailgun debug: Received action Print([B@518b7c3e) from Nailgun server
nailgun debug: Received action Exit(0) from Nailgun server
nailgun debug: Waiting for stdin thread to finish...
nailgun debug: Waiting for heartbeat thread to finish...
nailgun debug: Returning exit code...
Opening BSP connection with bloop
Bloop BSP connection waiting at local:/home/runner/.cache/scalacli/bsp-sockets/proc-57272
BSP connection at /home/runner/.cache/scalacli/bsp-sockets/proc-57272 not found, waiting 100 milliseconds
nailgun debug: Sending arguments '--protocol local --socket /home/runner/.cache/scalacli/bsp-sockets/proc-57272' to Nailgun server
nailgun debug: Sending environment variables to Nailgun server
nailgun debug: Sending working directory /tmp/6848826472449148461/.scala-build to Nailgun server
nailgun debug: Sending command to bsp Nailgun server
nailgun debug: Finished sending command information to Nailgun server
nailgun debug: Starting thread to read stdin...
nailgun debug: Received action Print([B@2c785687) from Nailgun server
The server is listening for incoming connections at local:///home/runner/.cache/scalacli/bsp-sockets/proc-57272...
nailgun debug: Received action Print([B@5af9fafa) from Nailgun server
Accepted incoming BSP client connection at local:///home/runner/.cache/scalacli/bsp-sockets/proc-57272
BSP connection at /home/runner/.cache/scalacli/bsp-sockets/proc-57272 opened
Connected to Bloop via BSP at local:/home/runner/.cache/scalacli/bsp-sockets/proc-57272
Connected to Bloop via BSP at local:/home/runner/.cache/scalacli/bsp-sockets/proc-57272
Sending buildInitialize BSP command to Bloop
nailgun debug: Received action Print([B@1d9efda5) from Nailgun server
request received: build/initialize
nailgun debug: Received action Print([B@22f50f7f) from Nailgun server
BSP initialization handshake complete.
Fetching List(), adding List(IvyRepository(Pattern(List(Const(file:///home/runner/.cache/scalacli/local-repo/1.5.1-4-a0c0e5//), Var(organisation), Const(/), Var(module), Const(/), Opt(List(Const(scala_), Var(scalaVersion), Const(/))), Opt(List(Const(sbt_), Var(sbtVersion), Const(/))), Var(revision), Const(/), Var(type), Const(s/), Var(artifact), Opt(List(Const(-), Var(classifier))), Const(.), Var(ext))), None, None, true, true, true, false, None, true))
Writing bloop project in /tmp/6848826472449148461/.scala-build/.bloop/6848826472449148461_3f12ae3dcd-1c5962[5587](https://github.com/VirtusLab/scala-cli/actions/runs/11142290538/job/30964925808?pr=3216#step:4:5588).json
Listing BSP build targets
Compiling 6848826472449148461_3f12ae3dcd-1c59625587 with Bloop
Received onBuildLogMessage from bloop: LogMessageParams [
  type = WARNING
  task = null
  originId = null
  message = "Scala instance jar /home/runner/work/scala-cli/scala-cli/out/integration/tmpDirBase.dest/working-dir/run-1399714906/test-152/local-repo/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.20/scala-reflect-2.12.20.jar doesn't exist!"
]
Warning: Scala instance jar /home/runner/work/scala-cli/scala-cli/out/integration/tmpDirBase.dest/working-dir/run-1399714906/test-152/local-repo/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.20/scala-reflect-2.12.20.jar doesn't exist!
Received onBuildLogMessage from bloop: LogMessageParams [
  type = WARNING
  task = null
  originId = null
  message = "Scala instance jar /home/runner/work/scala-cli/scala-cli/out/integration/tmpDirBase.dest/working-dir/run-1399714906/test-152/local-repo/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.20/scala-compiler-2.12.20.jar doesn't exist!"
]
Warning: Scala instance jar /home/runner/work/scala-cli/scala-cli/out/integration/tmpDirBase.dest/working-dir/run-1399714906/test-152/local-repo/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.20/scala-compiler-2.12.20.jar doesn't exist!
Received onBuildLogMessage from bloop: LogMessageParams [
  type = WARNING
  task = null
  originId = null
  message = "Scala instance jar /home/runner/work/scala-cli/scala-cli/out/integration/tmpDirBase.dest/working-dir/run-1399714906/test-152/local-repo/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/2.3.0/scala-xml_2.12-2.3.0.jar doesn't exist!"
]
Warning: Scala instance jar /home/runner/work/scala-cli/scala-cli/out/integration/tmpDirBase.dest/working-dir/run-1399714906/test-152/local-repo/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/2.3.0/scala-xml_2.12-2.3.0.jar doesn't exist!
Received onBuildLogMessage from bloop: LogMessageParams [
  type = WARNING
  task = null
  originId = null
  message = "Scala instance jar /home/runner/work/scala-cli/scala-cli/out/integration/tmpDirBase.dest/working-dir/run-1399714906/test-152/local-repo/https/repo1.maven.org/maven2/org/scala-sbt/jline/jline/2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79/jline-2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79.jar doesn't exist!"
]
Warning: Scala instance jar /home/runner/work/scala-cli/scala-cli/out/integration/tmpDirBase.dest/working-dir/run-1399714906/test-152/local-repo/https/repo1.maven.org/maven2/org/scala-sbt/jline/jline/2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79/jline-2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79.jar doesn't exist!
Exception in thread "main" java.util.concurrent.ExecutionException: org.eclipse.lsp4j.jsonrpc.MessageIssueException: Message could not be parsed.
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
	at scala.build.Bloop$.compile(Bloop.scala:53)
	at scala.build.compiler.BloopCompiler.helper$1(BloopCompiler.scala:39)
	at scala.build.compiler.BloopCompiler.compile(BloopCompiler.scala:54)
	at scala.build.Build$.buildOnce$$anonfun$1(Build.scala:1154)
	at scala.build.EitherCps$Helper.apply(EitherCps.scala:19)
	at scala.build.Build$.buildOnce(Build.scala:1125)
	at scala.build.Build$.build$$anonfun$2(Build.scala:484)
	at scala.build.EitherCps$Helper.apply(EitherCps.scala:19)
	at scala.build.Build$.build(Build.scala:472)
	at scala.build.Build$.doBuildScope$1$$anonfun$1(Build.scala:350)
	at scala.build.EitherCps$Helper.apply(EitherCps.scala:19)
	at scala.build.Build$.doBuildScope$1(Build.scala:333)
	at scala.build.Build$.doBuild$1$$anonfun$1(Build.scala:355)
	at scala.build.EitherCps$Helper.apply(EitherCps.scala:19)
	at scala.build.Build$.doBuild$1(Build.scala:308)
	at scala.build.Build$.buildScopes$1$$anonfun$1(Build.scala:417)
	at scala.build.EitherCps$Helper.apply(EitherCps.scala:19)
	at scala.build.Build$.buildScopes$1(Build.scala:416)
	at scala.build.Build$.build$$anonfun$1(Build.scala:446)
	at scala.build.EitherCps$Helper.apply(EitherCps.scala:19)
	at scala.build.Build$.build(Build.scala:281)
	at scala.build.Build$.build$$anonfun$3$$anonfun$1(Build.scala:626)
	at scala.util.Either.flatMap(Either.scala:360)
	at scala.build.compiler.ScalaCompilerMaker.withCompiler(ScalaCompilerMaker.scala:37)
	at scala.build.compiler.ScalaCompilerMaker.withCompiler$(ScalaCompilerMaker.scala:9)
	at scala.build.compiler.BloopCompilerMaker.withCompiler(BloopCompilerMaker.scala:14)
	at scala.build.Build$.build$$anonfun$3(Build.scala:611)
	at scala.build.EitherCps$Helper.apply(EitherCps.scala:19)
	at scala.build.Build$.build(Build.scala:596)
	at scala.cli.commands.run.Run$.runCommand(Run.scala:334)
	at scala.cli.commands.default.Default.runCommand(Default.scala:69)
	at scala.cli.commands.default.Default.runCommand(Default.scala:40)
	at scala.cli.commands.ScalaCommand.run(ScalaCommand.scala:390)
	at scala.cli.commands.ScalaCommand.run(ScalaCommand.scala:371)
	at caseapp.core.app.CaseApp.main(CaseApp.scala:166)
	at scala.cli.commands.ScalaCommand.main(ScalaCommand.scala:356)
	at caseapp.core.app.CommandsEntryPoint.main(CommandsEntryPoint.scala:370)
	at scala.cli.ScalaCliCommands.main(ScalaCliCommands.scala:125)
	at scala.cli.ScalaCli$.main0(ScalaCli.scala:320)
	at scala.cli.ScalaCli$.main(ScalaCli.scala:124)
	at scala.cli.ScalaCli.main(ScalaCli.scala)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at coursier.bootstrap.launcher.a.a(Unknown Source)
	at coursier.bootstrap.launcher.ResourcesLauncher.main(Unknown Source)
Caused by: org.eclipse.lsp4j.jsonrpc.MessageIssueException: Message could not be parsed.
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponseIssues(RemoteEndpoint.java:358)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handle(RemoteEndpoint.java:317)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:198)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
nailgun debug: Received action Print([B@4c57a9c8) from Nailgun server
BSP server stopped
nailgun debug: Received action Exit(0) from Nailgun server
nailgun debug: Waiting for stdin thread to finish...
nailgun debug: Waiting for heartbeat thread to finish...
nailgun debug: Returning exit code...
X==== Finishing 'Java code accepted as piped input' from RunPipedSourcesTestDefinitions

Needs further investigation.

@tgodzik
Copy link
Member

tgodzik commented Oct 2, 2024

Looks like maybe the jars indeed do not exist and only poms? Wasn't there a problem with that?

@Gedochao Gedochao force-pushed the feature/global-offline-config-2 branch from c893565 to 5f58f81 Compare October 18, 2024 17:26
@Gedochao Gedochao force-pushed the feature/global-offline-config-2 branch from 5f58f81 to 8a9cf6b Compare November 18, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add global config for --offline
2 participants