stack 1.0.4 → 1.0.4.1
raw patch · 10 files changed
+66/−45 lines, 10 filesdep ~aesondep ~stack
Dependency ranges changed: aeson, stack
Files
- ChangeLog.md +6/−1
- src/Data/Aeson/Extended.hs +25/−11
- src/Stack/Config.hs +3/−3
- src/Stack/Setup.hs +1/−1
- src/Stack/Solver.hs +3/−2
- src/Stack/Types/Config.hs +21/−20
- src/Stack/Types/Docker.hs +1/−1
- src/Stack/Types/Image.hs +2/−2
- src/Stack/Types/Nix.hs +1/−1
- stack.cabal +3/−3
ChangeLog.md view
@@ -1,5 +1,10 @@ # Changelog +## 1.0.4.1++Fixes build with aeson-0.11.0.0. There are no changes in behaviour from 1.0.4,+so no binaries are released for this version.+ ## 1.0.4 Major changes:@@ -222,7 +227,7 @@ locations will continue to work for some months, but we suggest that you adjust your `/etc/apt/sources.list.d/fpco.list` to the new location to avoid future disruption.-* [openSUSE and SUSE Linux Enterprise](http://docs.haskellstack.org/en/stable/install_and_upgrade/#opensuse-suse-linux-enterprise)+* [openSUSE and SUSE Linux Enterprise](http://docs.haskellstack.org/en/stable/install_and_upgrade/#suse) packages are now available, thanks to [@mimi1vx](https://github.com/mimi1vx). Note: there will be some lag before these pick up new versions, as they are based on Stackage LTS.
src/Data/Aeson/Extended.hs view
@@ -7,13 +7,15 @@ , (.:) , (.:?) -- * JSON Parser that emits warnings- , WarningParser , JSONWarning (..)+ , WarningParser+ , WithJSONWarnings (..) , withObjectWarnings , jsonSubWarnings , jsonSubWarningsT , jsonSubWarningsTT , logJSONWarnings+ , noJSONWarnings , tellJSONField , unWarningParser , (..:)@@ -75,7 +77,7 @@ withObjectWarnings :: String -> (Object -> WarningParser a) -> Value- -> Parser (a, [JSONWarning])+ -> Parser (WithJSONWarnings a) withObjectWarnings expected f = withObject expected $ \obj ->@@ -86,11 +88,11 @@ (Set.fromList (HashMap.keys obj)) (wpmExpectedFields w)) return- ( a- , wpmWarnings w ++- case unrecognizedFields of- [] -> []- _ -> [JSONUnrecognizedFields expected unrecognizedFields])+ (WithJSONWarnings a+ (wpmWarnings w +++ case unrecognizedFields of+ [] -> []+ _ -> [JSONUnrecognizedFields expected unrecognizedFields])) -- | Convert a 'WarningParser' to a 'Parser'. unWarningParser :: WarningParser a -> Parser a@@ -106,9 +108,9 @@ mapM_ (\w -> $logWarn ("Warning: " <> T.pack fp <> ": " <> T.pack (show w))) -- | Handle warnings in a sub-object.-jsonSubWarnings :: WarningParser (a, [JSONWarning]) -> WarningParser a+jsonSubWarnings :: WarningParser (WithJSONWarnings a) -> WarningParser a jsonSubWarnings f = do- (result,warnings) <- f+ WithJSONWarnings result warnings <- f tell (mempty { wpmWarnings = warnings@@ -118,18 +120,22 @@ -- | Handle warnings in a @Traversable@ of sub-objects. jsonSubWarningsT :: Traversable t- => WarningParser (t (a, [JSONWarning])) -> WarningParser (t a)+ => WarningParser (t (WithJSONWarnings a)) -> WarningParser (t a) jsonSubWarningsT f = Traversable.mapM (jsonSubWarnings . return) =<< f -- | Handle warnings in a @Maybe Traversable@ of sub-objects. jsonSubWarningsTT :: (Traversable t, Traversable u)- => WarningParser (u (t (a, [JSONWarning])))+ => WarningParser (u (t (WithJSONWarnings a))) -> WarningParser (u (t a)) jsonSubWarningsTT f = Traversable.mapM (jsonSubWarningsT . return) =<< f +-- Parsed JSON value without any warnings+noJSONWarnings :: a -> WithJSONWarnings a+noJSONWarnings v = WithJSONWarnings v []+ -- | JSON parser that warns about unexpected fields in objects. type WarningParser a = WriterT WarningParserMonoid Parser a @@ -147,6 +153,14 @@ (wpmExpectedFields b) , wpmWarnings = wpmWarnings a ++ wpmWarnings b }++-- Parsed JSON value with its warnings+data WithJSONWarnings a = WithJSONWarnings a [JSONWarning]+instance Functor WithJSONWarnings where+ fmap f (WithJSONWarnings x w) = WithJSONWarnings (f x) w+instance Monoid a => Monoid (WithJSONWarnings a) where+ mempty = noJSONWarnings mempty+ mappend (WithJSONWarnings a aw) (WithJSONWarnings b bw) = WithJSONWarnings (mappend a b) (mappend aw bw) -- | Warning output from 'WarningParser'. data JSONWarning = JSONUnrecognizedFields String [Text]
src/Stack/Config.hs view
@@ -153,7 +153,7 @@ config <- asks getConfig implicitGlobalDir <- getImplicitGlobalProjectDir config let fp = implicitGlobalDir </> stackDotYaml- (ProjectAndConfigMonoid project _, _warnings) <-+ WithJSONWarnings (ProjectAndConfigMonoid project _) _warnings <- liftIO (Yaml.decodeFileEither $ toFilePath fp) >>= either throwM return return $ projectResolver project@@ -730,9 +730,9 @@ : maybe [] return (mstackGlobalConfig <|> defaultStackGlobalConfigPath) -- | Load and parse YAML from the given file.-loadYaml :: (FromJSON (a, [JSONWarning]), MonadIO m, MonadLogger m) => Path Abs File -> m a+loadYaml :: (FromJSON (WithJSONWarnings a), MonadIO m, MonadLogger m) => Path Abs File -> m a loadYaml path = do- (result,warnings) <-+ WithJSONWarnings result warnings <- liftIO $ Yaml.decodeFileEither (toFilePath path) >>= either (throwM . ParseConfigFileException path) return
src/Stack/Setup.hs view
@@ -583,7 +583,7 @@ responseBody res $$ CL.consume return $ S8.concat bss Nothing -> liftIO $ S.readFile urlOrFile- (si,warnings) <- either throwM return (Yaml.decodeEither' bs)+ WithJSONWarnings si warnings <- either throwM return (Yaml.decodeEither' bs) when (urlOrFile /= defaultStackSetupYaml) $ logJSONWarnings urlOrFile warnings return si
src/Stack/Solver.hs view
@@ -20,7 +20,8 @@ import Control.Monad.Logger import Control.Monad.Reader import Control.Monad.Trans.Control-import Data.Aeson.Extended (object, (.=), toJSON, logJSONWarnings)+import Data.Aeson.Extended ( WithJSONWarnings(..), object, (.=), toJSON+ , logJSONWarnings) import qualified Data.ByteString as S import Data.Either import Data.Function (on)@@ -693,7 +694,7 @@ writeStackYaml path res deps fl = do let fp = toFilePath path obj <- liftIO (Yaml.decodeFileEither fp) >>= either throwM return- (ProjectAndConfigMonoid _ _, warnings) <-+ WithJSONWarnings (ProjectAndConfigMonoid _ _) warnings <- liftIO (Yaml.decodeFileEither fp) >>= either throwM return logJSONWarnings fp warnings let obj' =
src/Stack/Types/Config.hs view
@@ -132,8 +132,8 @@ import Data.Aeson.Extended (ToJSON, toJSON, FromJSON, parseJSON, withText, object, (.=), (..:), (..:?), (..!=), Value(String, Object),- withObjectWarnings, WarningParser, Object, jsonSubWarnings, JSONWarning,- jsonSubWarningsT, jsonSubWarningsTT)+ withObjectWarnings, WarningParser, Object, jsonSubWarnings,+ jsonSubWarningsT, jsonSubWarningsTT, WithJSONWarnings(..), noJSONWarnings) import Data.Attoparsec.Args import Data.Binary (Binary) import Data.ByteString (ByteString)@@ -311,7 +311,7 @@ -- ^ Require that hashes and package size information be available for packages in this index } deriving Show-instance FromJSON (PackageIndex, [JSONWarning]) where+instance FromJSON (WithJSONWarnings PackageIndex) where parseJSON = withObjectWarnings "PackageIndex" $ \o -> do name <- o ..: "name" prefix <- o ..: "download-prefix"@@ -552,15 +552,16 @@ , "location" .= peLocation pe , "subdirs" .= peSubdirs pe ]-instance FromJSON (PackageEntry, [JSONWarning]) where+instance FromJSON (WithJSONWarnings PackageEntry) where parseJSON (String t) = do- (loc, _::[JSONWarning]) <- parseJSON $ String t- return (PackageEntry+ WithJSONWarnings loc _ <- parseJSON $ String t+ return $ noJSONWarnings+ (PackageEntry { peExtraDepMaybe = Nothing , peValidWanted = Nothing , peLocation = loc , peSubdirs = []- }, [])+ }) parseJSON v = withObjectWarnings "PackageEntry" (\o -> PackageEntry <$> o ..:? "extra-dep" <*> o ..:? "valid-wanted"@@ -587,9 +588,9 @@ toJSON (PLRemote x (RPTGit y)) = toJSON $ T.unwords ["git", x, y] toJSON (PLRemote x (RPTHg y)) = toJSON $ T.unwords ["hg", x, y] -instance FromJSON (PackageLocation, [JSONWarning]) where+instance FromJSON (WithJSONWarnings PackageLocation) where parseJSON v- = ((,[]) <$> withText "PackageLocation" (\t -> http t <|> file t) v)+ = (noJSONWarnings <$> withText "PackageLocation" (\t -> http t <|> file t) v) <|> git v <|> hg v where@@ -660,13 +661,13 @@ , "location" .= location ] toJSON x = toJSON $ resolverName x-instance FromJSON (Resolver,[JSONWarning]) where+instance FromJSON (WithJSONWarnings Resolver) where -- Strange structuring is to give consistent error messages parseJSON v@(Object _) = withObjectWarnings "Resolver" (\o -> ResolverCustom <$> o ..: "name" <*> o ..: "location") v - parseJSON (String t) = either (fail . show) return ((,[]) <$> parseResolverText t)+ parseJSON (String t) = either (fail . show) return (noJSONWarnings <$> parseResolverText t) parseJSON _ = fail $ "Invalid Resolver, must be Object or String" @@ -893,7 +894,7 @@ , configMonoidAllowDifferentUser = configMonoidAllowDifferentUser l <|> configMonoidAllowDifferentUser r } -instance FromJSON (ConfigMonoid, [JSONWarning]) where+instance FromJSON (WithJSONWarnings ConfigMonoid) where parseJSON = withObjectWarnings "ConfigMonoid" parseConfigMonoidJSON -- | Parse a partial configuration. Used both to parse both a standalone config@@ -1411,7 +1412,7 @@ data ProjectAndConfigMonoid = ProjectAndConfigMonoid !Project !ConfigMonoid -instance (warnings ~ [JSONWarning]) => FromJSON (ProjectAndConfigMonoid, warnings) where+instance FromJSON (WithJSONWarnings ProjectAndConfigMonoid) where parseJSON = withObjectWarnings "ProjectAndConfigMonoid" $ \o -> do dirs <- jsonSubWarningsTT (o ..:? "packages") ..!= [packageEntryCurrDir] extraDeps' <- o ..:? "extra-deps" ..!= []@@ -1535,7 +1536,7 @@ , downloadInfoSha1 :: Maybe ByteString } deriving (Show) -instance FromJSON (DownloadInfo, [JSONWarning]) where+instance FromJSON (WithJSONWarnings DownloadInfo) where parseJSON = withObjectWarnings "DownloadInfo" parseDownloadInfoFromObject -- | Parse JSON in existing object for 'DownloadInfo'@@ -1557,7 +1558,7 @@ } deriving Show -instance FromJSON (VersionedDownloadInfo, [JSONWarning]) where+instance FromJSON (WithJSONWarnings VersionedDownloadInfo) where parseJSON = withObjectWarnings "VersionedDownloadInfo" $ \o -> do version <- o ..: "version" downloadInfo <- parseDownloadInfoFromObject o@@ -1576,7 +1577,7 @@ } deriving Show -instance FromJSON (SetupInfo, [JSONWarning]) where+instance FromJSON (WithJSONWarnings SetupInfo) where parseJSON = withObjectWarnings "SetupInfo" $ \o -> do siSevenzExe <- jsonSubWarningsT (o ..:? "sevenzexe-info") siSevenzDll <- jsonSubWarningsT (o ..:? "sevenzdll-info")@@ -1613,15 +1614,15 @@ | SetupInfoInline SetupInfo deriving (Show) -instance FromJSON (SetupInfoLocation, [JSONWarning]) where+instance FromJSON (WithJSONWarnings SetupInfoLocation) where parseJSON v =- ((, []) <$>+ (noJSONWarnings <$> withText "SetupInfoFileOrURL" (pure . SetupInfoFileOrURL . T.unpack) v) <|> inline where inline = do- (si,w) <- parseJSON v- return (SetupInfoInline si, w)+ WithJSONWarnings si w <- parseJSON v+ return $ WithJSONWarnings (SetupInfoInline si) w -- | How PVP bounds should be added to .cabal files data PvpBounds
src/Stack/Types/Docker.hs view
@@ -98,7 +98,7 @@ deriving (Show) -- | Decode uninterpreted docker options from JSON/YAML.-instance FromJSON (DockerOptsMonoid, [JSONWarning]) where+instance FromJSON (WithJSONWarnings DockerOptsMonoid) where parseJSON = withObjectWarnings "DockerOptsMonoid" (\o -> do dockerMonoidDefaultEnable <- pure True dockerMonoidEnable <- o ..:? dockerEnableArgName
src/Stack/Types/Image.hs view
@@ -39,7 +39,7 @@ { imgMonoidDockers :: ![ImageDockerOpts] } deriving (Show) -instance FromJSON (ImageOptsMonoid, [JSONWarning]) where+instance FromJSON (WithJSONWarnings ImageOptsMonoid) where parseJSON = withObjectWarnings "ImageOptsMonoid" (\o ->@@ -59,7 +59,7 @@ { imgMonoidDockers = imgMonoidDockers l <> imgMonoidDockers r } -instance FromJSON (ImageDockerOpts, [JSONWarning]) where+instance FromJSON (WithJSONWarnings ImageDockerOpts) where parseJSON = withObjectWarnings "ImageDockerOpts" (\o ->
src/Stack/Types/Nix.hs view
@@ -52,7 +52,7 @@ deriving (Eq, Show) -- | Decode uninterpreted nix options from JSON/YAML.-instance FromJSON (NixOptsMonoid, [JSONWarning]) where+instance FromJSON (WithJSONWarnings NixOptsMonoid) where parseJSON = withObjectWarnings "NixOptsMonoid" (\o -> do nixMonoidDefaultEnable <- pure True nixMonoidEnable <- o ..:? nixEnableArgName
stack.cabal view
@@ -1,5 +1,5 @@ name: stack-version: 1.0.4+version: 1.0.4.1 cabal-version: >=1.10 build-type: Simple license: BSD3@@ -250,7 +250,7 @@ optparse-applicative >=0.11.0.2 && <0.13, path >=0.5.3 && <0.6, path-io >=0.3.1 && <0.4,- stack >=1.0.4 && <1.1,+ stack >=1.0.4.1 && <1.1, text >=1.2.0.4 && <1.3, transformers >=0.4.2.0 && <0.5 default-language: Haskell2010@@ -280,7 +280,7 @@ path-io >=0.3.1 && <0.4, resourcet >=1.1.7 && <1.2, retry >=0.6 && <0.8,- stack >=1.0.4 && <1.1,+ stack >=1.0.4.1 && <1.1, temporary >=1.2.0.4 && <1.3, text >=1.2.2.0 && <1.3, transformers >=0.4.2.0 && <0.5