Skip to content

Commit

Permalink
error diagnostics for invocation failures (#1122)
Browse files Browse the repository at this point in the history
so that we can actually debug such things (e.g. bad declarations).

Note: I am not recompiling the bootstrap here, as there is no need and I
don't want to create unnecessary conflicts with the metaclasses pr.
  • Loading branch information
vyzo authored Feb 15, 2024
1 parent ffdfe68 commit 551d21b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/gerbil/compiler/driver.ss
Original file line number Diff line number Diff line change
Expand Up @@ -876,16 +876,18 @@ namespace: gxc
stdout-redirection: (stdout-redirection #f)
stderr-redirection: (stderr-redirection #f))
(verbose "invoke " [program . args])
(let (proc (open-process [path: program arguments: args
stdout-redirection: stdout-redirection
stderr-redirection: stderr-redirection]))
(when (or stdout-redirection stderr-redirection)
(read-line proc #f))
(let* ((proc (open-process [path: program arguments: args
stdout-redirection: stdout-redirection
stderr-redirection: stderr-redirection]))
(output (and (or stdout-redirection stderr-redirection)
(read-line proc #f))))
(let (status (process-status proc))
(close-port proc)
(unless (zero? status)
(display output)
(raise-compile-error "Compilation error; process exit with nonzero status"
program)))))
[program . args]
status)))))

(defrules go! ()
((_ expr)
Expand Down

0 comments on commit 551d21b

Please sign in to comment.