#5754: Cabal cannot register a package in a directory with Unicode chars
-----------------------------+----------------------------------------------
  Reporter:  simonmar        |          Owner:  simonmar        
      Type:  bug             |         Status:  closed          
  Priority:  highest         |      Milestone:  7.4.1           
 Component:  Package system  |        Version:  7.2.1           
Resolution:  invalid         |       Keywords:                  
        Os:  Windows         |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown    |     Difficulty:  Unknown         
  Testcase:                  |      Blockedby:                  
  Blocking:                  |        Related:                  
-----------------------------+----------------------------------------------
Changes (by simonmar):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 I understand a bit more about what is going on here.  I removed `cabal-
 install` from the equation by using `Setup.hs` instead.  What happens is:

 `ghc-pkg` is trying to emit a warning that the Haddock interface doesn't
 exist (because I didn't generate it).

 `ghc-pkg` is a subprocess invoked by Cabal, and as such is not attached to
 the console.  It therefore doesn't get the console's code page, and at
 least on my system it then defaults to CP 850 (I had the console set to CP
 65001, i.e. UTF-8).  In CP 850 the Unicode chars in the directory cannot
 be printed, so `ghc-pkg` fails when trying to print the warning.

 Cabal then tries to read the output generated by `ghc-pkg`, but since
 Cabal is attached to the console it is using UTF-8 and so misinterprets
 the output generated by `ghc-pkg`, leading to more errors.

 I don't think there's actually anything ''wrong'' here.  Why it wasn't
 failing before I have no idea.  To work around it there are several
 options:

  * Don't create directories containing characters not in the system code
 page
  * Don't use `chcp` to set the console code page differently from the
 system code page
  * Run `cabal haddock` to generate the right files and stop `ghc-pkg`
 complaining

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5754#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to