Ticket #3864 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Bad error message if $TMP does not exist

Reported by: NeilMitchell Owned by:
Priority: high Milestone: 6.12.2
Component: Compiler Version: 6.10.4
Keywords: Cc:
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.10.4
$ set TMP=c:\none
$ ghc --make Main.hs
CreateDirectory: does not exist (The system cannot find the path specified.)

If the %TMP% environment variable is set to a directory that does not exist, then GHC gives a very uninformative error message. I suggest that CreateDirectory always give the name of the directory when it fails, and that GHC traps this error and gives a better error.

Tracking this bug down took a while - I'd like to spare other users my pain :-)

Change History

Changed 3 years ago by igloo

  • priority changed from normal to high
  • milestone set to 6.12.2

Changed 3 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Thanks for the report.

The good news is that 6.12 already tells you the path in the exception.

I'm not sure that we can easily give a better error message. We don't currently know where the path we're trying to create came from, and on Windows it looks like we get it by calling GetTempPath so we probably have no way of finding out that it was ultimately from %TMP%.

Note: See TracTickets for help on using tickets.