diff --git a/Cabal/ChangeLog.md b/Cabal/ChangeLog.md index ba4e508ff1f..607fb6aa6c2 100644 --- a/Cabal/ChangeLog.md +++ b/Cabal/ChangeLog.md @@ -7,6 +7,8 @@ * Add `extra-dynamic-library-flavours`, to specify extra dynamic library flavours to build and install from a .cabal file. * `autoconfUserHooks` now passes `--host=$HOST` when cross-compiling + * Fix corrupted config file header for non-ASCII package names + ([2557](https://github.com/haskell/cabal/issues/2557)). ---- diff --git a/Cabal/Distribution/Simple/Configure.hs b/Cabal/Distribution/Simple/Configure.hs index 0b8663e53ae..8fa8eed4b76 100644 --- a/Cabal/Distribution/Simple/Configure.hs +++ b/Cabal/Distribution/Simple/Configure.hs @@ -276,7 +276,7 @@ parseHeader header = case BLC8.words header of ["Saved", "package", "config", "for", pkgId, "written", "by", cabalId, "using", compId] -> fromMaybe (throw ConfigStateFileBadHeader) $ do - _ <- simpleParsec (BLC8.unpack pkgId) :: Maybe PackageIdentifier + _ <- simpleParsec (fromUTF8LBS pkgId) :: Maybe PackageIdentifier cabalId' <- simpleParsec (BLC8.unpack cabalId) compId' <- simpleParsec (BLC8.unpack compId) return (cabalId', compId') @@ -287,7 +287,7 @@ showHeader :: PackageIdentifier -- ^ The processed package. -> ByteString showHeader pkgId = BLC8.unwords [ "Saved", "package", "config", "for" - , BLC8.pack $ prettyShow pkgId + , toUTF8LBS $ prettyShow pkgId , "written", "by" , BLC8.pack $ prettyShow currentCabalId , "using"