Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Tut hangs indefinitely with no error reports #170

Closed
alexflav23 opened this issue Jul 9, 2017 · 3 comments
Closed

Tut hangs indefinitely with no error reports #170

alexflav23 opened this issue Jul 9, 2017 · 3 comments

Comments

@alexflav23
Copy link

Hi,

Just integrating tut with a project, however it appears to hang indefinitely with no error reports during compilation. In this other bug, #169, it's also failing to resolve some pretty "obvious" companion object implicits, though realistically there are far far more complex macros under the hood tut seems perfectly happy with, yet it's falling apart on simple things somehow.

I have a small hunch it's suppressing macro compilation errors under the hood. Since you are forced to run with Scala 2.10.6 under SBT, I imagine the plugin code itself will end up triggering the Scala compiler without the macrocompat plugin that the project uses to deal with Scala 2.10.6 API incompatibilities.

I have a readme sub module as part of a multi-build that depends on all the other projects and triggers tut, so theoretically it couldn't be any other missing dependencies. The strange nature of the silent failure also makes me think this is something macro related.

Adding the usual doesn't seem to help, I guess because the compiler plugin is natively added to compile scope which doesn't affect tut.

      "org.typelevel" %% "macro-compat" % Versions.macrocompat % "tut",
      "org.scala-lang" % "scala-compiler" % scalaVersion.value % "tut",
      compilerPlugin("org.scalamacros" % "paradise" % Versions.macroParadise cross CrossVersion.full),

I don't know enough about the internals to make any worthwhile suggestions, but it would be great to at least know if this is a known problem. Right now running tut simply causes SBT to pause, strangely after all the files in compilation seem to have been parsed, so it forever hangs at the last file, even if oddly, that last file does not contain any tut blocks, so I'd assume this is unrelated.

@alexflav23
Copy link
Author

@tpolecat Any advice on how to debug this problem? It's somewhat inconsistent, if there are errors it stops properly if the compilation succeeds it hangs indefinitely in the console, the operation never completes.

@alexflav23
Copy link
Author

@tpolecat Just to close this out, after a lot of systematic elimination(delete file, retry tut), I've figured out the culprit. Basically there are compilation edge cases, and quite basic ones, that cause tut to hang indefinitely. I can retrace the exact specifics if helpful, but it's probably not optimal to get that behaviour when compilation errors are exactly what we are "hunting down".

@tpolecat
Copy link
Owner

If you have a reproduction it would certainly be helpful, but I'm guessing it would also hang the REPL and is actually a Scala bug. In any case if you can reproduce I'll certainly take a look.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants