hsc2hs gives bad error message when it cannot execute the generated program
hsc2hs compiles a C program and then executes it. One of the failure modes is that the executable program can fail to run because the filesystem is mounted "noexec".
The error message when it fails to execute the generated program is not ideal:
cabal install unix-compat
Resolving dependencies...
Configuring unix-compat-0.1.2.1...
Preprocessing library unix-compat-0.1.2.1...
running dist/build/System/PosixCompat/Extensions_hsc_make failed
command was: dist/build/System/PosixCompat/Extensions_hsc_make >dist/build/System/PosixCompat/Extensions.hs
cabal: Error: some packages failed to install:
unix-compat-0.1.2.1 failed during the building phase. The exception was:
ExitFailure 1
It requires a fair bit of guesswork to discover that the problem is that /tmp
is mounted "noexec".
This is a case where we want the System.Process to give us a permission exception rather than having the process terminate with an exit code that we do not know how to interpret. The tricky bit is that while the underlying C execve
does give us a C error code, we've already forked by that time so it is tricky to return the error to the parent.
Trac metadata
Trac field | Value |
---|---|
Version | 6.12.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | hsc2hs |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |