[Hackage] #714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal"

#714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Windows | ---------------------------------+------------------------------------------ I have a similar error than exposed in Ticket#677. This error appears when I try to install the HaTeX package: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" Even when I'm installing version 1.0.1. A link to the package in Hackage: http://hackage.haskell.org/package/HaTeX Note that the same error appears in Hackage. I'm the author of the package, and I want a fix for him. But I don't know how to attack the problem, because error appears before reading a new version of the package (When "Resolving dependencies..."). -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/714 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Windows | ---------------------------------+------------------------------------------ Changes (by guest): * cc: lazy.ddiaz@… (added) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/714#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Windows | ---------------------------------+------------------------------------------ Changes (by guest): * cc: lazy.ddiaz@… (removed) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/714#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: 6.12.1 Platform: Windows | ---------------------------------+------------------------------------------ Changes (by guest): * ghcversion: => 6.12.1 -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/714#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.12.1 Platform: Windows | ---------------------------------+------------------------------------------ Changes (by duncan): * difficulty: unknown => normal Comment: So the problem here is that the HaTeX.cabal file uses a BOM (a byte order mark). Newer Cabal lib versions will happily ignore the BOM at the beginning of the file but older versions will not. The hackage upload checker uses the new code so it accepts the package. We could allow the BOM when the package declares that it needs a sufficiently recent Cabal version, or we could make hackage reject packages that use the BOM. In the mean time we should just edit the HaTex.cabal in the index on the server to remove the BOM. With the current code it's a bit tricky to check for the BOM because it is discarded when reading the file. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/714#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.12.1 Platform: Windows | ---------------------------------+------------------------------------------ Comment(by ross): Does this need a development version? {{{ % cabal --version cabal-install version 0.8.2 using version 1.8.0.6 of the Cabal library % cabal install HaTeX-1.0.1 Resolving dependencies... cabal: Couldn't read cabal file "./HaTeX/1.0.0/HaTeX.cabal" }}} The error message is suboptimal too. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/714#comment:5 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.12.1 Platform: Windows | ---------------------------------+------------------------------------------ Comment(by duncan): Ah, found the problem. When we read a .cabal file from disk we use readUTF8File which ignores the BOM. We do not do the same when reading the .cabal entry from the index tarball in cabal-install. Really we should make `parsePackageDescription` take a `ByteString` and have it do all the decoding (utf, bom, line ending conversion) there in a single place. Ross: the temporary solution is to change the hackage-scripts upload script to read the .cabal file from disk using a modified readUTF8File that does not ignore the BOM: {{{ readUTF8File_LeavingBOMIntact :: FilePath -> IO String readUTF8File_LeavingBOMIntact f = fmap fromUTF8 . hGetContents =<< openBinaryFile f ReadMode }}} We should also edit the two HaTex .cabal files in the current archive to strip off the BOM. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/714#comment:6 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.12.1 Platform: Windows | ---------------------------------+------------------------------------------ Comment(by duncan): Btw, as for the bad error message. It's a bit tricky the way we have it at the moment. Currently we lazily parse the .cabal entries and call error if it fails. So we cannot give different errors in different places. Ticket #288 is about handling the index better, we would read the index tarball after download, parse them all then (giving suitable errors/warnings) and write out a new index in an internal form that is faster and does not need further checking/parsing. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/714#comment:7 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

Ross: the temporary solution is to change the hackage-scripts upload
#714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.12.1 Platform: Windows | ---------------------------------+------------------------------------------ Comment(by ross): Replying to [comment:6 duncan]: script to read the .cabal file from disk using a modified readUTF8File that does not ignore the BOM: Is the idea to make the upload fail by triggering a parse error? -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/714#comment:8 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.12.1 Platform: Windows | ---------------------------------+------------------------------------------ Comment(by duncan): Replying to [comment:8 ross]:
Is the idea to make the upload fail by triggering a parse error?
Either that or checking for the BOM explicitly. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/714#comment:9 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.12.1 Platform: Windows | ---------------------------------+------------------------------------------ Comment(by elga): * [http://www.releve-identite-operateur.fr/numbero-de-virgin-mobile.html virgin mobile] -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/714#comment:10 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#714: cabal: Couldn't read cabal file ".\\HaTeX\\1.0.0\\HaTeX.cabal" ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: cabal-install-0.16 Component: cabal-install tool | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.12.1 Platform: Windows | ---------------------------------+------------------------------------------ Changes (by kosmikus): * milestone: => cabal-install-0.16 -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/714#comment:10 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage