Skip to content

compiler directive of cabal-install's config file is case sensitive #372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bos opened this issue May 24, 2012 · 2 comments
Closed

compiler directive of cabal-install's config file is case sensitive #372

bos opened this issue May 24, 2012 · 2 comments

Comments

@bos
Copy link
Contributor

bos commented May 24, 2012

(Imported from Trac #379, reported by phigley on 2008-10-22)

Using cabal-install 0.6.0 (and 1.6.0.1 of the Cabal library) the following line fails to parse in the config file (in ~/.cabal/config) :

compiler: GHC

which generates the following error :
Warning: Error parsing config file /Users/peterhigley/.cabal/config:1: "GHC"
Warning: Using default configuration.

But changing it to this resolves the problem :

compiler: ghc

My config file was auto-generated from an older cabal-install.

This is easiest to reproduce by running "cabal update".

I am reproing on a Mac, but an e-mail was sent to haskell-cafe from a Windows user as well.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dcoutts on 2008-10-22)

This is a more tricky problem than it looks. The reason is we're now parsing the config file by converting the command line parser. It has flags for --ghc, --hugs etc and is case sensitive. Really we'd like a config field flag parsed using the Text instance for CompilerFlavor because that is not case sensitive.

Doing this properly involves rewriting the command line option / config file field description subsystem.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dcoutts on 2009-01-12)

Fixed with a bit of a hack:

Fri Jan 16 00:28:51 GMT 2009  Duncan Coutts <[email protected]>
  * Parse compiler field from old config files correctly
  Really old versions of cabal-install generated a default config
  containing "compiler: GHC". Sadly the new way we generate the
  config file parser from the command line parser means we end up
  with a case-sensitive parser as it only matches the exact
  command line flags. So we hack it and add in a traditional
  parser for that field only. Really the command line and config
  file infrastructure needs rewriting again. Sigh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant