You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cabal format is not listed in --help message #2460
Fixing this is trivial, but we'll need to fix #2661 and #2681 first before making this feature public. See discussion in #2607, specifically #2607 (comment).
Here's a script I bodged together from the one in the other ticket, but updated for the latest cabal.
module Main (main) where
import Control.Monad
import Control.Applicative
import Distribution.Verbosity
import Distribution.Client.IndexUtils
import qualified Distribution.PackageDescription.Parsec as PackageDesc.Parse
import Distribution.PackageDescription.PrettyPrint
import Distribution.ParseUtils
import qualified Data.ByteString.Char8 as BS
import Data.List
check :: FilePath -> IO ()
check cabal = do
print cabal
cabalfile <- BS.readFile cabal
let desc1 = parsePackageDescription cabalfile
case desc1 of
Nothing -> print "failparse"
Just desc -> do
let desc' = parsePackageDescription $ BS.pack (showGenericPackageDescription desc)
when (Just desc /= desc') $ do
print $ Just desc
print $ desc'
fail cabal
parsePackageDescription content = either (const Nothing) Just $ snd $ PackageDesc.Parse.runParseResult $ PackageDesc.Parse.parseGenericPackageDescription $ content
myFilter x = not $ "lambdaBase" `isInfixOf` x || "wiringPi" `isInfixOf` x || "constrained-monads" `isInfixOf` x
main :: IO ()
main = do
-- Generate listing with
-- find . -type f -name '*.cabal' > cabal-files
cabalFiles <- Prelude.filter myFilter . Prelude.lines <$> Prelude.readFile "cabal-files"
mapM_ check cabalFiles
The errors it seems to run into are all about round-trips with character encodings.
E.g. in the original you have something like copyright = "2016 Donnacha Ois\237n Kidney", and in the processed file you have copyright = "2016 Donnacha Ois\65533 Kidney"
Activity
23Skidoo commentedon Mar 9, 2015
There are some bugs, e.g. #2353.
23Skidoo commentedon Apr 23, 2016
Fixing this is trivial, but we'll need to fix #2661 and #2681 first before making this feature public. See discussion in #2607, specifically #2607 (comment).
gbaz commentedon Mar 17, 2018
It looks like both the referenced bugs were fixed. Are there any further blockers?
gbaz commentedon Mar 17, 2018
Here's a script I bodged together from the one in the other ticket, but updated for the latest cabal.
The errors it seems to run into are all about round-trips with character encodings.
E.g. in the original you have something like
copyright = "2016 Donnacha Ois\237n Kidney",and in the processed file you havecopyright = "2016 Donnacha Ois\65533 Kidney"