Race between non/interactive use breaks compilation

To reproduce:

  1. Open a fairly large Guile source file, or one which uses a good number of modules. The goal is to get something that'll take 1-2 seconds for Guile to compile. Guile seems quite slow, so this is not difficult.
  2. Launch a REPL with C-c C-z.
  3. Enter (+ 1 2 3) into the REPL, but don't press RET.
  4. Switch back to the source buffer with C-c C-z.
  5. Rapidly press:
    1. C-c C-k to load the file.
    2. C-c C-z to switch to the REPL.
    3. RET to evaluate the expression written earlier.

After pressing RET, the REPL will block until the compilation is finished, then print a sexp representing the compilation result and the result of the addition:

scheme@(guile-user)> (+ 1 2 3)
((result "\"#<unspecified>\"") (output . ""))
$6 = 6
scheme@(guile-user)> 

At this point, none of the Geiser compile commands (C-c C-k, C-M-x, C-x C-e) work anymore, either hanging forever, or doing nothing and reporting no result.

I haven't dug into the code, but it feels like Geiser is stuck waiting for the first compilation result, which will never arrive, because it was sent to the REPL instead of wherever Geiser expected it.

Evaluating any expression in the REPL during a compile causes the same behavior. It also reproduces with no expression at all, simply pressing RET on an empty line while compilation happens.

Assignee Loading
Time tracking Loading