summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2015-10-03 12:37:00 +0200
committerBen Gamari <ben@smart-cactus.org>2015-10-03 13:06:24 +0200
commitb6f76b9aaca49df0fb06d8bad2f7edc5b5b8c095 (patch)
treedb579ae81dd7d3f0e362c9df62cf0d7c620d5c26 /ghc
parent93e21b96f94556dc3f0bcee7615cb7f31444bd99 (diff)
downloadhaskell-b6f76b9aaca49df0fb06d8bad2f7edc5b5b8c095.tar.gz
Prevent GHC from silently dying when preprocessor is not found
The Windows preprocessor code calls `runInteractiveProcess` but does not check if an exception is thrown. `runInteractiveProcess` calls `CreateProcess` which when given a format the system loader does not know about will throw an exception. This is what makes #9399 fail. Ultimately we should not use any `CreateProcess` based calls but instead `ShellExecuteEx` as this would allow us to run applications that the shell knows about instead of just the loader. More details on #365. This patch removes `PhaseFailed` and throws `ProgramError` instead. `PhaseFailed` was largely unneeded since it never gave very useful information aside from the `errorcode` which was almost always `1`. `IOErrors` have also been eliminated and `GhcExceptions` thrown in their place wherever possible. Updates haddock submodule. Test Plan: `./validate` to make sure anything didn't break and `make TESTS="T365"` to test that an error is now properly thrown Reviewers: austin, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D1256 GHC Trac Issues: #365
Diffstat (limited to 'ghc')
-rw-r--r--ghc/InteractiveUI.hs1
1 files changed, 0 insertions, 1 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 2dcedb0b0b..80c1483863 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -3214,7 +3214,6 @@ showException se =
-- omit the location for CmdLineError:
Just (CmdLineError s) -> putException s
-- ditto:
- Just ph@(PhaseFailed {}) -> putException (showGhcException ph "")
Just other_ghc_ex -> putException (show other_ghc_ex)
Nothing ->
case fromException se of