8000 improvement: Resolve console REPL artifacts via coursier API instead of the CLI by jozanek · Pull Request #1 · jozanek/bloop · GitHub
[go: up one dir, main page]

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
ccfc74e
Forward run stdin via blocking read instead of polling available()
jozanek Jun 2, 2026
3ab061b
Merge branch 'main' into fix/882-stdin-blocking-read
jozanek Jun 4, 2026
5bf12fb
Forward run stdin via a Task on ioScheduler instead of a Thread
jozanek Jun 4, 2026
037ee01
Drop snailgun: vendor a minimal nailgun client and fix stdin forwarding
jozanek Jun 5, 2026
35b7587
Run BSP targets in the project working directory
jozanek Jun 6, 2026
84599de
improvement: Resolve console REPL artifacts via coursier API instead …
jozanek Jun 6, 2026
3f6c92a
Combine --cascade with --include-dependencies in test and clean
jozanek Jun 6, 2026
c2a7d22
Add end-to-end BSP test for debug session environment variables
jozanek Jun 6, 2026
dc000c1
Support multi-jvm source directories in sbt
jozanek Jun 7, 2026
e7505fc
Merge pull request #2949 from jozanek/feature/1280-support-multi-jvm-…
tgodzik Jun 8, 2026
e13571e
Merge pull request #2941 from jozanek/fix/1226-ammonite-console
tgodzik Jun 8, 2026
7d2baba
Merge pull request #2948 from jozanek/test/1264-debug-session-env-vars
tgodzik Jun 8, 2026
20af1a2
Merge pull request #2940 from jozanek/fix/1210-bsp-run-working-dir
tgodzik Jun 8, 2026
41d3fcb
build(deps): Update logback-classic from 1.5.33 to 1.5.34
scala-steward Jun 8, 2026
46e5578
build(deps): Update shapeless from 2.3.4 to 2.3.13
scala-steward Jun 8, 2026
82eb769
Merge pull request #2951 from scala-steward/update/logback-classic-1.…
tgodzik Jun 9, 2026
95585cd
Merge pull request #2952 from scala-steward/update/shapeless-2.3.13
tgodzik Jun 9, 2026
2449cbb
chore: Update utest to 0.9.5
tgodzik Jun 9, 2026
d286445
Merge pull request #2957 from tgodzik/update-utest
tgodzik Jun 9, 2026 8000
5574ca9
Merge pull request #2947 from jozanek/fix/1229-cascade-include-depend…
tgodzik Jun 9, 2026
6fd9205
Change-detect and quiet the automatic sbt meta-build export
jozanek Jun 9, 2026
431c1ea
Print the about banner for `bloop --version` and `bloop version`
jozanek Jun 8, 2026
82dc4f0
Fix NullPointerException for relative paths in sbt unmanagedResources
jozanek Jun 10, 2026
867c691
Merge pull request #2950 from jozanek/feature/1283-version-command
tgodzik Jun 10, 2026
aab05bd
Merge pull request #2959 from jozanek/fix/1360-unmanaged-resources-npe
tgodzik Jun 10, 2026
a9f8565
Add --summary flag to bloop compile
jozanek Jun 10, 2026
2e9c883
build(deps): Update jna from 5.18.1 to 5.19.0
scala-steward Jun 10, 2026
ea18c74
build(deps): Update log4j-core from 2.23.0 to 2.23.1
scala-steward Jun 10, 2026
f822046
Don't wait on the stdin reader thread when a run finishes
jozanek Jun 11, 2026
4a5ef9c
Support sbt internal configurations in exported project dependencies
jozanek Jun 11, 2026
2d29445
Merge pull request #2964 from scala-steward/update/log4j-core-2.23.1
tgodzik Jun 11, 2026
8df62b2
Merge pull request #2963 from scala-steward/update/jna-5.19.0
tgodzik Jun 11, 2026
d9c8c05
Merge pull request #2936 from jozanek/fix/882-stdin-blocking-read
tgodzik Jun 11, 2026
dd28638
Merge pull request #2966 from jozanek/fix/1373-sbt-internal-dependencies
tgodzik Jun 11, 2026
5d6b5ce
Report a crash from the compiler instead of hanging the compilation
jozanek Jun 11, 2026
998594b
Merge pull request #2967 from jozanek/fix/1434-compiler-crash-stacktrace
tgodzik Jun 12, 2026
0c5cc70
build(deps): Update sbt-scalafix from 0.14.6 to 0.14.7
scala-steward Jun 12, 2026
312035a
build(deps): Update jna from 5.19.0 to 5.19.1
scala-steward Jun 12, 2026
943cc4c
build(deps): Update log4j-core from 2.23.1 to 2.26.0
scala-steward Jun 12, 2026
1c2cb46
build(deps): Update munit from 1.3.1 to 1.3.3
scala-steward Jun 12, 2026
8832c2e
build(deps): Update scalaz-core from 7.3.8 to 7.3.9
scala-steward Jun 12, 2026
14a1c10
Make the sbt meta-build export opt-in via a system property
jozanek Jun 13, 2026
6b50cde
Merge remote-tracking branch 'origin/main' into issue-1357-quiet-meta…
jozanek Jun 13, 2026
51639fa
Merge remote-tracking branch 'origin/main' into feature/1367-compile-…
jozanek Jun 13, 2026
455bd9f
Fix AutoCompleteSpec for --summary flag
jozanek Jun 13, 2026
25e2c8e
Add --jvm-debug flag to run and test for attaching a debugger
jozanek Jun 14, 2026
e1a650d
Fully reset incremental state on clean
jozanek Jun 14, 2026
538103f
build(deps): Update sbt, scripted-plugin, test-agent from 1.12.11 to …
scala-steward Jun 14, 2026
14cff77
Merge pull request #2977 from scala-steward/update/sbt-1.12.12
tgodzik Jun 15, 2026
599e0b3
Merge pull request #2972 from scala-steward/update/scalaz-core-7.3.9
tgodzik Jun 15, 2026
ee364f1
Merge pull request #2971 from scala-steward/update/munit-1.3.3
tgodzik Jun 15, 2026
b67ff89
Merge pull request #2970 from scala-steward/update/log4j-core-2.26.0
tgodzik Jun 15, 2026
83b2945
Merge pull request #2968 from scala-steward/update/sbt-scalafix-0.14.7
tgodzik Jun 15, 2026
f0e9dcd
chore: Update sbt 2 to final release
tgodzik Jun 15, 2026
0c052b2
Merge pull request #2969 from scala-steward/update/jna-5.19.1
tgodzik Jun 15, 2026
dfd423d
Merge pull request #2960 from jozanek/feature/1367-compile-summary
tgodzik Jun 15, 2026
d3fed80
Merge pull request #2976 from jozanek/fix/1466-clean-stale-analysis
tgodzik Jun 15, 2026
790f55a
Merge pull request #2978 from tgodzik/update-sbt2
tgodzik Jun 15, 2026
190bebe
Merge pull request #2958 from jozanek/issue-1357-quiet-meta-build-export
tgodzik Jun 15, 2026
769e0cf
Merge pull request #2974 from jozanek/feature/1457-jvm-debug-flag
tgodzik Jun 17, 2026
2369318
improvement: Launch the console under the project JDK and honor --exc…
jozanek Jun 17, 2026
a8201a1
Merge remote-tracking branch 'origin/main' into improvement/console-p…
jozanek Jun 17, 2026
9fb36f0
bugfix: Resolve scala3-compiler alongside scala3-repl for the Scala 3…
jozanek Jun 20, 2026
d2c0e8d
test: Run console tests unconditionally; the coursier API needs no bi…
jozanek Jun 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
shell: bash
- name: Sbt 2
run: |
sbt "++3.7.3 sbtBloop/scripted \
sbt "++3.8.4 sbtBloop/scripted \
sbt-bloop/wartremover \
sbt-bloop/stale-projects \
sbt-bloop/sbt-plugin-build \
Expand All @@ -57,6 +57,7 @@ jobs:
sbt-bloop/bsp-enabled \
sbt-bloop/meta-builds \
sbt-bloop/no-compile-incremental \
sbt-bloop/multi-jvm-configuration \
sbt-bloop/non-compiling"
shell: bash

Expand Down
7 changes: 7 additions & 0 deletions backend/src/main/scala/bloop/CompileExceptions.scala
10BC8
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ package bloop

import scala.util.control.NoStackTrace

/**
* A fatal error thrown by the compiler, wrapped in a non-fatal exception so that it can
* be turned into a failed compilation result and reported back to the client.
*/
final class CompilerCrash(message: String, cause: Throwable)
extends RuntimeException(message, cause)

private[bloop] object CompileExceptions {
abstract class CompileException(msg: String) extends RuntimeException(msg) with NoStackTrace
object FailedOrCancelledPromise
Expand Down
7 changes: 1 addition & 6 deletions backend/src/main/scala/bloop/Compiler.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package bloop

import java.io.File
import java.io.PrintWriter
import java.io.StringWriter
import java.nio.file.Files
import java.nio.file.NoSuchFileException
import java.nio.file.Path
Expand Down Expand Up @@ -782,10 +780,7 @@ object Compiler {
toBackgroundTasks(backgroundTasksForFailedCompilation.toList)
Result.Failed(failedProblems, None, elapsed, backgroundTasks, None)
case t: Throwable =>
t.printStackTrace()
val sw = new StringWriter()
t.printStackTrace(new PrintWriter(sw))
logger.error(sw.toString())
// The full stack trace is reported by the consumer of this failed result
val backgroundTasks =
toBackgroundTasks(backgroundTasksForFailedCompilation.toList)
val failedProblems = findFailedProblems(reporter, None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import java.util.Optional
import scala.concurrent.Promise
import scala.util.control.NonFatal

import bloop.CompilerCrash
import bloop.logging.ObservedLogger
import bloop.logging.TeeOutputStream
import bloop.reporter.ZincReporter
Expand Down Expand Up @@ -134,6 +135,14 @@ final class BloopHighLevelCompiler(
_.addListener(baos)
}

// Wrap a fatal error in a non-fatal crash: fatal errors escape the task that runs
// the compilation, so they would never complete it and clients would wait forever.
// The consumer of the failed compilation result reports the full stack trace.
def compilerCrash(cause: Throwable, advice: String): CompilerCrash = {
JavaCompleted.tryFailure(cause)
new CompilerCrash(s"The compiler crashed with a ${cause.getClass().getSimpleName()}. $advice", cause)
}

try {
scalac.compile(
sources.toArray,
Expand All @@ -149,13 +158,11 @@ final class BloopHighLevelCompiler(
)
} catch {
case t: StackOverflowError =>
val msg = "Encountered a StackOverflowError coming from the compiler. You might need to restart your Bloop build server"
logger.error(s"${msg}:\n${t.getStackTrace().mkString("\n")}")
throw new CompileFailed(new Array(0), msg, new Array(0), None, t)
throw compilerCrash(t, "You might need to restart your Bloop build server")
case t: NoClassDefFoundError =>
val msg = "Encountered a NoClassDefFoundError coming from the compiler. You might need to clean compile your workspace"
logger.error(s"${msg}:\n${t.getStackTrace().mkString("\n")}")
throw new CompileFailed(new Array(0), msg, new Array(0), None, t)
throw compilerCrash(t, "You might need to clean compile your workspace")
case t: LinkageError =>
throw compilerCrash(t, "A compiler plugin or something else on the compiler classpath may be incompatible with the used Scala version")
case NonFatal(t) =>
// If scala compilation happens, complete the java promise so that it doesn't block
JavaCompleted.tryFailure(t)
Expand Down
13 changes: 0 additions & 13 deletions bloop-rifle/src/main/scala/bloop/rifle/BloopRifleLogger.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package bloop.rifle

import snailgun.logging.{Logger => SnailgunLogger}

import java.io.OutputStream

trait BloopRifleLogger { self =>
Expand All @@ -21,17 +19,6 @@ trait BloopRifleLogger { self =>
def bloopBspStderr: Option[OutputStream]
def bloopCliInheritStdout: Boolean
def bloopCliInheritStderr: Boolean

def nailgunLogger: SnailgunLogger =
new SnailgunLogger {
val name: String = "bloop"
val isVerbose: Boolean = true
def debug(msg: String): Unit = self.debug("nailgun debug: " + msg)
def error(msg: String): Unit = self.debug("nailgun error: " + msg)
def warn(msg: String): Unit = self.debug("nailgun warn: " + msg)
def info(msg: String): Unit = self.debug("nailgun info: " + msg)
def trace(exception: Throwable): Unit = self.debug("nailgun trace: " + exception.toString)
}
}

object BloopRifleLogger {
Expand Down
17 changes: 8 additions & 9 deletions bloop-rifle/src/main/scala/bloop/rifle/internal/Operations.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import bloop.rifle.{
FailedToStartServerExitCodeException,
FailedToStartServerTimeoutException
}
import bloop.rifle.internal.nailgun.{Client, SocketClient, Streams, TcpClient}
import libdaemonjvm.LockFiles
import snailgun.protocol.Streams
import snailgun.{Client, TcpClient}

import java.io.{File, InputStream, OutputStream}
import java.net.{
Expand Down Expand Up @@ -328,7 +327,7 @@ object Operations {
case BloopRifleConfig.Address.Tcp(host, port) =>
TcpClient(host, port)
case addr: BloopRifleConfig.Address.DomainSocket =>
SnailgunClient { () =>
SocketClient { () =>
val files = lockFiles(addr)
val res = libdaemonjvm.client.Connect.tryConnect(files)
res match {
Expand Down Expand Up @@ -389,7 +388,7 @@ object Operations {
workingDir,
sys.env.toMap,
streams,
logger.nailgunLogger,
logger,
stop0,
interactiveSession = false
)
Expand All @@ -405,10 +404,10 @@ object Operations {
catch { case _: IllegalStateException => }
}

val snailgunThread = new Thread(runnable, threadName)
snailgunThread.setDaemon(true)
val nailgunThread = new Thread(runnable, threadName)
nailgunThread.setDaemon(true)

snailgunThread.start()
nailgunThread.start()

new BspConnection {
def address = bspSocketOrPort match {
Expand Down Expand Up @@ -506,7 +505,7 @@ object Operations {
workingDir,
sys.env.toMap,
streams,
logger.nailgunLogger,
logger,
stop0,
interactiveSession = false
)
Expand All @@ -532,7 +531,7 @@ object Operations {
workingDir,
sys.env.toMap,
streams,
logger.nailgunLogger,
logger,
stop0,
interactiveSession = false
)
Expand Down

This file was deleted.

Loading
Loading
0