From 538cbb5e061ed86a0ce7f1cb0589183b55723647 Mon Sep 17 00:00:00 2001 From: Alexandre Archambault Date: Tue, 29 Nov 2022 16:14:41 +0100 Subject: [PATCH 1/2] Disable nailgun standard streams stuff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't rely on stream redirection via nailgun, so we don't need that. This was trapping the stderr of the Bloop server sometimes… --- frontend/src/main/scala/bloop/Bloop.scala | 12 +++++++++++- project/Dependencies.scala | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/main/scala/bloop/Bloop.scala b/frontend/src/main/scala/bloop/Bloop.scala index 58d9ccc5ac..d9f1e515db 100644 --- a/frontend/src/main/scala/bloop/Bloop.scala +++ b/frontend/src/main/scala/bloop/Bloop.scala @@ -213,7 +213,17 @@ object Bloop { } val server = - new NGServer(address, poolSize, heartbeatMs, in, out, err, javaLogger, domainSocketProvider) + new NGServer( + address, + poolSize, + heartbeatMs, + in, + out, + err, + javaLogger, + domainSocketProvider, + false + ) registerAliases(server) ProxySetup.init() server diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 24d63680c1..ad357f1cef 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -36,7 +36,7 @@ object Dependencies { import sbt.librarymanagement.syntax.stringToOrganization val zinc = "org.scala-sbt" %% "zinc" % zincVersion val bsp4s = "ch.epfl.scala" %% "bsp4s" % bspVersion - val nailgun = "io.github.alexarchambault.bleep" % "nailgun-server" % "1.0.3" + val nailgun = "io.github.alexarchambault.bleep" % "nailgun-server" % "1.0.4" val javaDebug = "ch.epfl.scala" % "com-microsoft-java-debug-core" % javaDebugVersion val libraryManagement = "org.scala-sbt" %% "librarymanagement-ivy" % lmVersion From 38c141676279f0d3e415763e54019fd5ee7321e4 Mon Sep 17 00:00:00 2001 From: Alexandre Archambault Date: Tue, 29 Nov 2022 16:15:38 +0100 Subject: [PATCH 2/2] Discard files from JAR filesystems Seems these are added by javac when using '--release 8' for example. --- .../inc/bloop/internal/BloopIncremental.scala | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/backend/src/main/scala/sbt/internal/inc/bloop/internal/BloopIncremental.scala b/backend/src/main/scala/sbt/internal/inc/bloop/internal/BloopIncremental.scala index d7a9e19d3b..83a9a78805 100644 --- a/backend/src/main/scala/sbt/internal/inc/bloop/internal/BloopIncremental.scala +++ b/backend/src/main/scala/sbt/internal/inc/bloop/internal/BloopIncremental.scala @@ -82,7 +82,10 @@ object BloopIncremental { val setOfSources = sources.toSet val incremental = new BloopNameHashing(log, uniqueInputs, options, profiler.profileRun, tracer) val initialChanges = incremental.detectInitialChanges(setOfSources, previous, current, lookup, converter, output) - def isJrt(path: Path) = path.getFileSystem.provider().getScheme == "jrt" + def ignore(path: Path) = { + val scheme = path.getFileSystem.provider().getScheme + scheme == "jrt" || scheme == "jar" + } val binaryChanges = new DependencyChanges { val modifiedLibraries = initialChanges.libraryDeps.toArray @@ -90,8 +93,13 @@ object BloopIncremental { .map(converter.toPath(_)) .collect { // jrt path is neither a jar nor a normal file - case path if !isJrt(path) => - path.toFile() + case path if !ignore(path) => + try path.toFile() + catch { + case e: UnsupportedOperationException => + System.err.println(s"Error converting $path (provider scheme ${path.getFileSystem.provider().getScheme}) to a file: $e") + throw e + } } .distinct val modifiedClasses = initialChanges.external.allModified.toArray