Patch: Win32, more informative file failure messages

Hi, Attached is a patch to give more informative failure messages in the Win32 package. Currently we get: $ ghci GHCi, version 6.10.2: http://www.haskell.org/ghc/ :? for help Prelude> :m System.Directory Prelude System.Directory> removeFile "wibble" *** Exception: DeleteFile: does not exist (The system cannot find the file speci fied.) Prelude System.Directory> removeFile "c:/ghc/ghc-6.10.2/bin/ghci.exe" *** Exception: DeleteFile: permission denied (Access is denied.) Now, we should get: *** Exception: DeleteFile "wibble": does not exist (The system cannot find the file specified.) *** Exception: DeleteFile "c:/ghc/ghc-6.10.2/bin/ghci.exe": permission denied (Access is denied.) I have compiled the patches, but not tested them. When I do, I get errors about linking, which I'm pretty sure have nothing to do with my patch. : C:\Program Files\Haskell\Win32-2.2.0.0\ghc-6.10.2\HSWin32-2.2.0.0.o: unknown s ymbol `___stginit_basezm3zi0zi3zi1_Foreign_' I suspect it's because Win32 is built and distributed with GHC. Also, I noticed that: $ cabal install Win32 --global --reinstall System\Win32\SimpleMAPI.hsc:16:63: Module `Control.Exception' does not export `onException' cabal: Error: some packages failed to install: Win32-2.2.0.0 failed during the building phase. The exception was: exit: ExitFailure 1 I'm now left with a dead version of GHC - for future reference, is there a sequence of steps that would have worked to install Win32 and start using the new one? Thanks Neil

On 15/05/2009 10:36, Neil Mitchell wrote:
Hi,
Attached is a patch to give more informative failure messages in the Win32 package. Currently we get:
$ ghci GHCi, version 6.10.2: http://www.haskell.org/ghc/ :? for help Prelude> :m System.Directory Prelude System.Directory> removeFile "wibble" *** Exception: DeleteFile: does not exist (The system cannot find the file speci fied.) Prelude System.Directory> removeFile "c:/ghc/ghc-6.10.2/bin/ghci.exe" *** Exception: DeleteFile: permission denied (Access is denied.)
Now, we should get:
*** Exception: DeleteFile "wibble": does not exist (The system cannot find the file specified.) *** Exception: DeleteFile "c:/ghc/ghc-6.10.2/bin/ghci.exe": permission denied (Access is denied.)
Nice.
I have compiled the patches, but not tested them. When I do, I get errors about linking, which I'm pretty sure have nothing to do with my patch.
: C:\Program Files\Haskell\Win32-2.2.0.0\ghc-6.10.2\HSWin32-2.2.0.0.o: unknown s ymbol `___stginit_basezm3zi0zi3zi1_Foreign_'
I suspect it's because Win32 is built and distributed with GHC.
Also, I noticed that:
$ cabal install Win32 --global --reinstall System\Win32\SimpleMAPI.hsc:16:63: Module `Control.Exception' does not export `onException' cabal: Error: some packages failed to install: Win32-2.2.0.0 failed during the building phase. The exception was: exit: ExitFailure 1
That is a bad idea, since other packages depend on Win32, and you just broke them. We did make a half-hearted attempt to stop you doing this in ghc-pkg, but that's not the right place (or at least, not the only place that needs to be fixed). http://hackage.haskell.org/trac/ghc/ticket/3090
I'm now left with a dead version of GHC - for future reference, is there a sequence of steps that would have worked to install Win32 and start using the new one?
You'd need to bump the version number and install the new one. Cheers, Simon
participants (2)
-
Neil Mitchell
-
Simon Marlow