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

Exception thrown by mdoc terminates unforked JVM on sbt 1.6.x #613

Open
iRevive opened this issue Jan 23, 2022 · 1 comment
Open

Exception thrown by mdoc terminates unforked JVM on sbt 1.6.x #613

iRevive opened this issue Jan 23, 2022 · 1 comment

Comments

@iRevive
Copy link

iRevive commented Jan 23, 2022

sbt: 1.6.1
sbt-mdoc: 2.2.4

The issue

sbt dropped TrapExit mechanism in 1.6.0 release (sbt/sbt#6665), hence any exception thrown by mdoc terminates unforked JVM.

The output of docs/mdoc command:

[info] running mdoc.Main
info: Compiling 23 files to /Users/maksim/projects/oss/xxx/mdoc/target/mdoc
error: README.md:2:15: compile-only cannot be used in combination with silent
```scala mdoc:silent:compile-only
              ^^^^^^^^^^^^^^^^^^^
info: Compiled in 1.69s (1 error)
[info] shutting down sbt server

The local fix

lazy val docs = project
  .in(file("mdoc"))
  .enablePlugins(MdocPlugin)
  .settings(
+   run / fork := true
  )

The proper solution

Should MdocPlugin enable forking by default? If not, I guess it's worth mentioning a workaround in the docs.

@armanbilge
Copy link
Contributor

I'd also be interested if there's a way to solve this in mdoc without requiring forking. For some reason forking doesn't interact well with --watch in typelevel/sbt-typelevel#197.

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

No branches or pull requests

2 participants