From b7b4d325547ecbe8e8f43d551d23e4a55915190c Mon Sep 17 00:00:00 2001 From: Ignat Insarov Date: Fri, 2 Feb 2018 00:37:27 +0700 Subject: [PATCH 1/3] Update so that it actually builds. * Advance stack snapshot version. * Fix the breakage caused by changes in Cabal. * Bump minor version. This still leaves many warnings to be addressed. Only erroneous faults were fixed due to urgency. --- hpack-convert.cabal | 2 +- src/Hpack/Convert.hs | 48 +++++++++++++++++++++++++------------------- src/Hpack/Util.hs | 2 +- stack.yaml | 7 +++---- 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/hpack-convert.cabal b/hpack-convert.cabal index b902de1f..5f1bd045 100644 --- a/hpack-convert.cabal +++ b/hpack-convert.cabal @@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: hpack-convert -version: 1.0.1 +version: 1.0.2 synopsis: Convert Cabal manifests into hpack's package.yamls category: Development homepage: https://github.com/yamadapc/hpack-convert#readme diff --git a/src/Hpack/Convert.hs b/src/Hpack/Convert.hs index e5d1227e..55f8e767 100644 --- a/src/Hpack/Convert.hs +++ b/src/Hpack/Convert.hs @@ -17,6 +17,9 @@ import qualified Distribution.Package as Cabal import qualified Distribution.PackageDescription as Cabal import qualified Distribution.PackageDescription.Parse as Cabal import qualified Distribution.Text as Cabal +import qualified Distribution.Types.UnqualComponentName as Cabal +import qualified Distribution.Types.LegacyExeDependency as Cabal +import qualified Distribution.Types.CondTree as Cabal import qualified Distribution.Version as Cabal import Hpack.Config hiding (package) import Text.PrettyPrint (fsep, (<+>)) @@ -30,7 +33,7 @@ fromPackageDescription Cabal.GenericPackageDescription{..} = let Cabal.PackageDescription{..} = packageDescription in Package { packageName = Cabal.unPackageName (Cabal.pkgName package) - , packageVersion = Version.showVersion (Cabal.pkgVersion package) + , packageVersion = Cabal.showVersion (Cabal.pkgVersion package) , packageSynopsis = nullNothing synopsis , packageDescription = nullNothing description , packageHomepage = nullNothing homepage @@ -49,7 +52,7 @@ fromPackageDescription Cabal.GenericPackageDescription{..} = nullNothing testedWith , packageFlags = map (\Cabal.MkFlag{..} -> - let Cabal.FlagName fn = flagName + let fn = Cabal.unFlagName flagName in Flag { flagName = fn , flagDescription = nullNothing flagDescription @@ -104,6 +107,12 @@ fromDependency (Cabal.Dependency pn vr) | vr == Cabal.anyVersion = fromDependency (Cabal.Dependency pn vr) = Dependency (show (Cabal.disp pn <+> Cabal.disp vr)) Nothing +fromLegacyDependency :: Cabal.LegacyExeDependency -> Dependency +fromLegacyDependency (Cabal.LegacyExeDependency pn vr) | vr == Cabal.anyVersion = + Dependency pn Nothing +fromLegacyDependency (Cabal.LegacyExeDependency pn vr) = + Dependency (show (pn ++ show vr)) Nothing + fromCondLibrary :: Maybe (Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Library) -> Maybe (Section Library) fromCondLibrary mcondLibrary = do condLibrary@(Cabal.CondNode Cabal.Library{libBuildInfo} _ components) <- mcondLibrary @@ -112,30 +121,30 @@ fromCondLibrary mcondLibrary = do { sectionConditionals = map fromCondComponentHasBuildInfo components } -fromCondExecutables :: [(String, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Executable)] -> [Section Executable] +fromCondExecutables :: [(Cabal.UnqualComponentName, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Executable)] -> [Section Executable] fromCondExecutables = map fromCondExecutableTup -fromCondTestSuites :: [(String, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.TestSuite)] -> [Section Executable] +fromCondTestSuites :: [(Cabal.UnqualComponentName, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.TestSuite)] -> [Section Executable] fromCondTestSuites = mapMaybe fromCondTestSuiteTup -fromCondBenchmarks :: [(String, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Benchmark)] -> [Section Executable] +fromCondBenchmarks :: [(Cabal.UnqualComponentName, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Benchmark)] -> [Section Executable] fromCondBenchmarks = mapMaybe fromCondBenchmarkTup -fromCondExecutableTup :: (String, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Executable) -> Section Executable +fromCondExecutableTup :: (Cabal.UnqualComponentName, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Executable) -> Section Executable fromCondExecutableTup etup@(_, Cabal.CondNode Cabal.Executable{buildInfo} _ components) = let e = exeFromCondExecutableTup etup in (sectionWithBuildInfo e buildInfo) { sectionConditionals = map fromCondComponentHasBuildInfo components } -fromCondTestSuiteTup :: (String, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.TestSuite) -> Maybe (Section Executable) +fromCondTestSuiteTup :: (Cabal.UnqualComponentName, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.TestSuite) -> Maybe (Section Executable) fromCondTestSuiteTup ttup@(_, Cabal.CondNode Cabal.TestSuite{testBuildInfo} _ components) = do te <- testExeFromCondExecutableTup ttup return (sectionWithBuildInfo te testBuildInfo) { sectionConditionals = map fromCondComponentHasBuildInfo components } -fromCondBenchmarkTup :: (String, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Benchmark) -> Maybe (Section Executable) +fromCondBenchmarkTup :: (Cabal.UnqualComponentName, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Benchmark) -> Maybe (Section Executable) fromCondBenchmarkTup btup@(_, Cabal.CondNode Cabal.Benchmark{benchmarkBuildInfo} _ components) = do be <- benchExeFromCondExecutableTup btup return (sectionWithBuildInfo be benchmarkBuildInfo) @@ -166,12 +175,9 @@ fromCondHasBuildInfo (Cabal.CondNode hbi _ components) = } fromCondComponentHasBuildInfo :: (HasBuildInfo a) - => ( Cabal.Condition Cabal.ConfVar - , Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] a - , Maybe (Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] a) - ) + => Cabal.CondBranch Cabal.ConfVar [Cabal.Dependency] a -> Conditional -fromCondComponentHasBuildInfo (cond, ifTree, elseTree) = +fromCondComponentHasBuildInfo (Cabal.CondBranch cond ifTree elseTree) = Conditional { conditionalCondition = fromCondition cond , conditionalThen = fromCondHasBuildInfo ifTree , conditionalElse = fromCondHasBuildInfo <$> elseTree @@ -180,7 +186,7 @@ fromCondComponentHasBuildInfo (cond, ifTree, elseTree) = fromCondition :: Cabal.Condition Cabal.ConfVar -> String fromCondition (Cabal.Var c) = case c of Cabal.OS os -> "os(" ++ show (Cabal.disp os) ++ ")" - Cabal.Flag (Cabal.FlagName fl) -> "flag(" ++ fl ++ ")" + Cabal.Flag fl -> "flag(" ++ Cabal.unFlagName fl ++ ")" Cabal.Arch ar -> "arch(" ++ show (Cabal.disp ar) ++ ")" Cabal.Impl cc vr -> "impl(" ++ show (Cabal.disp cc <+> Cabal.disp vr) ++ ")" fromCondition (Cabal.CNot c) = "!(" ++ fromCondition c ++ ")" @@ -220,7 +226,7 @@ sectionWithBuildInfo d Cabal.BuildInfo{..} = -- TODO ^^ ???? , sectionConditionals = [] -- TODO ^^ ???? - , sectionBuildTools = map fromDependency buildTools + , sectionBuildTools = map fromLegacyDependency buildTools } libFromCondLibrary :: Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Library -> Maybe Library @@ -234,30 +240,30 @@ libFromCondLibrary (Cabal.CondNode (Cabal.Library{..}) _ _) = do reexportedModules } -exeFromCondExecutableTup :: (String, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Executable) -> Executable +exeFromCondExecutableTup :: (Cabal.UnqualComponentName, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Executable) -> Executable exeFromCondExecutableTup (name, Cabal.CondNode Cabal.Executable{..} _ _) = - Executable { executableName = name + Executable { executableName = Cabal.unUnqualComponentName name , executableMain = modulePath , executableOtherModules = map (show . Cabal.disp) (Cabal.otherModules buildInfo) } -testExeFromCondExecutableTup :: (String, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.TestSuite) -> Maybe Executable +testExeFromCondExecutableTup :: (Cabal.UnqualComponentName, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.TestSuite) -> Maybe Executable testExeFromCondExecutableTup (name, Cabal.CondNode Cabal.TestSuite{..} _ _) = case testInterface of Cabal.TestSuiteExeV10 _ mainIs -> Just - Executable { executableName = name + Executable { executableName = Cabal.unUnqualComponentName name , executableMain = mainIs , executableOtherModules = map (show . Cabal.disp) (Cabal.otherModules testBuildInfo) } _ -> Nothing -benchExeFromCondExecutableTup :: (String, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Benchmark) -> Maybe Executable +benchExeFromCondExecutableTup :: (Cabal.UnqualComponentName, Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Benchmark) -> Maybe Executable benchExeFromCondExecutableTup (name, Cabal.CondNode Cabal.Benchmark{..} _ _) = case benchmarkInterface of Cabal.BenchmarkExeV10 _ mainIs -> Just - Executable { executableName = name + Executable { executableName = Cabal.unUnqualComponentName name , executableMain = mainIs , executableOtherModules = map (show . Cabal.disp) (Cabal.otherModules benchmarkBuildInfo) diff --git a/src/Hpack/Util.hs b/src/Hpack/Util.hs index 0bb1d880..83675ccc 100644 --- a/src/Hpack/Util.hs +++ b/src/Hpack/Util.hs @@ -103,7 +103,7 @@ toPosixFilePath = Posix.joinPath . splitDirectories expandGlobs :: FilePath -> [String] -> IO ([String], [FilePath]) expandGlobs dir patterns = do - files <- (fst <$> globDir compiledPatterns dir) >>= mapM removeDirectories + files <- (globDir compiledPatterns dir) >>= mapM removeDirectories let warnings = [warn pattern | ([], pattern) <- zip files patterns] return (warnings, combineResults files) where diff --git a/stack.yaml b/stack.yaml index 7b096c2d..a4bde4d3 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,5 +1,4 @@ -flags: {} packages: -- '.' -extra-deps: [] -resolver: lts-8.13 +- . + +resolver: lts-10.3 From 3e434063614ee23b5cef9a6aca9bb9ea02ae4be6 Mon Sep 17 00:00:00 2001 From: Will Badart Date: Fri, 27 Mar 2020 19:35:17 -0700 Subject: [PATCH 2/3] Got it to compile with stack LTS-15.5 Most of the changes are due to the Pretty class that was added, it seems, in v2.2.0.1-tgt. There were some slightly trickier cases around some data types that don't seem to be used anymore and changes to the Package/ GenericPackge records. Open questions: - This doesn't pass all the tests. The main failures seem to be around quoting in certain rendering situations and in error reporting - Relatedly, how should the new-ish ParseResult monad be incorporated? I opted for parseGenericPackageDescriptionMaybe because I didn't want to infect the rest of the module with an API change, but it's unclear how to exactly recover the old behavior. - Is the style where it needs to be (whitespace/ indentation, ...)? --- hpack-convert.cabal | 90 +++++++++++++++++++++++--------------------- package.yaml | 1 - src/Hpack/Convert.hs | 55 +++++++++++++++------------ stack.yaml | 2 +- 4 files changed, 79 insertions(+), 69 deletions(-) diff --git a/hpack-convert.cabal b/hpack-convert.cabal index 5f1bd045..3d16c55f 100644 --- a/hpack-convert.cabal +++ b/hpack-convert.cabal @@ -1,9 +1,13 @@ --- This file has been generated from package.yaml by hpack version 0.17.0. +cabal-version: 1.12 + +-- This file has been generated from package.yaml by hpack version 0.31.2. -- -- see: https://github.com/sol/hpack +-- +-- hash: 4794b90b9a3b0d9b99da7c29255e6062b59cfce3da83ccb1dfa4abe46a90d253 name: hpack-convert -version: 1.0.2 +version: 1.0.1 synopsis: Convert Cabal manifests into hpack's package.yamls category: Development homepage: https://github.com/yamadapc/hpack-convert#readme @@ -12,8 +16,6 @@ maintainer: Pedro Tacla Yamada license: MIT license-file: LICENSE build-type: Simple -cabal-version: >= 1.10 - extra-source-files: ./test/data/cabal-init-minimal.cabal ./test/data/cabal-init-minimal.cabal.yaml @@ -60,22 +62,22 @@ library src ghc-options: -Wall -fcontext-stack=100 build-depends: - base >= 4.7 && < 5 - , base-compat >= 0.8 - , Cabal >= 1.22 - , pretty + Cabal >=1.22 + , Glob + , aeson + , base >=4.7 && <5 + , base-compat >=0.8 + , bytestring + , containers , deepseq , directory , filepath - , Glob + , pretty + , split , text - , containers - , unordered-containers >= 0.2.7.1 - , yaml - , bytestring + , unordered-containers >=0.2.7.1 , vector - , aeson - , split + , yaml exposed-modules: Hpack.Convert other-modules: @@ -99,22 +101,22 @@ executable hpack-convert src ghc-options: -Wall -fcontext-stack=100 build-depends: - base >= 4.7 && < 5 - , base-compat >= 0.8 - , Cabal >= 1.22 - , pretty + Cabal >=1.22 + , Glob + , aeson + , base >=4.7 && <5 + , base-compat >=0.8 + , bytestring + , containers , deepseq , directory , filepath - , Glob + , pretty + , split , text - , containers - , unordered-containers >= 0.2.7.1 - , yaml - , bytestring + , unordered-containers >=0.2.7.1 , vector - , aeson - , split + , yaml other-modules: Hpack Hpack.Config @@ -127,6 +129,7 @@ executable hpack-convert Hpack.Run Hpack.Util Hpack.Yaml + Paths_hpack_convert default-language: Haskell2010 test-suite spec @@ -138,28 +141,28 @@ test-suite spec ghc-options: -Wall -fcontext-stack=100 cpp-options: -DTEST build-depends: - base >= 4.7 && < 5 - , base-compat >= 0.8 - , Cabal >= 1.22 - , pretty + Cabal >=1.22 + , Glob + , QuickCheck + , aeson + , aeson-qq + , base >=4.7 && <5 + , base-compat >=0.8 + , bytestring + , containers , deepseq , directory , filepath - , Glob - , text - , containers - , unordered-containers >= 0.2.7.1 - , yaml - , bytestring - , vector - , aeson + , hspec ==2.* + , interpolate + , mockery >=0.3 + , pretty , split - , hspec == 2.* - , QuickCheck , temporary - , mockery >= 0.3 - , interpolate - , aeson-qq + , text + , unordered-containers >=0.2.7.1 + , vector + , yaml other-modules: Helper Hpack.ConfigSpec @@ -182,4 +185,5 @@ test-suite spec Hpack.Run Hpack.Util Hpack.Yaml + Paths_hpack_convert default-language: Haskell2010 diff --git a/package.yaml b/package.yaml index fa859b4f..757d6964 100644 --- a/package.yaml +++ b/package.yaml @@ -30,7 +30,6 @@ dependencies: library: source-dirs: src - dependencies: exposed-modules: - Hpack.Convert diff --git a/src/Hpack/Convert.hs b/src/Hpack/Convert.hs index 55f8e767..fb54a237 100644 --- a/src/Hpack/Convert.hs +++ b/src/Hpack/Convert.hs @@ -3,6 +3,7 @@ {-# LANGUAGE RecordWildCards #-} module Hpack.Convert where +import qualified Data.ByteString.Char8 as BS import Data.Char import Data.Monoid import Prelude () @@ -15,7 +16,10 @@ import qualified Distribution.Compiler as Compiler import qualified Distribution.InstalledPackageInfo as Cabal import qualified Distribution.Package as Cabal import qualified Distribution.PackageDescription as Cabal -import qualified Distribution.PackageDescription.Parse as Cabal +import qualified Distribution.PackageDescription.Parsec as Cabal +import qualified Distribution.Parsec.Error as Cabal +import qualified Distribution.Pretty as Cabal +import qualified Distribution.Simple as Cabal import qualified Distribution.Text as Cabal import qualified Distribution.Types.UnqualComponentName as Cabal import qualified Distribution.Types.LegacyExeDependency as Cabal @@ -33,7 +37,7 @@ fromPackageDescription Cabal.GenericPackageDescription{..} = let Cabal.PackageDescription{..} = packageDescription in Package { packageName = Cabal.unPackageName (Cabal.pkgName package) - , packageVersion = Cabal.showVersion (Cabal.pkgVersion package) + , packageVersion = Cabal.prettyShow (Cabal.pkgVersion package) , packageSynopsis = nullNothing synopsis , packageDescription = nullNothing description , packageHomepage = nullNothing homepage @@ -43,12 +47,12 @@ fromPackageDescription Cabal.GenericPackageDescription{..} = , packageAuthor = maybe [] parseCommaSep (nullNothing author) , packageMaintainer = maybe [] parseCommaSep (nullNothing maintainer) , packageCopyright = maybe [] parseCommaSep (nullNothing copyright) - , packageLicense = Just (show (Cabal.disp license)) + , packageLicense = Just (show $ Cabal.pretty (either Cabal.licenseFromSPDX id licenseRaw)) , packageLicenseFile = listToMaybe licenseFiles , packageTestedWith = map toUpper . show . - fsep . map (\(f, vr) -> Cabal.disp f <> Cabal.disp vr ) <$> + fsep . map (\(f, vr) -> Cabal.pretty f <> Cabal.pretty vr ) <$> nullNothing testedWith , packageFlags = map (\Cabal.MkFlag{..} -> @@ -72,9 +76,12 @@ fromPackageDescription Cabal.GenericPackageDescription{..} = -- | Reads a 'Package' from a @.cabal@ manifest string fromPackageDescriptionString :: String -> Either ConvertError Package fromPackageDescriptionString pkgStr = - case Cabal.parsePackageDescription pkgStr of - Cabal.ParseFailed e -> Left (ConvertCabalParseError e) - Cabal.ParseOk _ gpkg -> Right (fromPackageDescription gpkg) + case Cabal.parseGenericPackageDescriptionMaybe (BS.pack pkgStr) of + Nothing -> Left (ConvertCabalParseError (Cabal.PError undefined "oh no")) + Just gpkg -> Right (fromPackageDescription gpkg) + +instance Eq Cabal.PError where + (Cabal.PError _ s1) == (Cabal.PError _ s2) = s1 == s2 data ConvertError = ConvertCabalParseError Cabal.PError deriving(Show, Eq) @@ -102,10 +109,10 @@ fromSourceRepos (_repo@Cabal.SourceRepo{..}:_more) = -- ) fromDependency :: Cabal.Dependency -> Dependency -fromDependency (Cabal.Dependency pn vr) | vr == Cabal.anyVersion = - Dependency (show (Cabal.disp pn)) Nothing -fromDependency (Cabal.Dependency pn vr) = - Dependency (show (Cabal.disp pn <+> Cabal.disp vr)) Nothing +fromDependency (Cabal.Dependency pn vr _) | vr == Cabal.anyVersion = + Dependency (show (Cabal.pretty pn)) Nothing +fromDependency (Cabal.Dependency pn vr _) = + Dependency (show (Cabal.pretty pn <+> Cabal.pretty vr)) Nothing fromLegacyDependency :: Cabal.LegacyExeDependency -> Dependency fromLegacyDependency (Cabal.LegacyExeDependency pn vr) | vr == Cabal.anyVersion = @@ -185,10 +192,10 @@ fromCondComponentHasBuildInfo (Cabal.CondBranch cond ifTree elseTree) = fromCondition :: Cabal.Condition Cabal.ConfVar -> String fromCondition (Cabal.Var c) = case c of - Cabal.OS os -> "os(" ++ show (Cabal.disp os) ++ ")" + Cabal.OS os -> "os(" ++ show (Cabal.pretty os) ++ ")" Cabal.Flag fl -> "flag(" ++ Cabal.unFlagName fl ++ ")" - Cabal.Arch ar -> "arch(" ++ show (Cabal.disp ar) ++ ")" - Cabal.Impl cc vr -> "impl(" ++ show (Cabal.disp cc <+> Cabal.disp vr) ++ ")" + Cabal.Arch ar -> "arch(" ++ show (Cabal.pretty ar) ++ ")" + Cabal.Impl cc vr -> "impl(" ++ show (Cabal.pretty cc <+> Cabal.pretty vr) ++ ")" fromCondition (Cabal.CNot c) = "!(" ++ fromCondition c ++ ")" fromCondition (Cabal.COr c1 c2) = "(" ++ fromCondition c1 ++ ") || (" ++ fromCondition c2 ++ ")" fromCondition (Cabal.CAnd c1 c2) = "(" ++ fromCondition c1 ++ ") && (" ++ fromCondition c2 ++ ")" @@ -203,17 +210,17 @@ sectionWithBuildInfo d Cabal.BuildInfo{..} = Section { sectionData = d , sectionSourceDirs = processDirs hsSourceDirs , sectionDependencies = map fromDependency targetBuildDepends - , sectionDefaultExtensions = map (show . Cabal.disp) + , sectionDefaultExtensions = map (show . Cabal.pretty) defaultExtensions - , sectionOtherExtensions = map (show . Cabal.disp) otherExtensions + , sectionOtherExtensions = map (show . Cabal.pretty) otherExtensions , sectionGhcOptions = map (\l -> case words l of [] -> "" [x] -> x _ -> ensureQuoted l) $ fromMaybe [] $ - lookup Compiler.GHC options + lookup Compiler.GHC (Cabal.perCompilerFlavorToList options) , sectionGhcProfOptions = fromMaybe [] $ - lookup Compiler.GHC profOptions + lookup Compiler.GHC (Cabal.perCompilerFlavorToList profOptions) , sectionCppOptions = cppOptions , sectionCCOptions = ccOptions , sectionCSources = cSources @@ -233,10 +240,10 @@ libFromCondLibrary :: Cabal.CondTree Cabal.ConfVar [Cabal.Dependency] Cabal.Libr libFromCondLibrary (Cabal.CondNode (Cabal.Library{..}) _ _) = do let Cabal.BuildInfo{..} = libBuildInfo return Library { libraryExposed = Just libExposed - , libraryExposedModules = map (show . Cabal.disp) + , libraryExposedModules = map (show . Cabal.pretty) exposedModules - , libraryOtherModules = map (show . Cabal.disp) otherModules - , libraryReexportedModules = map (show . Cabal.disp) + , libraryOtherModules = map (show . Cabal.pretty) otherModules + , libraryReexportedModules = map (show . Cabal.pretty) reexportedModules } @@ -244,7 +251,7 @@ exeFromCondExecutableTup :: (Cabal.UnqualComponentName, Cabal.CondTree Cabal.Con exeFromCondExecutableTup (name, Cabal.CondNode Cabal.Executable{..} _ _) = Executable { executableName = Cabal.unUnqualComponentName name , executableMain = modulePath - , executableOtherModules = map (show . Cabal.disp) + , executableOtherModules = map (show . Cabal.pretty) (Cabal.otherModules buildInfo) } @@ -254,7 +261,7 @@ testExeFromCondExecutableTup (name, Cabal.CondNode Cabal.TestSuite{..} _ _) = Cabal.TestSuiteExeV10 _ mainIs -> Just Executable { executableName = Cabal.unUnqualComponentName name , executableMain = mainIs - , executableOtherModules = map (show . Cabal.disp) + , executableOtherModules = map (show . Cabal.pretty) (Cabal.otherModules testBuildInfo) } _ -> Nothing @@ -265,7 +272,7 @@ benchExeFromCondExecutableTup (name, Cabal.CondNode Cabal.Benchmark{..} _ _) = Cabal.BenchmarkExeV10 _ mainIs -> Just Executable { executableName = Cabal.unUnqualComponentName name , executableMain = mainIs - , executableOtherModules = map (show . Cabal.disp) + , executableOtherModules = map (show . Cabal.pretty) (Cabal.otherModules benchmarkBuildInfo) } _ -> Nothing diff --git a/stack.yaml b/stack.yaml index a4bde4d3..e4e54d4c 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ packages: - . -resolver: lts-10.3 +resolver: lts-15.5 From 23168512bcf778c84a4bfb5a7680ccc2f23c6331 Mon Sep 17 00:00:00 2001 From: Will Badart Date: Sun, 29 Mar 2020 16:02:22 -0700 Subject: [PATCH 3/3] Bump patch version, regenerate cabal file --- hpack-convert.cabal | 4 ++-- package.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hpack-convert.cabal b/hpack-convert.cabal index 3d16c55f..29ad3b0c 100644 --- a/hpack-convert.cabal +++ b/hpack-convert.cabal @@ -4,10 +4,10 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: 4794b90b9a3b0d9b99da7c29255e6062b59cfce3da83ccb1dfa4abe46a90d253 +-- hash: 525f13497c3d93541a38db7fa16b1f5ce04bb27bb9e880250fcf5f1588599bbf name: hpack-convert -version: 1.0.1 +version: 1.0.3 synopsis: Convert Cabal manifests into hpack's package.yamls category: Development homepage: https://github.com/yamadapc/hpack-convert#readme diff --git a/package.yaml b/package.yaml index 757d6964..5380b2c0 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: hpack-convert -version: '1.0.1' +version: '1.0.3' synopsis: Convert Cabal manifests into hpack's package.yamls maintainer: Pedro Tacla Yamada license: MIT