[darcs-devel] [issue2120] Darcs fails to invoke an editor under MS Windows

Adam Wolk bugs at darcs.net
Sun Feb 19 17:34:39 UTC 2012


Adam Wolk <netprobe at gmail.com> added the comment:

The root cause of the problem is System.Process.system returning
ExitFailure 1 when the called program does not exist.

Exec.hs and Utils.hs both contain code to handle possible 127 and 126
return code which stand for program not found and not executable (no
permission to execute) and the code would probably work correctly if the
command was called with System.Process.runProcess but instead Exec.hs on
line 153 uses System.Process.system which on MS Windows returns
ExitFailure 1 even though the system %ERRORLEVEL% after such call in
cmd.exe is set to 9009.

Here is the code I am referring to.

#else

execInteractive cmd arg = withoutProgress $ do
  system $ cmd ++ " " ++ arg
#endif

Code that takes/should take part in the action:

Exec.hs:
withExit127 - not used.
notFoundError - not used.

Utils.hs:
ortryrunning - never sees 126, 127 - gets ExitFailure 1 so doesn't try
other commands from the chain.
runEditor - could be extended with "notepad" path before trying "edit".

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue2120>
__________________________________


More information about the darcs-devel mailing list