cabal doesn't handle error conditions from getAppUserDataDirectory #700

Open
bos opened this Issue May 24, 2012 · 4 comments

4 participants

@bos
Haskell member

(Imported from Trac #709, reported by @creswick on 2010-07-12)

Distribution.Simple.InstallDirs?.defaultInstallDirs fails if getAppUserDataDirectory fails, and it does so with a very uninformative error:
{{{ # On Cabal 1.8.0.2:
cabal.exe: illegal operation
}}}

This is a slight regression from the HP 2009 version:

{{{ # On Cabal 1.6.0.3:
cabal.exe: System.Directory.getAppUserDataDirectory: unsupported operation (unsupported operation)
}}}

This happens on Windows Vista, in cygwin, when the user doesn't have a windows user directory (eg: c:\users\username ).

@bos
Haskell member

(Imported comment by @creswick on 2010-07-12)

This can be recreated with a windows vista system that has cygwin and a cygwin ssh server running:

  • Add a new windows user (say 'testUser'), but do not log in with that user.
  • ssh to the host as testUser
  • attempt to run cabal with some sort of command line parameters (eg: cabal --help)
@bos
Haskell member

(Imported comment by @dcoutts on 2010-07-13)

I suppose we could improve the error message but I don't see that we can make anything work if getAppUserDataDirectory fails. It means we cannot read the config file.

The error message issue could do with some work. We should make sure the topHandler is not throwing useful information away.

@neongreen

In case anyone has the same problem and stumbles upon this comment: if your Windows user name contains non-latin letters (to be more precise: if the name of your home directory contains non-latin letters), and you're using MSYS, you'll get this error.

@ttuegel
Haskell member

@neongreen Is this a problem if you aren't using MSYS?

@ttuegel ttuegel added this to the Cabal-1.24 milestone Apr 23, 2015
@23Skidoo 23Skidoo modified the milestone: Cabal 1.24, Cabal 1.26 Feb 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment