From 982bcfa2ad233e41e82b4d1319e280623b14a99c Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 26 Dec 2014 13:43:44 +0200 Subject: [PATCH 001/208] WIP new upload --- ChangeLog.md | 4 + Stackage/PerformBuild.hs | 10 --- Stackage/Prelude.hs | 13 +++ Stackage/ServerBundle.hs | 173 +++++++++++++++++++++++++++++++++++++-- Stackage/Upload.hs | 129 +++++++++++++---------------- stackage.cabal | 3 +- 6 files changed, 243 insertions(+), 89 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 2a524e11..37704fa8 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ +## 0.4.0 + +* Upload bundle V2 stuff + ## 0.3.1 * Added `justCheck` and `stackage check` command line. diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index 31602d55..5299f34e 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -412,16 +412,6 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} = renameOrCopy :: FilePath -> FilePath -> IO () renameOrCopy src dest = rename src dest `catchIO` \_ -> copyDir src dest -copyDir :: FilePath -> FilePath -> IO () -copyDir src dest = - runResourceT $ sourceDirectoryDeep False src $$ mapM_C go - where - src' = src "" - go fp = forM_ (F.stripPrefix src' fp) $ \suffix -> do - let dest' = dest suffix - liftIO $ createTree $ parent dest' - sourceFile fp $$ (sinkFile dest' :: Sink ByteString (ResourceT IO) ()) - copyBuiltInHaddocks :: FilePath -> IO () copyBuiltInHaddocks docdir = do mghc <- findExecutable "ghc" diff --git a/Stackage/Prelude.hs b/Stackage/Prelude.hs index ab2187fc..28fff061 100644 --- a/Stackage/Prelude.hs +++ b/Stackage/Prelude.hs @@ -20,6 +20,9 @@ import Distribution.Version as X (Version (..), VersionRange) import Distribution.Version as X (withinRange) import qualified Distribution.Version as C +import Filesystem (createTree) +import Filesystem.Path (parent) +import qualified Filesystem.Path as F unPackageName :: PackageName -> Text unPackageName (PackageName str) = pack str @@ -101,3 +104,13 @@ topologicalSort toFinal toDeps = data TopologicalSortException key = NoEmptyDeps (Map key (Set key)) deriving (Show, Typeable) instance (Show key, Typeable key) => Exception (TopologicalSortException key) + +copyDir :: FilePath -> FilePath -> IO () +copyDir src dest = + runResourceT $ sourceDirectoryDeep False src $$ mapM_C go + where + src' = src "" + go fp = forM_ (F.stripPrefix src' fp) $ \suffix -> do + let dest' = dest suffix + liftIO $ createTree $ parent dest' + sourceFile fp $$ (sinkFile dest' :: Sink ByteString (ResourceT IO) ()) diff --git a/Stackage/ServerBundle.hs b/Stackage/ServerBundle.hs index 6cdf5cb4..5aedb090 100644 --- a/Stackage/ServerBundle.hs +++ b/Stackage/ServerBundle.hs @@ -7,21 +7,31 @@ module Stackage.ServerBundle , epochTime , bpAllPackages , docsListing + , createBundleV2 + , CreateBundleV2 (..) + , SnapshotType (..) + , writeIndexStyle + , DocMap + , PackageDocs (..) ) where import qualified Codec.Archive.Tar as Tar import qualified Codec.Archive.Tar.Entry as Tar import qualified Codec.Compression.GZip as GZip import qualified Data.Map as M +import Data.Aeson (ToJSON (..), (.=), object, FromJSON (..), (.:), withObject) +import System.IO.Temp (withTempDirectory) import qualified Data.Yaml as Y -import Filesystem (isFile) +import Filesystem (isFile, getWorkingDirectory, listDirectory, isDirectory, canonicalizePath) import Foreign.C.Types (CTime (CTime)) import Stackage.BuildConstraints import Stackage.BuildPlan import Stackage.Prelude +import System.IO.Temp (withTempDirectory) import qualified System.PosixCompat.Time as PC import qualified Text.XML as X import Text.XML.Cursor +import System.PosixCompat.Files (createSymbolicLink) -- | Get current time epochTime :: IO Tar.EpochTime @@ -73,13 +83,30 @@ serverBundle time title slug bp@BuildPlan {..} = GZip.compress $ Tar.write map (\(PackageName name) -> name) (M.keys $ siCorePackages bpSystemInfo) +-- | Package name is key +type DocMap = Map Text PackageDocs +data PackageDocs = PackageDocs + { pdVersion :: Text + , pdModules :: Map Text [Text] + -- ^ module name, path + } +instance ToJSON PackageDocs where + toJSON PackageDocs {..} = object + [ "version" .= pdVersion + , "modules" .= pdModules + ] +instance FromJSON PackageDocs where + parseJSON = withObject "PackageDocs" $ \o -> PackageDocs + <$> o .: "version" + <*> o .: "modules" + docsListing :: BuildPlan -> FilePath -- ^ docs directory - -> IO ByteString + -> IO DocMap docsListing bp docsDir = - fmap (Y.encode . fold) $ mapM go $ mapToList $ bpAllPackages bp + fmap fold $ mapM go $ mapToList $ bpAllPackages bp where - go :: (PackageName, Version) -> IO (Map Text Y.Value) + go :: (PackageName, Version) -> IO DocMap go (package, version) = do -- handleAny (const $ return mempty) $ do let dirname = fpFromText (concat [ display package @@ -107,8 +134,138 @@ docsListing bp docsDir = return $ if e then asMap $ singletonMap name [fpToText dirname, href] else mempty - return $ singletonMap (display package) $ Y.object - [ "version" Y..= display version - , "modules" Y..= m - ] + return $ singletonMap (display package) $ PackageDocs + { pdVersion = display version + , pdModules = m + } else return mempty + +data SnapshotType = STNightly + | STLTS !Int !Int -- ^ major, minor + deriving (Show, Read, Eq, Ord) + +instance ToJSON SnapshotType where + toJSON STNightly = object + [ "type" .= asText "nightly" + ] + toJSON (STLTS major minor) = object + [ "type" .= asText "lts" + , "major" .= major + , "minor" .= minor + ] +instance FromJSON SnapshotType where + parseJSON = withObject "SnapshotType" $ \o -> do + t <- o .: "type" + case asText t of + "nightly" -> return STNightly + "lts" -> STLTS + <$> o .: "major" + <*> o .: "minor" + _ -> fail $ "Unknown type for SnapshotType: " ++ unpack t + +data CreateBundleV2 = CreateBundleV2 + { cb2Plan :: BuildPlan + , cb2Type :: SnapshotType + , cb2DocsDir :: FilePath + , cb2Dest :: FilePath + } + +-- | Create a V2 bundle, which contains the build plan, metadata, docs, and doc +-- map. +createBundleV2 :: CreateBundleV2 -> IO () +createBundleV2 CreateBundleV2 {..} = do + docsDir <- canonicalizePath cb2DocsDir + docMap <- docsListing cb2Plan cb2DocsDir + + Y.encodeFile (fpToString $ docsDir "build-plan.yaml") cb2Plan + Y.encodeFile (fpToString $ docsDir "build-type.yaml") cb2Type + Y.encodeFile (fpToString $ docsDir "docs-map.yaml") docMap + void $ writeIndexStyle Nothing cb2DocsDir + + currentDir <- getWorkingDirectory + files <- listDirectory docsDir + + let args = "cfJ" + : fpToString (currentDir cb2Dest) + : "--dereference" + : map (fpToString . filename) files + cp = (proc "tar" args) { cwd = Just $ fpToString docsDir } + withCheckedProcess cp $ \ClosedStream Inherited Inherited -> return () + +writeIndexStyle :: Maybe Text -- ^ snapshot id + -> FilePath -- ^ docs dir + -> IO [String] +writeIndexStyle msnapid dir = do + dirs <- fmap sort + $ runResourceT + $ sourceDirectory dir + $$ filterMC (liftIO . isDirectory) + =$ mapC (fpToString . filename) + =$ sinkList + writeFile (dir "index.html") $ mkIndex + (unpack <$> msnapid) + dirs + writeFile (dir "style.css") styleCss + return dirs + +mkIndex :: Maybe String -> [String] -> String +mkIndex msnapid dirs = concat + [ "\nHaddocks index" + , "" + , "" + , "" + , "" + , "
" + , "
" + , "

Haddock documentation index

" + , flip foldMap msnapid $ \snapid -> concat + [ "

Return to snapshot

" + ] + , "
    " + , concatMap toLI dirs + , "
" + ] + where + toLI name = concat + [ "
  • " + , name + , "
  • " + ] + +styleCss :: String +styleCss = concat + [ "@media (min-width: 530px) {" + , "ul { -webkit-column-count: 2; -moz-column-count: 2; column-count: 2 }" + , "}" + , "@media (min-width: 760px) {" + , "ul { -webkit-column-count: 3; -moz-column-count: 3; column-count: 3 }" + , "}" + , "ul {" + , " margin-left: 0;" + , " padding-left: 0;" + , " list-style-type: none;" + , "}" + , "body {" + , " background: #f0f0f0;" + , " font-family: 'Lato', sans-serif;" + , " text-shadow: 1px 1px 1px #ffffff;" + , " font-size: 20px;" + , " line-height: 30px;" + , " padding-bottom: 5em;" + , "}" + , "h1 {" + , " font-weight: normal;" + , " color: #06537d;" + , " font-size: 45px;" + , "}" + , ".return a {" + , " color: #06537d;" + , " font-style: italic;" + , "}" + , ".return {" + , " margin-bottom: 1em;" + , "}"] diff --git a/Stackage/Upload.hs b/Stackage/Upload.hs index bb1c8246..bea1c289 100644 --- a/Stackage/Upload.hs +++ b/Stackage/Upload.hs @@ -13,17 +13,23 @@ module Stackage.Upload , uploadHackageDistro , UploadDocMap (..) , uploadDocMap + , uploadBundleV2 + , UploadBundleV2 (..) ) where import Control.Monad.Writer.Strict (execWriter, tell) import Data.Default.Class (Default (..)) +import Data.Function (fix) import Filesystem (isDirectory, isFile) import Network.HTTP.Client +import qualified Network.HTTP.Client.Conduit as HCC import Network.HTTP.Client.MultipartFormData import Stackage.BuildPlan (BuildPlan) import Stackage.Prelude -import Stackage.ServerBundle (bpAllPackages, docsListing) +import Stackage.ServerBundle (bpAllPackages, docsListing, writeIndexStyle) import System.IO.Temp (withSystemTempFile) +import qualified System.IO as IO +import qualified Data.Yaml as Y newtype StackageServer = StackageServer { unStackageServer :: Text } deriving (Show, Eq, Ord, Hashable, IsString) @@ -106,17 +112,7 @@ uploadDocs (UploadDocs (StackageServer host) fp0 token ident) man = do where uploadDocsDir = withSystemTempFile "haddocks.tar.xz" $ \fp h -> do hClose h - dirs <- fmap sort - $ runResourceT - $ sourceDirectory fp0 - $$ filterMC (liftIO . isDirectory) - =$ mapC (fpToString . filename) - =$ sinkList - writeFile (fp0 "index.html") $ mkIndex - (unpack $ unSnapshotIdent ident) - dirs - writeFile (fp0 "style.css") styleCss - -- FIXME write index.html, style.css + dirs <- writeIndexStyle (Just $ unSnapshotIdent ident) fp0 let cp = (proc "tar" $ "cJf" : fp : "index.html" : "style.css" : dirs) { cwd = Just $ fpToString fp0 } @@ -187,7 +183,7 @@ uploadDocMap :: UploadDocMap -> Manager -> IO (Response LByteString) uploadDocMap UploadDocMap {..} man = do docmap <- docsListing udmPlan udmDocDir req1 <- parseUrl $ unpack $ unStackageServer udmServer ++ "/upload-doc-map" - req2 <- formDataBody (formData docmap) req1 + req2 <- formDataBody (formData $ Y.encode docmap) req1 let req3 = req2 { method = "PUT" , requestHeaders = @@ -205,61 +201,54 @@ uploadDocMap UploadDocMap {..} man = do , partFileRequestBody "docmap" "docmap" $ RequestBodyBS docmap ] -mkIndex :: String -> [String] -> String -mkIndex snapid dirs = concat - [ "\nHaddocks index" - , "" - , "" - , "" - , "" - , "
    " - , "
    " - , "

    Haddock documentation index

    " - , "

    Return to snapshot

      " - , concatMap toLI dirs - , "
    " - ] - where - toLI name = concat - [ "
  • " - , name - , "
  • " - ] +data UploadBundleV2 = UploadBundleV2 + { ub2Server :: StackageServer + , ub2AuthToken :: Text + , ub2Bundle :: FilePath + } -styleCss :: String -styleCss = concat - [ "@media (min-width: 530px) {" - , "ul { -webkit-column-count: 2; -moz-column-count: 2; column-count: 2 }" - , "}" - , "@media (min-width: 760px) {" - , "ul { -webkit-column-count: 3; -moz-column-count: 3; column-count: 3 }" - , "}" - , "ul {" - , " margin-left: 0;" - , " padding-left: 0;" - , " list-style-type: none;" - , "}" - , "body {" - , " background: #f0f0f0;" - , " font-family: 'Lato', sans-serif;" - , " text-shadow: 1px 1px 1px #ffffff;" - , " font-size: 20px;" - , " line-height: 30px;" - , " padding-bottom: 5em;" - , "}" - , "h1 {" - , " font-weight: normal;" - , " color: #06537d;" - , " font-size: 45px;" - , "}" - , ".return a {" - , " color: #06537d;" - , " font-style: italic;" - , "}" - , ".return {" - , " margin-bottom: 1em;" - , "}"] +uploadBundleV2 :: UploadBundleV2 -> Manager -> IO Text +uploadBundleV2 UploadBundleV2 {..} man = IO.withBinaryFile (fpToString ub2Bundle) IO.ReadMode $ \h -> do + size <- IO.hFileSize h + req1 <- parseUrl $ unpack $ unStackageServer ub2Server ++ "/upload2" + let req2 = req1 + { method = "PUT" + , requestHeaders = + [ ("Authorization", encodeUtf8 ub2AuthToken) + , ("Accept", "application/json") + , ("Content-Type", "application/x-tar") + ] + , requestBody = HCC.requestBodySource (fromIntegral size) + $ sourceHandle h $= printProgress size + } + sink = decodeUtf8C =$ fix (\loop -> do + mx <- peekC + case mx of + Nothing -> error $ "uploadBundleV2: premature end of stream" + Just _ -> do + l <- lineC $ takeCE 4096 =$ foldC + let (cmd, msg') = break (== ':') l + msg = dropWhile (== ' ') $ dropWhile (== ':') msg' + case cmd of + "CONT" -> do + putStrLn msg + loop + "FAILURE" -> error $ "uploadBundleV2 failed: " ++ unpack msg + "SUCCESS" -> return msg + _ -> error $ "uploadBundleV2: unknown command " ++ unpack cmd + ) + withResponse req2 man $ \res -> HCC.bodyReaderSource (responseBody res) $$ sink + where + printProgress total = + loop 0 0 + where + loop sent lastPercent = + await >>= maybe (putStrLn "Upload complete") go + where + go bs = do + yield bs + let sent' = sent + fromIntegral (length bs) + percent = sent' * 100 `div` total + when (percent /= lastPercent) + $ putStrLn $ "Upload progress: " ++ tshow percent ++ "%" + loop sent' percent diff --git a/stackage.cabal b/stackage.cabal index 842cdbd7..d9e2a06d 100644 --- a/stackage.cabal +++ b/stackage.cabal @@ -1,5 +1,5 @@ name: stackage -version: 0.3.1 +version: 0.4.0 synopsis: "Stable Hackage," tools for creating a vetted set of packages from Hackage. description: Please see for a description and documentation. homepage: https://github.com/fpco/stackage @@ -52,6 +52,7 @@ library , yaml , unix-compat , http-client + , http-conduit , http-client-tls , temporary , data-default-class From 4d57914e7cb865f01830bc95c9e8c40fc169e00a Mon Sep 17 00:00:00 2001 From: Renzo Carbonara Date: Thu, 8 Jan 2015 11:56:12 -0300 Subject: [PATCH 002/208] Add packages: network-simple, pipes-aeson, pipes-attoparsec, pipes-binary, pipes-network --- build-constraints.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 3b0a1d0e..f14b3a00 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -655,6 +655,13 @@ packages: - machines-io - machines-process + "Renzo Carbonara renzocarbonara@gmail.com @k0001": + - network-simple + - pipes-aeson + - pipes-attoparsec + - pipes-binary + - pipes-network + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From 347a6d18433a907b49fa94b29fc9bf32bb01da1e Mon Sep 17 00:00:00 2001 From: Omari Norman Date: Sat, 17 Jan 2015 22:22:20 -0500 Subject: [PATCH 003/208] add multiarg, prednote, cartel; remove rainbow-tests --- build-constraints.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 08077dab..253b3c79 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -121,8 +121,10 @@ packages: "Omari Norman ": - barecheck - rainbow - - rainbow-tests - quickpull + - multiarg + - prednote + - cartel "Neil Mitchell": - hlint From bf0d7efbcab29049f410d5096482fd532158027a Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 19 Jan 2015 06:03:34 +0200 Subject: [PATCH 004/208] Upper bounds for #421 --- build-constraints.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 08077dab..1070803e 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -121,7 +121,8 @@ packages: "Omari Norman ": - barecheck - rainbow - - rainbow-tests + # https://github.com/fpco/stackage/issues/421 + #- rainbow-tests - quickpull "Neil Mitchell": From 8833ca229a4caac550c61c3f44d2b41d8bd10246 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 19 Jan 2015 07:34:37 +0200 Subject: [PATCH 005/208] Revert "Upper bounds for #421" Addressed by PR #420. Closes #421 This reverts commit bf0d7efbcab29049f410d5096482fd532158027a. --- build-constraints.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 1070803e..08077dab 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -121,8 +121,7 @@ packages: "Omari Norman ": - barecheck - rainbow - # https://github.com/fpco/stackage/issues/421 - #- rainbow-tests + - rainbow-tests - quickpull "Neil Mitchell": From b90506c78680f49df407100792cbb018a782ca00 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Mon, 19 Jan 2015 10:50:07 +0100 Subject: [PATCH 006/208] Add tttool --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 253b3c79..0eae9493 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -456,6 +456,7 @@ packages: - circle-packing - arbtt - ghc-heap-view + - tttool "Aditya Bhargava Date: Mon, 19 Jan 2015 11:47:55 +0100 Subject: [PATCH 007/208] Add old-locale flag for tttool (#422) --- build-constraints.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 0eae9493..f80f81a1 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -749,6 +749,8 @@ package-flags: # GHC 7.10 remove aeson: old-locale: true + tttool: + old-locale: true hxt: network-uri: true From 041f21621a6e41af291e52e4e04269703ec92aa4 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Mon, 19 Jan 2015 23:51:59 +0100 Subject: [PATCH 008/208] Add gipeda --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index f80f81a1..c46eba24 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -457,6 +457,7 @@ packages: - arbtt - ghc-heap-view - tttool + - gipeda "Aditya Bhargava Date: Wed, 21 Jan 2015 04:10:18 +0200 Subject: [PATCH 009/208] More upper bounds for #389 --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index c46eba24..5f0d7bf3 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -691,6 +691,7 @@ packages: # https://github.com/fpco/stackage/issues/389 - lens < 4.7 + - hsdev < 0.1.3.3 # https://github.com/fpco/stackage/issues/390 # NOTE: When this issue is resolved, remove the expected test failure From 06563467b87a503ac2275c541b1d3ef0bb62abd6 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 22 Jan 2015 15:16:28 +0200 Subject: [PATCH 010/208] Upper bound for #424 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 5f0d7bf3..ade038c0 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -719,6 +719,9 @@ packages: # https://github.com/fpco/stackage/issues/415 - hackage-db < 1.12 + # https://github.com/fpco/stackage/issues/424 + - control-monad-free < 0.6 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From f5bbf9e547866a3fa409bb82276b86ea28cb330c Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 22 Jan 2015 15:45:42 +0200 Subject: [PATCH 011/208] Temporarily skip tests jgm/zip-archive#23 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index ade038c0..c377310b 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -819,6 +819,9 @@ skipped-tests: # https://github.com/Soostone/retry/issues/18 - retry + # https://github.com/jgm/zip-archive/issues/23 + - zip-archive + # Tests which we should build and run, but which are expected to fail. We # should not fail a build based on a test failure for one of these packages. expected-test-failures: From b4586e991e5ebf294a94d7c04a877357ec71d86d Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 23 Jan 2015 00:09:10 +0200 Subject: [PATCH 012/208] Don't die due to missing tool jgm/zip-archive#23 --- Stackage/PerformBuild.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index 58821125..c74b449a 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -88,7 +88,9 @@ waitForDeps toolMap packageMap activeComps bp pi action = do case lookup exe toolMap >>= fromNullable . map checkPackage . setToList of Nothing | isCoreExe exe -> return () - | otherwise -> throwSTM $ ToolMissing exe + -- https://github.com/jgm/zip-archive/issues/23 + -- | otherwise -> throwSTM $ ToolMissing exe + | otherwise -> return () Just packages -> ofoldl1' (<|>) packages action where From d580bfca5f22d7920ccb124ea71f8e9e0ff5377c Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 23 Jan 2015 00:09:45 +0200 Subject: [PATCH 013/208] Remove skipped test jgm/zip-archive#23 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index c377310b..ade038c0 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -819,9 +819,6 @@ skipped-tests: # https://github.com/Soostone/retry/issues/18 - retry - # https://github.com/jgm/zip-archive/issues/23 - - zip-archive - # Tests which we should build and run, but which are expected to fail. We # should not fail a build based on a test failure for one of these packages. expected-test-failures: From 4e9c9d1ffa428e6f060cde9fc86dd771912b5da5 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 25 Jan 2015 14:32:06 +0200 Subject: [PATCH 014/208] Upper bound for #426 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index ade038c0..f7496850 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -722,6 +722,9 @@ packages: # https://github.com/fpco/stackage/issues/424 - control-monad-free < 0.6 + # https://github.com/fpco/stackage/issues/426 + - utf8-string < 1 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 6e7f19624d1abb20c26b5a3008146200411496db Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 27 Jan 2015 15:20:35 +0200 Subject: [PATCH 015/208] Turn off old-time flag for tar --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index f7496850..815c5972 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -773,6 +773,9 @@ package-flags: text: integer-simple: false + tar: + old-time: false + # By skipping a test suite, we do not pull in the build dependencies skipped-tests: - ReadArgs # old version of hspec From c48d50b851c54a612f3704f525a8b50fff7c881f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 27 Jan 2015 15:24:19 +0200 Subject: [PATCH 016/208] Remove expected failure --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 815c5972..52f12682 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -972,9 +972,6 @@ expected-test-failures: # https://github.com/bos/wreq/issues/53 - wreq - # https://github.com/vincenthz/tasty-kat/issues/1 - - tasty-kat - # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From d75573dfbacd4228414f08d26fe1e9de9d506228 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 27 Jan 2015 20:13:59 +0200 Subject: [PATCH 017/208] Expected test failure ndmitchell/hoogle#96 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 52f12682..1658197e 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -972,6 +972,9 @@ expected-test-failures: # https://github.com/bos/wreq/issues/53 - wreq + # https://github.com/ndmitchell/hoogle/issues/96 + - hoogle + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 6ade0e650b175dc8821f8007dc3e2946438995a7 Mon Sep 17 00:00:00 2001 From: Emanuel Borsboom Date: Thu, 29 Jan 2015 04:13:36 -0800 Subject: [PATCH 018/208] Add ghc-heap-view to skipped-profiling --- build-constraints.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 1658197e..a0827469 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1012,7 +1012,9 @@ skipped-benchmarks: # sometimes falls out-of-sync on hasql-postgres - hasql -skipped-profiling: [] +skipped-profiling: + # https://github.com/nomeata/ghc-heap-view/commit/8d198eb8fbbad2ce0c4527c781659f35b8909c04#diff-8288955e209cfbead5b318a8598be9c0R10 + - ghc-heap-view # Mapping from Github account holding a package to the Github users who should # be pinged on failure. If no value is specified here, then the owning account From 462c0d0ce5918e3ee5de0836aade7bbb251b3434 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 29 Jan 2015 17:41:05 +0200 Subject: [PATCH 019/208] Remove ChasingBottoms constraints --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 1658197e..4eb1f4c3 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -713,9 +713,6 @@ packages: # https://github.com/fpco/stackage/issues/410 - elm-package < 0.4 - # https://github.com/fpco/lts-haskell/issues/5 - - ChasingBottoms < 1.3.0.10 || > 1.3.0.10 - # https://github.com/fpco/stackage/issues/415 - hackage-db < 1.12 From 13c020a72a57925ebc0d3af991cd4cc36af38cea Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 29 Jan 2015 17:41:14 +0200 Subject: [PATCH 020/208] Extra #426 constraint --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 4eb1f4c3..b561b922 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -721,6 +721,7 @@ packages: # https://github.com/fpco/stackage/issues/426 - utf8-string < 1 + - language-javascript < 0.5.13.1 # Package flags are applied to individual packages, and override the values of # global-flags From 011c5f01ed4d922d88739e12e0e591c04d0ad4ef Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 29 Jan 2015 18:11:59 +0200 Subject: [PATCH 021/208] Remove expected hoogle failure --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 58ef57e4..52775e5e 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -977,9 +977,6 @@ expected-test-failures: # https://github.com/bos/wreq/issues/53 - wreq - # https://github.com/ndmitchell/hoogle/issues/96 - - hoogle - # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 003db2f02b160331fe421a8f1c8fb08346b30481 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 29 Jan 2015 18:25:16 +0200 Subject: [PATCH 022/208] Remove dupe --- build-constraints.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index c7b1c330..c9bcfbdb 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -183,7 +183,6 @@ packages: - crypto-random-api - hit - language-java - - language-java - libgit - pem - siphash From 3b863ccf7c11cc835805e92ebe938505617fd744 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 29 Jan 2015 18:25:25 +0200 Subject: [PATCH 023/208] Remove unneeded constraint --- build-constraints.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index c9bcfbdb..a4075e4d 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -727,7 +727,6 @@ packages: # https://github.com/fpco/stackage/issues/426 - utf8-string < 1 - - language-javascript < 0.5.13.1 # Package flags are applied to individual packages, and override the values of # global-flags From f51b86e165f109930e462f110bc0155215824e47 Mon Sep 17 00:00:00 2001 From: Emanuel Borsboom Date: Thu, 29 Jan 2015 14:03:54 -0800 Subject: [PATCH 024/208] Add `install` subcommand. Used to install a Stackage snapshot from a build plan. --- Stackage/InstallBuild.hs | 96 ++++++++++++++++++++++++++++++++++++++++ app/stackage.hs | 67 ++++++++++++++++++++++++++-- stackage.cabal | 2 + 3 files changed, 161 insertions(+), 4 deletions(-) create mode 100644 Stackage/InstallBuild.hs diff --git a/Stackage/InstallBuild.hs b/Stackage/InstallBuild.hs new file mode 100644 index 00000000..abe8a14e --- /dev/null +++ b/Stackage/InstallBuild.hs @@ -0,0 +1,96 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE ScopedTypeVariables #-} +module Stackage.InstallBuild + ( InstallFlags (..) + , BuildPlanSource (..) + , installBuild + ) where + +import qualified Codec.Archive.Tar as Tar +import qualified Codec.Compression.GZip as GZip +import qualified Data.Yaml as Yaml +import Network.HTTP.Client +import Network.HTTP.Client.TLS (tlsManagerSettings) +import Stackage.BuildPlan +import Stackage.CheckBuildPlan +import Stackage.PerformBuild +import Stackage.Prelude +import System.IO (BufferMode (LineBuffering), hSetBuffering) + +-- | Flags passed in from the command line. +data InstallFlags = InstallFlags + { ifPlanSource :: !BuildPlanSource + , ifInstallDest :: !FilePath + , ifLogDir :: !(Maybe FilePath) + , ifJobs :: !Int + , ifGlobalInstall :: !Bool + , ifEnableTests :: !Bool + , ifEnableLibProfiling :: !Bool + , ifVerbose :: !Bool + , ifSkipCheck :: !Bool + } deriving (Show) + +-- | Source for build plan. +data BuildPlanSource = BPSBundleWeb String + | BPSFile FilePath + deriving (Show) + +getPerformBuild :: BuildPlan -> InstallFlags -> PerformBuild +getPerformBuild plan InstallFlags{..} = + PerformBuild + { pbPlan = plan + , pbInstallDest = ifInstallDest + , pbLogDir = fromMaybe (ifInstallDest "logs") ifLogDir + , pbLog = hPut stdout + , pbJobs = ifJobs + , pbGlobalInstall = ifGlobalInstall + , pbEnableTests = ifEnableTests + , pbEnableLibProfiling = ifEnableLibProfiling + , pbVerbose = ifVerbose + , pbAllowNewer = ifSkipCheck + } + +-- | Install stackage from an existing build plan. +installBuild :: InstallFlags -> IO () +installBuild installFlags@InstallFlags{..} = do + hSetBuffering stdout LineBuffering + + putStrLn $ "Loading build plan" + plan <- case ifPlanSource of + BPSBundleWeb url -> withManager tlsManagerSettings $ \man -> do + req <- parseUrl url + res <- httpLbs req man + planBSL <- getPlanEntry $ Tar.read $ GZip.decompress (responseBody res) + decodeBuildPlan planBSL + BPSFile path -> Yaml.decodeFileEither (fpToString path) >>= either throwM return + + if ifSkipCheck + then putStrLn "Skipping build plan check" + else do + putStrLn "Checking build plan" + checkBuildPlan plan + + putStrLn "Performing build" + performBuild (getPerformBuild plan installFlags) >>= mapM_ putStrLn + + where + getPlanEntry Tar.Done = throwIO NoBuildPlanException + getPlanEntry (Tar.Fail e) = throwIO e + getPlanEntry (Tar.Next entry entries) + | Tar.entryPath entry == "build-plan.yaml" = + case Tar.entryContent entry of + Tar.NormalFile bs _ -> return bs + _ -> throwIO NoBuildPlanException + | otherwise = getPlanEntry entries + + decodeBuildPlan = + either throwIO return . Yaml.decodeEither' . toStrict + +data InstallBuildException = NoBuildPlanException + deriving (Typeable) +instance Exception InstallBuildException +instance Show InstallBuildException where + show NoBuildPlanException = "Bundle has missing or invalid build-plan.yaml" diff --git a/app/stackage.hs b/app/stackage.hs index 1f61496f..8fdd2833 100644 --- a/app/stackage.hs +++ b/app/stackage.hs @@ -7,8 +7,10 @@ import Data.Monoid import Data.String (fromString) import Data.Version import Options.Applicative +import Filesystem.Path.CurrentOS (decodeString) import Paths_stackage (version) import Stackage.CompleteBuild +import Stackage.InstallBuild main :: IO () main = @@ -25,9 +27,9 @@ main = help "Show this help text" versionOption = infoOption - ("fpbuild version " ++ showVersion version) + ("stackage version " ++ showVersion version) (long "version" <> - help "Show fpbuild version") + help "Show stackage version") config = subparser $ mconcat @@ -55,12 +57,19 @@ main = (const justCheck) (pure ()) "check" - "Just check that the build plan is ok"] + "Just check that the build plan is ok" + , cmnd + installBuild + installFlags + "install" + "Install a snapshot from an existing build plan"] + cmnd exec parse name desc = command name $ info - (fmap exec parse) + (fmap exec (parse <**> helpOption)) (progDesc desc) + buildFlags = BuildFlags <$> fmap @@ -86,3 +95,53 @@ main = nightlyUploadFlags = fromString <$> strArgument (metavar "DATE" <> help "Date, in YYYY-MM-DD format") + + installFlags = + InstallFlags <$> + (fmap + BPSBundleWeb + (strOption + (long "bundle" <> + metavar "URL" <> + help "Stackage bundle containing build plan")) <|> + fmap + (BPSFile . decodeString) + (strOption + (long "build-plan" <> + metavar "PATH" <> + help "Build-plan YAML file"))) <*> + fmap + decodeString + (strArgument + (metavar "DESTINATION-PATH" <> + help "Destination directory path")) <*> + (fmap + (Just . decodeString) + (strOption + (long "log-dir" <> + metavar "PATH" <> + help "Location of log files (default DESTINATION-PATH/logs)")) <|> + pure Nothing) <*> + option + auto + (long "jobs" <> + metavar "NUMBER" <> + showDefault <> value 8 <> + help "Number of threads") <*> + switch + (long "global" <> + help "Install in global package database") <*> + fmap + not + (switch + (long "skip-tests" <> + help "Skip build and running the test suites")) <*> + switch + (long "enable-library-profiling" <> + help "Enable profiling when building") <*> + switch + (long "verbose" <> short 'v' <> + help "Output verbose detail about the build steps") <*> + switch + (long "skip-check" <> + help "Skip the check phase, and pass --allow-newer to cabal configure") diff --git a/stackage.cabal b/stackage.cabal index c5e848e7..94b42da9 100644 --- a/stackage.cabal +++ b/stackage.cabal @@ -24,6 +24,7 @@ library Stackage.CheckBuildPlan Stackage.UpdateBuildPlan Stackage.GithubPings + Stackage.InstallBuild Stackage.PackageDescription Stackage.ServerBundle Stackage.Upload @@ -70,6 +71,7 @@ executable stackage build-depends: base , stackage , optparse-applicative >= 0.11 + , system-filepath ghc-options: -rtsopts -threaded -with-rtsopts=-N test-suite spec From 623926418a92b7fe6490eeb9640fb7f6cc6de7e4 Mon Sep 17 00:00:00 2001 From: Tomas Carnecky Date: Fri, 30 Jan 2015 13:48:11 +0000 Subject: [PATCH 025/208] Update build-constraints.yaml --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index c7b1c330..74885423 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -682,6 +682,9 @@ packages: - pipes-binary - pipes-network + "Tomas Carnecky": + - rethinkdb-client-driver + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From e8ae7d8b4c34078c4af59294d2b0f842b842235f Mon Sep 17 00:00:00 2001 From: Chris Done Date: Sun, 1 Feb 2015 16:06:47 +0100 Subject: [PATCH 026/208] Add upper bound on th-sugar @snoyberg this build plan checks out. --- build-constraints.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 74885423..0dca78c9 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -100,7 +100,10 @@ packages: - criterion - th-lift - singletons - - th-desugar + + # https://github.com/fpco/stackage/issues/433 + - th-desugar < 1.5 + - quickcheck-assertions - distributed-process-simplelocalnet From 6188c0c3bb4f68911c55e5bdba314e7ce2e151aa Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 2 Feb 2015 04:15:43 +0200 Subject: [PATCH 027/208] Haddock failure wereHamster/rethinkdb-client-driver#1 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 15d961a9..14f2be28 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -992,6 +992,9 @@ expected-haddock-failures: # https://github.com/leventov/yarr/issues/5 - yarr + # https://github.com/wereHamster/rethinkdb-client-driver/issues/1 + - rethinkdb-client-driver + # Benchmarks which should not be built. Note that Stackage does *not* generally # build benchmarks. The difference here will be whether dependencies for these # benchmarks are included or not. From 76f13a53bf72e6bc9da83dc99bc7930a4930132a Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 2 Feb 2015 04:25:48 +0200 Subject: [PATCH 028/208] Revert "Add upper bound on th-sugar" This reverts commit e8ae7d8b4c34078c4af59294d2b0f842b842235f. --- build-constraints.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 14f2be28..1d08d2d3 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -100,10 +100,7 @@ packages: - criterion - th-lift - singletons - - # https://github.com/fpco/stackage/issues/433 - - th-desugar < 1.5 - + - th-desugar - quickcheck-assertions - distributed-process-simplelocalnet From a6518d44464a1760c768c7f3711eaa7e216a2e20 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 2 Feb 2015 05:41:57 +0200 Subject: [PATCH 029/208] Expected test failure --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 1d08d2d3..74d4a007 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -978,6 +978,9 @@ expected-test-failures: # https://github.com/bos/wreq/issues/53 - wreq + # Requires local database running + - rethinkdb-client-driver + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From c8c499755af03ffa460c7af4468b2872d4aaa592 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 5 Feb 2015 07:12:59 +0200 Subject: [PATCH 030/208] Upper bound for d12frosted/CanonicalPath#3 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 74d4a007..4e6b9c81 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -731,6 +731,9 @@ packages: # https://github.com/fpco/stackage/issues/426 - utf8-string < 1 + # https://github.com/d12frosted/CanonicalPath/issues/3 + - system-canonicalpath < 0.3 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 67adda68ff4b04156658288084cf22f2cab72794 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 5 Feb 2015 20:56:22 +0200 Subject: [PATCH 031/208] Install fixed cabal-install (avoid test streaming bug) --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2a90db9b..4fb4f838 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,11 +16,11 @@ RUN rm /tmp/debian-bootstrap.sh RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cabal-install-1.20 ghc-7.8.4 -ENV PATH /opt/ghc/7.8.4/bin:/opt/cabal/1.20/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PATH /home/stackage/.cabal/bin:/opt/ghc/7.8.4/bin:/opt/cabal/1.20/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUN cabal update ADD . /tmp/stackage -RUN cd /tmp/stackage && cabal install . hscolour +RUN cd /tmp/stackage && cabal install . hscolour cabal-install --constraint "Cabal < 1.22" RUN cp $HOME/.cabal/bin/* /usr/local/bin RUN rm -rf $HOME/.cabal $HOME/.ghc /tmp/stackage From d1f366e133e0593dc66e2b9229719a74125f4caf Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 5 Feb 2015 22:14:52 +0200 Subject: [PATCH 032/208] Put /usr/local before /opt for custom cabal to take precedence --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4fb4f838..54580bda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN rm /tmp/debian-bootstrap.sh RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cabal-install-1.20 ghc-7.8.4 -ENV PATH /home/stackage/.cabal/bin:/opt/ghc/7.8.4/bin:/opt/cabal/1.20/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PATH /home/stackage/.cabal/bin:/usr/local/sbin:/usr/local/bin:/opt/ghc/7.8.4/bin:/opt/cabal/1.20/bin:/usr/sbin:/usr/bin:/sbin:/bin RUN cabal update ADD . /tmp/stackage From 8568f83fee2371c6b690b481048ea9196e385ab0 Mon Sep 17 00:00:00 2001 From: Alexandr Kurilin Date: Thu, 5 Feb 2015 12:35:39 -0800 Subject: [PATCH 033/208] Add bcrypt package --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 4e6b9c81..e942c32b 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -684,6 +684,9 @@ packages: "Tomas Carnecky": - rethinkdb-client-driver + "Alexandr Kurilin alex@kurilin.net @alex_kurilin": + - bcrypt + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From 308cc51aa133adca7f985a5cddf9161c3be4a40e Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 6 Feb 2015 00:07:17 +0200 Subject: [PATCH 034/208] Add .git to dockerignore --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index e09d9880..383463ca 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,3 +5,4 @@ logs cabal.sandbox.config tarballs *.yaml +.git From 8ac653efd73495ade2451af3e5ff4b5b8aa4e60f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 6 Feb 2015 00:15:18 +0200 Subject: [PATCH 035/208] Collapse some layers --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 54580bda..a83c42bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,8 +20,6 @@ ENV PATH /home/stackage/.cabal/bin:/usr/local/sbin:/usr/local/bin:/opt/ghc/7.8.4 RUN cabal update ADD . /tmp/stackage -RUN cd /tmp/stackage && cabal install . hscolour cabal-install --constraint "Cabal < 1.22" -RUN cp $HOME/.cabal/bin/* /usr/local/bin -RUN rm -rf $HOME/.cabal $HOME/.ghc /tmp/stackage +RUN cd /tmp/stackage && cabal install . hscolour cabal-install --constraint "Cabal < 1.22" && cp $HOME/.cabal/bin/* /usr/local/bin && rm -rf $HOME/.cabal $HOME/.ghc /tmp/stackage RUN cd /home/stackage && cabal update && stackage check From f78b47bc5f627e85b0cd0f1baf498c97f11ef896 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 9 Feb 2015 07:22:27 +0200 Subject: [PATCH 036/208] Expected test failure haskell-distributed/distributed-process-execution#2 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index e942c32b..92e7adb1 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -987,6 +987,9 @@ expected-test-failures: # Requires local database running - rethinkdb-client-driver + # https://github.com/haskell-distributed/distributed-process-execution/issues/2 + - distributed-process-execution + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 33cd4c0ec757dd15f3e445097089cd6eb3f7cb57 Mon Sep 17 00:00:00 2001 From: Jeffrey Rosenbluth Date: Mon, 9 Feb 2015 16:16:02 -0500 Subject: [PATCH 037/208] Update build-constraints.yaml --- build-constraints.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 92e7adb1..a5f8a5ea 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -686,6 +686,12 @@ packages: "Alexandr Kurilin alex@kurilin.net @alex_kurilin": - bcrypt + + "Jeffrey Rosenbluth jeffrey.rosenbluth@gmail.com": + - palette + - diagrams-canvas + - diagrams-rasterific + - lucid-svg "Stackage upper bounds": From 6ff05d185c3174b95de98c32b937ae3ac6781e55 Mon Sep 17 00:00:00 2001 From: Vincent Date: Tue, 10 Feb 2015 14:09:23 +0100 Subject: [PATCH 038/208] Adding rasterific-svg & svg-tree --- build-constraints.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 92e7adb1..1c748b64 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -332,6 +332,8 @@ packages: - JuicyPixels - FontyFruity - Rasterific + - svg-tree + - rasterific-svg "Patrick Brisbin": - gravatar From d601f51ea1147d1c8a448d9b897d09c236a28085 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 11 Feb 2015 07:09:47 +0200 Subject: [PATCH 039/208] Expected test failure jwiegley/gitlib#42 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 1c748b64..cb871e52 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -992,6 +992,9 @@ expected-test-failures: # https://github.com/haskell-distributed/distributed-process-execution/issues/2 - distributed-process-execution + # https://github.com/jwiegley/gitlib/issues/42 + - hlibgit2 + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 7228ab9eb208f74a00d762d2672f05161245e97f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 11 Feb 2015 08:27:03 +0200 Subject: [PATCH 040/208] Skip a test instead of expecting failure --- build-constraints.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 54cb43d6..1fd20945 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -845,6 +845,9 @@ skipped-tests: # https://github.com/Soostone/retry/issues/18 - retry + # https://github.com/jwiegley/gitlib/issues/42 + - hlibgit2 + # Tests which we should build and run, but which are expected to fail. We # should not fail a build based on a test failure for one of these packages. expected-test-failures: @@ -998,9 +1001,6 @@ expected-test-failures: # https://github.com/haskell-distributed/distributed-process-execution/issues/2 - distributed-process-execution - # https://github.com/jwiegley/gitlib/issues/42 - - hlibgit2 - # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 4dda9a078050106a4615a2fdd0396655d3f7dd1c Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 12 Feb 2015 06:45:43 +0200 Subject: [PATCH 041/208] Upper bound for #440 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 1fd20945..04ba737f 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -745,6 +745,9 @@ packages: # https://github.com/d12frosted/CanonicalPath/issues/3 - system-canonicalpath < 0.3 + # https://github.com/fpco/stackage/issues/440 + - th-orphans < 0.9 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From b357b5ab1445645f872d7ee0546ae98eedc107e4 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 12 Feb 2015 06:46:11 +0200 Subject: [PATCH 042/208] Flag fixes for mtl-compat --- build-constraints.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 04ba737f..7e1e13af 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -799,6 +799,10 @@ package-flags: tar: old-time: false + mtl-compat: + two-point-one: true + two-point-two: false + # By skipping a test suite, we do not pull in the build dependencies skipped-tests: - ReadArgs # old version of hspec From 26f0ec3674cb35a71bcae3d9b5bebff33dacd718 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 12 Feb 2015 15:13:12 +0200 Subject: [PATCH 043/208] Upper bound for #442 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 7e1e13af..33bd3b2e 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -748,6 +748,9 @@ packages: # https://github.com/fpco/stackage/issues/440 - th-orphans < 0.9 + # https://github.com/fpco/stackage/issues/442 + - blaze-builder < 0.4 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 96ff559f4815fd50e621ea5ef1329ad3311eb76a Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 12 Feb 2015 15:13:20 +0200 Subject: [PATCH 044/208] Upper bound for #443 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 33bd3b2e..ae747353 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -751,6 +751,9 @@ packages: # https://github.com/fpco/stackage/issues/442 - blaze-builder < 0.4 + # https://github.com/fpco/stackage/issues/443 + - exceptions < 0.7 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From d06aef22c9b8bc49cd3c0acef8d783fe86433aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabr=C3=ADel=20Arth=C3=BAr=20P=C3=A9tursson?= Date: Thu, 12 Feb 2015 13:36:28 +0000 Subject: [PATCH 045/208] Add sdl2 package Note that the package depends on sdl2 >= 2.0.3 via pkg-config. --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index ae747353..f3c773ee 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -695,6 +695,9 @@ packages: - diagrams-rasterific - lucid-svg + "Gabríel Arthúr Pétursson gabriel@system.is": + - sdl2 + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From e66b409ba29751b41a5380ab228768b15a3afa40 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 13 Feb 2015 07:42:58 +0200 Subject: [PATCH 046/208] Add sdl2 system packages Pinging @manny-fp --- debian-bootstrap.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian-bootstrap.sh b/debian-bootstrap.sh index 2e423c25..c069dcb1 100755 --- a/debian-bootstrap.sh +++ b/debian-bootstrap.sh @@ -12,6 +12,7 @@ add-apt-repository -y ppa:chris-lea/zeromq add-apt-repository -y ppa:floe/libtisch +add-apt-repository -y ppa:zoogie/sdl2-snapshots apt-get update apt-get install -y \ build-essential \ @@ -47,4 +48,5 @@ apt-get install -y \ libgd2-xpm-dev \ libyaml-dev \ liblzma-dev \ + libsdl2-dev \ libzmq3-dev From 8cb0cc928da8aceead0c70ec28827b4f2c92dae5 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 13 Feb 2015 07:44:17 +0200 Subject: [PATCH 047/208] Extra #440 upper bound --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index f3c773ee..e6ddaf71 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -750,6 +750,7 @@ packages: # https://github.com/fpco/stackage/issues/440 - th-orphans < 0.9 + - file-location < 0.4.7 # https://github.com/fpco/stackage/issues/442 - blaze-builder < 0.4 From 274eab8c3ea14e82114d71494e182f72428d883d Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 13 Feb 2015 08:45:25 +0200 Subject: [PATCH 048/208] Remove upper bounds and close #370 #401 In this process, I had to remove MusicBrainz. This could no longer be held off, as the old monad-control was causing problems elsewhere in the build. --- build-constraints.yaml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index e6ddaf71..45862f89 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -466,7 +466,9 @@ packages: "Clint Adams ": - hOpenPGP - openpgp-asciiarmor - - MusicBrainz + # Removed due to non-responsiveness on: + # https://github.com/fpco/stackage/issues/370 + # - MusicBrainz - DAV - hopenpgp-tools @@ -706,12 +708,6 @@ packages: # https://github.com/fpco/stackage/issues/291 - random < 1.0.1.3 - # https://github.com/fpco/stackage/issues/370 - - monad-control < 1 - - lifted-async < 0.3 - - scotty < 0.9.1 - - hoauth2 < 0.4.4 - # https://github.com/fpco/stackage/issues/389 - lens < 4.7 - hsdev < 0.1.3.3 @@ -724,9 +720,6 @@ packages: # https://github.com/fpco/stackage/issues/398 - monoid-subclasses < 0.4 - # https://github.com/fpco/stackage/issues/401 - - happstack-server < 7.4 - # https://github.com/fpco/stackage/issues/402 - vector-space < 0.9 From 9f3e6ce8e581a4db7004bcb65056c08a53f35e69 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 13 Feb 2015 08:52:00 +0200 Subject: [PATCH 049/208] Remove upper bounds and close #398 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 45862f89..6e11f220 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -717,9 +717,6 @@ packages: # for language-ecmascript as well. - language-ecmascript < 0.17 - # https://github.com/fpco/stackage/issues/398 - - monoid-subclasses < 0.4 - # https://github.com/fpco/stackage/issues/402 - vector-space < 0.9 From 48a2022c8f29488c5f5e79b38b57b2707a49bb83 Mon Sep 17 00:00:00 2001 From: Chris Done Date: Fri, 13 Feb 2015 09:54:18 +0100 Subject: [PATCH 050/208] Add hindent and descriptive --- build-constraints.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 6e11f220..0ffb130c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -209,8 +209,10 @@ packages: - scrobble - shell-conduit - sourcemap + - hindent + - descriptive # requires old haddock currently - haskell-docs - # TODO: Add hindent and structured-haskell-mode once they've been ported to HSE 1.16. + # TODO: Add structured-haskell-mode once they've been ported to HSE 1.16. # GHC 7.6 # "Alberto G. Corona ": @@ -690,7 +692,7 @@ packages: "Alexandr Kurilin alex@kurilin.net @alex_kurilin": - bcrypt - + "Jeffrey Rosenbluth jeffrey.rosenbluth@gmail.com": - palette - diagrams-canvas From 3b7c0593ed5d69aba5af3b992bd80dd8bba0306c Mon Sep 17 00:00:00 2001 From: Chris Done Date: Fri, 13 Feb 2015 09:58:47 +0100 Subject: [PATCH 051/208] Add wrap --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 0ffb130c..c339838d 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -211,6 +211,7 @@ packages: - sourcemap - hindent - descriptive + - wrap # requires old haddock currently - haskell-docs # TODO: Add structured-haskell-mode once they've been ported to HSE 1.16. From 7e25cf072c9b27659b169ece24b80de33bbbc9c7 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 15 Feb 2015 07:28:36 +0200 Subject: [PATCH 052/208] Upper bound for #445 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index c339838d..c2e644a6 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -751,6 +751,9 @@ packages: # https://github.com/fpco/stackage/issues/443 - exceptions < 0.7 + # https://github.com/fpco/stackage/issues/445 + - semigroupoids < 4.3 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From faf31a9f414abf9b37a932985bd7cbb670461b68 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 15 Feb 2015 07:28:56 +0200 Subject: [PATCH 053/208] Upper bound for #446 --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index c2e644a6..8efa29cf 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -707,6 +707,7 @@ packages: # Force a specific version that's compatible with transformers 0.3 - transformers-compat == 0.3.3.3 + - mtl-compat < 0.2 # https://github.com/fpco/stackage/issues/446 # https://github.com/fpco/stackage/issues/291 - random < 1.0.1.3 From d367361857aceaff0f99d7e47a9d868f9807a062 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 15 Feb 2015 14:59:00 +0200 Subject: [PATCH 054/208] Temporarily disable fpco-api --- build-constraints.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 8efa29cf..e9f42035 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -72,7 +72,7 @@ packages: - fixed-list - foreign-store - formatting - - fpco-api + #- fpco-api - gtk2hs-buildtools - happy - histogram-fill From 8b5b0db0170437dbf24231e97b2e0d4d3606c61c Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 15 Feb 2015 15:04:22 +0200 Subject: [PATCH 055/208] Add back MusicBrainz --- build-constraints.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index e9f42035..ddfd74f3 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -469,9 +469,7 @@ packages: "Clint Adams ": - hOpenPGP - openpgp-asciiarmor - # Removed due to non-responsiveness on: - # https://github.com/fpco/stackage/issues/370 - # - MusicBrainz + - MusicBrainz - DAV - hopenpgp-tools From 287e10cb9c2657f47ef9b43637b3e3b513fac06f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 15 Feb 2015 15:04:52 +0200 Subject: [PATCH 056/208] Un-skip hlibgit2 tests --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index ddfd74f3..4e185683 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -857,9 +857,6 @@ skipped-tests: # https://github.com/Soostone/retry/issues/18 - retry - # https://github.com/jwiegley/gitlib/issues/42 - - hlibgit2 - # Tests which we should build and run, but which are expected to fail. We # should not fail a build based on a test failure for one of these packages. expected-test-failures: From 9106add72590c086f47f28c6642c07682491c11a Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 15 Feb 2015 20:04:00 +0100 Subject: [PATCH 057/208] Add Hakyll to Stackage --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 4e185683..76fbc89d 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -152,6 +152,7 @@ packages: "Jasper Van der Jeugt": - blaze-html - blaze-markup + - hakyll - stylish-haskell "Antoine Latter": From 19cf63976925ca64b318857bfabc7cb5a2e27ce1 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 16 Feb 2015 11:55:00 +0200 Subject: [PATCH 058/208] Upper bound for #443 --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 76fbc89d..0396bcfe 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -750,6 +750,7 @@ packages: # https://github.com/fpco/stackage/issues/443 - exceptions < 0.7 + - resourcet < 1.1.4 # https://github.com/fpco/stackage/issues/445 - semigroupoids < 4.3 From e62226e92c9904deb7748469dc414e5653f642d1 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 17 Feb 2015 02:12:21 +0200 Subject: [PATCH 059/208] Remove upper bounds and close #389 --- build-constraints.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 0396bcfe..c4de7765 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -315,8 +315,9 @@ packages: "Brent Yorgey ": - active - - BlogLiterately - - BlogLiterately-diagrams + # Temporarily disabled due to restrictive lens upper bound + #- BlogLiterately + #- BlogLiterately-diagrams - diagrams - diagrams-builder - diagrams-contrib @@ -711,10 +712,6 @@ packages: # https://github.com/fpco/stackage/issues/291 - random < 1.0.1.3 - # https://github.com/fpco/stackage/issues/389 - - lens < 4.7 - - hsdev < 0.1.3.3 - # https://github.com/fpco/stackage/issues/390 # NOTE: When this issue is resolved, remove the expected test failure # for language-ecmascript as well. From 635fc73f55c71a94676198a0430bbf4d4267211a Mon Sep 17 00:00:00 2001 From: Leon Mergen Date: Tue, 17 Feb 2015 12:35:05 +0700 Subject: [PATCH 060/208] Update build-constraints.yaml --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index c4de7765..019851b6 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -703,6 +703,9 @@ packages: "Gabríel Arthúr Pétursson gabriel@system.is": - sdl2 + "Leon Mergen leon@solatis.com": + - network-attoparsec + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From 58a621bcbabe1d13133c9ac48e72d718c5fa6d8b Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 17 Feb 2015 07:46:51 +0200 Subject: [PATCH 061/208] Remove no-longer-needed upper bound --- build-constraints.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 019851b6..e291aff3 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -750,7 +750,6 @@ packages: # https://github.com/fpco/stackage/issues/443 - exceptions < 0.7 - - resourcet < 1.1.4 # https://github.com/fpco/stackage/issues/445 - semigroupoids < 4.3 From 4cb98cd9ed782df8711af480ec53dce783a2452a Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 17 Feb 2015 11:58:36 +0200 Subject: [PATCH 062/208] Include some missing system files --- debian-bootstrap.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/debian-bootstrap.sh b/debian-bootstrap.sh index c069dcb1..0beb5273 100755 --- a/debian-bootstrap.sh +++ b/debian-bootstrap.sh @@ -18,6 +18,9 @@ apt-get install -y \ build-essential \ libncurses-dev \ git \ + wget \ + m4 \ + texlive-binaries \ libgmp3c2 \ libgmp3-dev \ zlib1g-dev \ @@ -38,7 +41,6 @@ apt-get install -y \ libpq-dev \ libicu-dev \ libssl-dev \ - nettle-dev \ libgsl0-dev \ libblas-dev \ liblapack-dev \ @@ -50,3 +52,15 @@ apt-get install -y \ liblzma-dev \ libsdl2-dev \ libzmq3-dev + +mkdir /tmp/nettle-build +( +cd /tmp/nettle-build +wget https://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz +tar zxf nettle-2.7.1.tar.gz +cd nettle-2.7.1 +./configure +make +make install +) +rm -rf /tmp/nettle-build From 613fc07e8e6295520b49da940d6d7fbc9605e950 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 17 Feb 2015 15:41:08 +0200 Subject: [PATCH 063/208] Skip test suite jberryman/directory-tree#4 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index e291aff3..a45cbfe3 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1011,6 +1011,9 @@ expected-test-failures: # https://github.com/haskell-distributed/distributed-process-execution/issues/2 - distributed-process-execution + # https://github.com/jberryman/directory-tree/issues/4 + - directory-tree + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 4761d55ce4c9646ab48bc232f1a34810583136c1 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 17 Feb 2015 15:41:26 +0200 Subject: [PATCH 064/208] Docker image fixes --- build-constraints.yaml | 4 ++++ debian-bootstrap.sh | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index a45cbfe3..9c5c2591 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1011,6 +1011,10 @@ expected-test-failures: # https://github.com/haskell-distributed/distributed-process-execution/issues/2 - distributed-process-execution + # Seems to depend on mtl being installed in user package database, which + # isn't always the case (e.g., build server) + - mtl + # https://github.com/jberryman/directory-tree/issues/4 - directory-tree diff --git a/debian-bootstrap.sh b/debian-bootstrap.sh index 0beb5273..0f296009 100755 --- a/debian-bootstrap.sh +++ b/debian-bootstrap.sh @@ -37,6 +37,7 @@ apt-get install -y \ llvm \ libbz2-dev \ libjudy-dev \ + libsqlite3-dev \ libmysqlclient-dev \ libpq-dev \ libicu-dev \ @@ -51,6 +52,7 @@ apt-get install -y \ libyaml-dev \ liblzma-dev \ libsdl2-dev \ + libxss-dev \ libzmq3-dev mkdir /tmp/nettle-build @@ -59,7 +61,7 @@ cd /tmp/nettle-build wget https://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz tar zxf nettle-2.7.1.tar.gz cd nettle-2.7.1 -./configure +./configure --prefix=/usr make make install ) From 5b72273a9f0fda115514f96589a658c5a25ed74f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 17 Feb 2015 16:38:07 +0200 Subject: [PATCH 065/208] Remove upper bounds and close #446 --- build-constraints.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 9c5c2591..0ab5775f 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -709,8 +709,7 @@ packages: "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 - - transformers-compat == 0.3.3.3 - - mtl-compat < 0.2 # https://github.com/fpco/stackage/issues/446 + - transformers-compat == 0.4.0.3 # https://github.com/fpco/stackage/issues/291 - random < 1.0.1.3 From 6c984bde6781febb7535780dd84665125a62cc54 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 18 Feb 2015 06:47:36 +0200 Subject: [PATCH 066/208] Typo --- build-constraints.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 0ab5775f..6db0dd3f 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1012,7 +1012,7 @@ expected-test-failures: # Seems to depend on mtl being installed in user package database, which # isn't always the case (e.g., build server) - - mtl + - happy # https://github.com/jberryman/directory-tree/issues/4 - directory-tree From d4234b84668eed85b18b43191c2faff79ad05e79 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Thu, 19 Feb 2015 17:13:23 +1300 Subject: [PATCH 067/208] Add http-media and cabal-test-quickcheck --- build-constraints.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 6db0dd3f..8eb473f6 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -706,6 +706,10 @@ packages: "Leon Mergen leon@solatis.com": - network-attoparsec + "Timothy Jones git@zmthy.io @zmthy": + - cabal-test-quickcheck + - http-media + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From bd6c774c02dfa256480fc7c977bf29bd0c423ae4 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 19 Feb 2015 07:51:43 +0200 Subject: [PATCH 068/208] Expected test failure massysett/multiarg#4 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 6db0dd3f..fb328637 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1017,6 +1017,9 @@ expected-test-failures: # https://github.com/jberryman/directory-tree/issues/4 - directory-tree + # https://github.com/massysett/multiarg/issues/4 + - multiarg + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 7183cf0f77f66a2463da2fd795654708dc9567ec Mon Sep 17 00:00:00 2001 From: Sebastiaan Visser Date: Thu, 19 Feb 2015 11:41:21 +0100 Subject: [PATCH 069/208] Update build-constraints.yaml --- build-constraints.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index fb328637..80e75e4e 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -390,9 +390,12 @@ packages: - fay-jquery - fay-text - fay-uri - - fclabels - snaplet-fay + "Sebastiaan Visser ": + - clay + - fclabels + "Rodrigo Setti ": - messagepack - messagepack-rpc From fb5e7af5c04cb158cb8cf2e8a6a8ca0ea57dfca3 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 19 Feb 2015 16:02:03 +0200 Subject: [PATCH 070/208] Remove expected failure --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 80e75e4e..4f9fbbb7 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1020,9 +1020,6 @@ expected-test-failures: # https://github.com/jberryman/directory-tree/issues/4 - directory-tree - # https://github.com/massysett/multiarg/issues/4 - - multiarg - # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 4312df025fd5aa4be9972c3c276945c9cfd65515 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Sat, 21 Feb 2015 12:39:02 +0200 Subject: [PATCH 071/208] Add --skip-haddock -flag --- Stackage/CompleteBuild.hs | 2 ++ Stackage/InstallBuild.hs | 2 ++ Stackage/PerformBuild.hs | 3 ++- app/stackage.hs | 10 ++++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Stackage/CompleteBuild.hs b/Stackage/CompleteBuild.hs index cf74eef2..341be2b4 100644 --- a/Stackage/CompleteBuild.hs +++ b/Stackage/CompleteBuild.hs @@ -33,6 +33,7 @@ import System.IO (BufferMode (LineBuffering), hSetBuffering) -- | Flags passed in from the command line. data BuildFlags = BuildFlags { bfEnableTests :: !Bool + , bfEnableHaddock :: !Bool , bfDoUpload :: !Bool , bfEnableLibProfile :: !Bool , bfVerbose :: !Bool @@ -203,6 +204,7 @@ getPerformBuild buildFlags Settings {..} = PerformBuild , pbJobs = 8 , pbGlobalInstall = False , pbEnableTests = bfEnableTests buildFlags + , pbEnableHaddock = bfEnableHaddock buildFlags , pbEnableLibProfiling = bfEnableLibProfile buildFlags , pbVerbose = bfVerbose buildFlags , pbAllowNewer = bfSkipCheck buildFlags diff --git a/Stackage/InstallBuild.hs b/Stackage/InstallBuild.hs index abe8a14e..a6a6c25f 100644 --- a/Stackage/InstallBuild.hs +++ b/Stackage/InstallBuild.hs @@ -28,6 +28,7 @@ data InstallFlags = InstallFlags , ifJobs :: !Int , ifGlobalInstall :: !Bool , ifEnableTests :: !Bool + , ifEnableHaddock :: !Bool , ifEnableLibProfiling :: !Bool , ifVerbose :: !Bool , ifSkipCheck :: !Bool @@ -48,6 +49,7 @@ getPerformBuild plan InstallFlags{..} = , pbJobs = ifJobs , pbGlobalInstall = ifGlobalInstall , pbEnableTests = ifEnableTests + , pbEnableHaddock = ifEnableHaddock , pbEnableLibProfiling = ifEnableLibProfiling , pbVerbose = ifVerbose , pbAllowNewer = ifSkipCheck diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index c74b449a..e38f8e62 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -62,6 +62,7 @@ data PerformBuild = PerformBuild , pbGlobalInstall :: Bool -- ^ Register packages in the global database , pbEnableTests :: Bool + , pbEnableHaddock :: Bool , pbEnableLibProfiling :: Bool , pbVerbose :: Bool , pbAllowNewer :: Bool @@ -354,7 +355,7 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} = -- dependency's haddocks before this finishes atomically $ putTMVar (piResult sbPackageInfo) True - when (pcHaddocks /= Don'tBuild && not (null $ sdModules $ ppDesc $ piPlan sbPackageInfo)) $ do + when (pbEnableHaddock && pcHaddocks /= Don'tBuild && not (null $ sdModules $ ppDesc $ piPlan sbPackageInfo)) $ do log' $ "Haddocks " ++ namever hfs <- readTVarIO sbHaddockFiles let hfsOpts = flip map (mapToList hfs) $ \(pkgVer, hf) -> concat diff --git a/app/stackage.hs b/app/stackage.hs index 8fdd2833..c8bb4f52 100644 --- a/app/stackage.hs +++ b/app/stackage.hs @@ -77,6 +77,11 @@ main = (switch (long "skip-tests" <> help "Skip build and running the test suites")) <*> + fmap + not + (switch + (long "skip-haddock" <> + help "Skip generating haddock documentation")) <*> fmap not (switch @@ -136,6 +141,11 @@ main = (switch (long "skip-tests" <> help "Skip build and running the test suites")) <*> + fmap + not + (switch + (long "skip-haddock" <> + help "Skip generating haddock documentation")) <*> switch (long "enable-library-profiling" <> help "Enable profiling when building") <*> From 4e2260a869ecc2288b927bf11fee67aca6708165 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Feb 2015 07:03:40 +0200 Subject: [PATCH 072/208] Expected test failure zmthy/http-media#11 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 3fc076f6..3318f930 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1024,6 +1024,9 @@ expected-test-failures: # https://github.com/jberryman/directory-tree/issues/4 - directory-tree + # https://github.com/zmthy/http-media/issues/11 + - http-media + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 79b2b13b0e266e7461e66f5ebb7fd8f2f8068ea1 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Feb 2015 07:09:16 +0200 Subject: [PATCH 073/208] Upper bound for #453 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 3318f930..c9638349 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -760,6 +760,9 @@ packages: # https://github.com/fpco/stackage/issues/445 - semigroupoids < 4.3 + # https://github.com/fpco/stackage/issues/453 + - descriptive < 0.9 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From c7230cd1dbad30c85d79c5a5819a6a0f9754c552 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Feb 2015 07:10:35 +0200 Subject: [PATCH 074/208] Remove upper bounds and close #445 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index c9638349..1a3ea338 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -757,9 +757,6 @@ packages: # https://github.com/fpco/stackage/issues/443 - exceptions < 0.7 - # https://github.com/fpco/stackage/issues/445 - - semigroupoids < 4.3 - # https://github.com/fpco/stackage/issues/453 - descriptive < 0.9 From 56a37736690957a35eb3fcc1fc137459ef2fc9e1 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Feb 2015 07:11:54 +0200 Subject: [PATCH 075/208] Remove upper bound and close #402 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 1a3ea338..39f6feee 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -726,9 +726,6 @@ packages: # for language-ecmascript as well. - language-ecmascript < 0.17 - # https://github.com/fpco/stackage/issues/402 - - vector-space < 0.9 - # https://github.com/fpco/stackage/issues/407 - HStringTemplate < 0.8 From 42f96904d72e234e52dbe4761a77c05f1217d1cb Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Feb 2015 08:16:19 +0200 Subject: [PATCH 076/208] Temporary upper bound for byorgey/haxr#7 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 39f6feee..abf1e978 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -757,6 +757,9 @@ packages: # https://github.com/fpco/stackage/issues/453 - descriptive < 0.9 + # https://github.com/byorgey/haxr/issues/7 + - haxr < 3000.10.4 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 8a0e3b20aceb61cec6657360c89eba4c54d771c4 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Feb 2015 09:40:21 +0200 Subject: [PATCH 077/208] Add expected test failure ekmett/semigroupoids#18 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index abf1e978..0207887e 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1027,6 +1027,9 @@ expected-test-failures: # https://github.com/zmthy/http-media/issues/11 - http-media + # https://github.com/ekmett/semigroupoids/issues/18 + - semigroupoids + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 7be69244306fbb86361b775c3046b219357d73a2 Mon Sep 17 00:00:00 2001 From: Chris Done Date: Mon, 23 Feb 2015 10:54:42 +0100 Subject: [PATCH 078/208] Fix descriptive upper bound on hindent (fixes #453) --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 0207887e..953e4ef2 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -754,9 +754,6 @@ packages: # https://github.com/fpco/stackage/issues/443 - exceptions < 0.7 - # https://github.com/fpco/stackage/issues/453 - - descriptive < 0.9 - # https://github.com/byorgey/haxr/issues/7 - haxr < 3000.10.4 From 240de346305b902b564954e4c3bd750b72a8706b Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Feb 2015 16:30:34 +0200 Subject: [PATCH 079/208] Remove upper bound for byorgey/haxr#7 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 953e4ef2..8708a3c3 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -754,9 +754,6 @@ packages: # https://github.com/fpco/stackage/issues/443 - exceptions < 0.7 - # https://github.com/byorgey/haxr/issues/7 - - haxr < 3000.10.4 - # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 031ab4e77a0aa25e4856f6ffac8f67e084770c3e Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Feb 2015 16:33:10 +0200 Subject: [PATCH 080/208] Extra #442 upper bounds --- build-constraints.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 8708a3c3..b91604c2 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -750,6 +750,8 @@ packages: # https://github.com/fpco/stackage/issues/442 - blaze-builder < 0.4 + - blaze-markup < 0.7 + - blaze-html < 0.8 # https://github.com/fpco/stackage/issues/443 - exceptions < 0.7 From b7d0a219db3ec3f813cc8e2ad26e0264d525db2d Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Feb 2015 16:34:47 +0200 Subject: [PATCH 081/208] Extra upper bound for #443 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index b91604c2..123b4e8b 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -755,6 +755,9 @@ packages: # https://github.com/fpco/stackage/issues/443 - exceptions < 0.7 + - rest-client < 0.5 + - rest-types < 1.13 + - rest-core < 0.35 # Package flags are applied to individual packages, and override the values of # global-flags From 569e804bd4065f5aa71e485a659d013b1450516c Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Feb 2015 19:40:43 +0200 Subject: [PATCH 082/208] Extra upper bound to work around silkapp/rest#107 --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 123b4e8b..5ebf663d 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -758,6 +758,7 @@ packages: - rest-client < 0.5 - rest-types < 1.13 - rest-core < 0.35 + - rest-gen < 0.17 # Package flags are applied to individual packages, and override the values of # global-flags From 350c4402742f51c70270c5ede6ce1987e003933f Mon Sep 17 00:00:00 2001 From: Greg V Date: Mon, 23 Feb 2015 21:40:54 +0300 Subject: [PATCH 083/208] Add gitson, pcre-heavy --- build-constraints.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 5ebf663d..8eeb83e1 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -712,6 +712,10 @@ packages: "Timothy Jones git@zmthy.io @zmthy": - cabal-test-quickcheck - http-media + + "Greg V greg@unrelenting.technology @myfreeweb": + - gitson + - pcre-heavy "Stackage upper bounds": From 4b4331e349ae071324bbb0e095c4b2f8d4c54c54 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 24 Feb 2015 07:00:45 +0200 Subject: [PATCH 084/208] Add @Gabriel439 as maintainer of pipes-safe See: https://github.com/fpco/stackage/issues/443#issuecomment-75662205 --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 5ebf663d..ad7db534 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -379,6 +379,7 @@ packages: - pipes - pipes-parse - pipes-concurrency + - pipes-safe "Chris Allen ": - bloodhound From 4c1a2781173a1f8168a8a835974079888945225d Mon Sep 17 00:00:00 2001 From: Francesco Mazzoli Date: Tue, 24 Feb 2015 16:15:14 +0100 Subject: [PATCH 085/208] Add `language-c-quote` --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 6fd5222b..98bb6d7b 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -718,6 +718,9 @@ packages: - gitson - pcre-heavy + "Francesco Mazzoli f@mazzo.li @bitonic": + - language-c-quote + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From 4e1d67b34b787df988ec49d10ddd31589290bea7 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 25 Feb 2015 09:37:46 +0200 Subject: [PATCH 086/208] rest-wai upper bound --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 98bb6d7b..8aeabfae 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -767,6 +767,7 @@ packages: - rest-types < 1.13 - rest-core < 0.35 - rest-gen < 0.17 + - rest-wai < 0.1.0.7 # Package flags are applied to individual packages, and override the values of # global-flags From 859415519567caf0857a2d2954f11e67b7713114 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 26 Feb 2015 07:16:24 +0200 Subject: [PATCH 087/208] Add back gitlib-libgit2 (fixes jwiegley/gitlib#23) --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 8aeabfae..5feed0f1 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -578,6 +578,7 @@ packages: - haddock-api - here - hlibgit2 + - gitlib-libgit2 - hostname-validate - interpolatedstring-perl6 - iproute From 4af65f023229ef1e1584f57eec570d8c0214614c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Fri, 27 Feb 2015 19:54:42 +0800 Subject: [PATCH 088/208] Add string-conversions --- build-constraints.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 8aeabfae..9b52943c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -713,7 +713,7 @@ packages: "Timothy Jones git@zmthy.io @zmthy": - cabal-test-quickcheck - http-media - + "Greg V greg@unrelenting.technology @myfreeweb": - gitson - pcre-heavy @@ -721,6 +721,9 @@ packages: "Francesco Mazzoli f@mazzo.li @bitonic": - language-c-quote + "Sönke Hahn soenkehahn@gmail.com @soenkehahn": + - string-conversions + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From fbf40bcd2e5e622d4babf0093fcc1e641c7d2eec Mon Sep 17 00:00:00 2001 From: marcinmrotek Date: Sun, 1 Mar 2015 08:29:37 +0100 Subject: [PATCH 089/208] Update build-constraints.yaml Added my libraries: diagrams-hsqml, type-list and vinyl-utils. --- build-constraints.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 28735ce9..5aefd126 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -603,6 +603,11 @@ packages: "Samplecount stefan@samplecount.com @kaoskorobase": - shake-language-c + + "Marcin Mrotek ": + - diagrams-hsqml + - type-list + - vinyl-utils "Stackage upper bounds": # https://github.com/fpco/stackage/issues/288 From b5ac384b46ffd3adf82d0a0c196c82c433adc363 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 1 Mar 2015 12:10:47 +0200 Subject: [PATCH 090/208] Create symlink for nettle --- debian-bootstrap.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian-bootstrap.sh b/debian-bootstrap.sh index 0f296009..7025ea05 100755 --- a/debian-bootstrap.sh +++ b/debian-bootstrap.sh @@ -64,5 +64,8 @@ cd nettle-2.7.1 ./configure --prefix=/usr make make install + +mkdir -p /usr/lib/x86_64-linux-gnu/ +ln -sfv /usr/lib/libnettle.so.4.7 /usr/lib/x86_64-linux-gnu/libnettle.so.4 ) rm -rf /tmp/nettle-build From dffc7edfba56a1bb7ce59c595f30e9a9687c4cdc Mon Sep 17 00:00:00 2001 From: Adam Bergmark Date: Sun, 1 Mar 2015 18:21:14 +0100 Subject: [PATCH 091/208] Add generic-xmlpickler and remove some duplicate entries --- build-constraints.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index fd5e83cd..e881afca 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -507,9 +507,9 @@ packages: - code-builder - fay-builder - generic-aeson + - generic-xmlpickler - hxt-pickle-utils - imagesize-conduit - - imagesize-conduit - json-schema - multipart - regular-xmlpickler @@ -522,8 +522,6 @@ packages: - rest-types - rest-wai - tostring - - tostring - - uri-encode - uri-encode "Simon Michael ": From a8a2bd77d34fa8c04c01b60d9dd345d1e41717b5 Mon Sep 17 00:00:00 2001 From: Dimitri 'phaazon' Sabadie Date: Tue, 3 Mar 2015 00:17:53 +0100 Subject: [PATCH 092/208] Added two packages for Dimitri Sabadie. - smoothie, a spline library ; - al, a raw binding to OpenAL 1.1. --- build-constraints.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index e881afca..bdb537b7 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -531,7 +531,9 @@ packages: - io-manager "Dimitri Sabadie ": - ghc-syb-utils @@ -643,7 +645,7 @@ packages: "Samplecount stefan@samplecount.com @kaoskorobase": - shake-language-c - + "Marcin Mrotek ": - diagrams-hsqml - type-list From 3807e55a52378132616e585b74a5572211041310 Mon Sep 17 00:00:00 2001 From: Boris Date: Tue, 3 Mar 2015 09:46:02 +0200 Subject: [PATCH 093/208] remove upper bound for https://github.com/d12frosted/CanonicalPath/issues/3 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index bdb537b7..e0d1391c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -758,9 +758,6 @@ packages: # https://github.com/fpco/stackage/issues/426 - utf8-string < 1 - # https://github.com/d12frosted/CanonicalPath/issues/3 - - system-canonicalpath < 0.3 - # https://github.com/fpco/stackage/issues/440 - th-orphans < 0.9 - file-location < 0.4.7 From d9905369565891335dc3184d06e8bb421f7162c2 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 3 Mar 2015 11:37:30 +0200 Subject: [PATCH 094/208] Temporarily disable al #461 --- build-constraints.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index e0d1391c..b19729a9 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -531,7 +531,8 @@ packages: - io-manager "Dimitri Sabadie Date: Tue, 3 Mar 2015 11:42:12 +0200 Subject: [PATCH 095/208] Expected test failure ndmitchell/hoogle#101 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index b19729a9..2fb473a9 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1046,6 +1046,9 @@ expected-test-failures: # https://github.com/ekmett/semigroupoids/issues/18 - semigroupoids + # https://github.com/ndmitchell/hoogle/issues/101 + - hoogle + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 2dcff03780800b5a6f8a58ea97255a1d3581fa29 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 3 Mar 2015 17:08:06 +0200 Subject: [PATCH 096/208] Expected test failure d12frosted/CanonicalPath#4 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 2fb473a9..897ca989 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1049,6 +1049,9 @@ expected-test-failures: # https://github.com/ndmitchell/hoogle/issues/101 - hoogle + # https://github.com/d12frosted/CanonicalPath/issues/4 + - system-canonicalpath + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 8dc931e093c65c8a6ba9ba87fb15c8f9d08ff390 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 3 Mar 2015 17:10:43 +0200 Subject: [PATCH 097/208] Expected test failure myfreeweb/gitson#1 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 897ca989..d021ca68 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1052,6 +1052,9 @@ expected-test-failures: # https://github.com/d12frosted/CanonicalPath/issues/4 - system-canonicalpath + # https://github.com/myfreeweb/gitson/issues/1 + - gitson + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From a22919f9402f9eea407fc676919221106bd1e819 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 5 Mar 2015 09:59:02 +0200 Subject: [PATCH 098/208] Temporarily block hopenpgp-tools #463 --- build-constraints.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index d021ca68..3e6c210f 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -477,7 +477,8 @@ packages: - openpgp-asciiarmor - MusicBrainz - DAV - - hopenpgp-tools + # https://github.com/fpco/stackage/issues/463 + #- hopenpgp-tools # https://github.com/fpco/stackage/issues/160 "Ketil Malde": From 0770ab8e27e62babba894c03ed5e4e5d33e55a93 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 5 Mar 2015 10:00:36 +0200 Subject: [PATCH 099/208] system-canonicalpath passes tests again --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 3e6c210f..d0801ef5 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1050,9 +1050,6 @@ expected-test-failures: # https://github.com/ndmitchell/hoogle/issues/101 - hoogle - # https://github.com/d12frosted/CanonicalPath/issues/4 - - system-canonicalpath - # https://github.com/myfreeweb/gitson/issues/1 - gitson From a3120f0d0925a1373828ba88a715c995a4dd2caf Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 7 Mar 2015 19:09:59 +0200 Subject: [PATCH 100/208] Upper bound for #464 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index d0801ef5..3fbce4fd 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -777,6 +777,9 @@ packages: - rest-gen < 0.17 - rest-wai < 0.1.0.7 + # https://github.com/fpco/stackage/issues/464 + - profunctors < 4.4 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 6a492e8a68c64b8d6ae78c0e882396e48772efee Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 7 Mar 2015 19:10:52 +0200 Subject: [PATCH 101/208] Upper bound for #465 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 3fbce4fd..c93239e9 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -780,6 +780,9 @@ packages: # https://github.com/fpco/stackage/issues/464 - profunctors < 4.4 + # https://github.com/fpco/stackage/issues/465 + - free < 4.11 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 1e004c73e4421328f5178f23fbd14d8af45ae4be Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 7 Mar 2015 19:11:40 +0200 Subject: [PATCH 102/208] Upper bound for #466 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index c93239e9..01ec535e 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -783,6 +783,9 @@ packages: # https://github.com/fpco/stackage/issues/465 - free < 4.11 + # https://github.com/fpco/stackage/issues/466 + - linear < 1.17 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From a923f36160bf0ab0b4a925da1d79bcfeaa7d6833 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 8 Mar 2015 06:31:50 +0200 Subject: [PATCH 103/208] Upper bounds for #467 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 01ec535e..0221448c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -786,6 +786,9 @@ packages: # https://github.com/fpco/stackage/issues/466 - linear < 1.17 + # https://github.com/fpco/stackage/issues/467 + - lens < 4.8 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 0fd3665aea7914aaf3168978580e1f0f1a79ee81 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 8 Mar 2015 06:33:53 +0200 Subject: [PATCH 104/208] Expected test failure jcristovao/enclosed-exceptions#6 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 0221448c..34e66411 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1065,6 +1065,9 @@ expected-test-failures: # https://github.com/myfreeweb/gitson/issues/1 - gitson + # https://github.com/jcristovao/enclosed-exceptions/issues/6 + - enclosed-exceptions + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 661ff0199932a015a7fa1d64c4f5b7b82ced9683 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 8 Mar 2015 06:42:48 +0200 Subject: [PATCH 105/208] Remove upper bounds and close #466 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 34e66411..e468214c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -783,9 +783,6 @@ packages: # https://github.com/fpco/stackage/issues/465 - free < 4.11 - # https://github.com/fpco/stackage/issues/466 - - linear < 1.17 - # https://github.com/fpco/stackage/issues/467 - lens < 4.8 From 7a10048b01e4e9ed712e3586a18eae37972cbec5 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 8 Mar 2015 06:43:12 +0200 Subject: [PATCH 106/208] Remove upper bounds and close #465 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index e468214c..2821a495 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -780,9 +780,6 @@ packages: # https://github.com/fpco/stackage/issues/464 - profunctors < 4.4 - # https://github.com/fpco/stackage/issues/465 - - free < 4.11 - # https://github.com/fpco/stackage/issues/467 - lens < 4.8 From 2495abb79e69126bbf13bf1e757a953d56c5a07a Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 8 Mar 2015 06:43:36 +0200 Subject: [PATCH 107/208] Remove upper bounds and close #464 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 2821a495..0684d999 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -777,9 +777,6 @@ packages: - rest-gen < 0.17 - rest-wai < 0.1.0.7 - # https://github.com/fpco/stackage/issues/464 - - profunctors < 4.4 - # https://github.com/fpco/stackage/issues/467 - lens < 4.8 From aab7687816fd5aed4284425e95fb0d508ba8f4fb Mon Sep 17 00:00:00 2001 From: Alexander Thiemann Date: Sun, 8 Mar 2015 20:33:54 +0100 Subject: [PATCH 108/208] add users, users-test, users-postgresql-simple --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 0684d999..8e143411 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -619,6 +619,9 @@ packages: - Spock - Spock-digestive - Spock-worker + - users + - users-test + - users-postgresql-simple "Joey Eremondi ": - aeson-pretty From ac07851dac4f836f70f234266b7eff5322d08dfc Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 10 Mar 2015 08:56:53 +0200 Subject: [PATCH 109/208] Expected test failure for users-postgresql-simple --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 8e143411..95e3a681 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1062,6 +1062,9 @@ expected-test-failures: # https://github.com/jcristovao/enclosed-exceptions/issues/6 - enclosed-exceptions + # Expects a running PostgreSQL server + - users-postgresql-simple + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From b096a8b49bd9d65c0107c94fc8b06a0b65fc4772 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 10 Mar 2015 08:59:25 +0200 Subject: [PATCH 110/208] Upper bound for #469 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 95e3a681..08a6de13 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -783,6 +783,9 @@ packages: # https://github.com/fpco/stackage/issues/467 - lens < 4.8 + # https://github.com/fpco/stackage/issues/469 + - contravariant < 1.3 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 7f68c4aa0d057d3480e51f6f03b390043d2c4669 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 10 Mar 2015 21:39:30 +0200 Subject: [PATCH 111/208] Remove upper bounds and close #469 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 08a6de13..95e3a681 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -783,9 +783,6 @@ packages: # https://github.com/fpco/stackage/issues/467 - lens < 4.8 - # https://github.com/fpco/stackage/issues/469 - - contravariant < 1.3 - # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 508fefe6186d346ac509c8189801a9acb8ab02bc Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 11 Mar 2015 07:27:48 +0200 Subject: [PATCH 112/208] Remove upper bounds and close #291 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 95e3a681..55c7d7b7 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -740,9 +740,6 @@ packages: # Force a specific version that's compatible with transformers 0.3 - transformers-compat == 0.4.0.3 - # https://github.com/fpco/stackage/issues/291 - - random < 1.0.1.3 - # https://github.com/fpco/stackage/issues/390 # NOTE: When this issue is resolved, remove the expected test failure # for language-ecmascript as well. From 4b9c9e1c68f14328d580c21f29dc208ac8e70484 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 11 Mar 2015 07:36:22 +0200 Subject: [PATCH 113/208] Get a missing executable for lhs2tex --- debian-bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian-bootstrap.sh b/debian-bootstrap.sh index 7025ea05..827e8460 100755 --- a/debian-bootstrap.sh +++ b/debian-bootstrap.sh @@ -20,7 +20,7 @@ apt-get install -y \ git \ wget \ m4 \ - texlive-binaries \ + texlive-full \ libgmp3c2 \ libgmp3-dev \ zlib1g-dev \ From 6443a042194fd3509088b103e8466360e36a9bb1 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Wed, 11 Mar 2015 14:41:42 +0200 Subject: [PATCH 114/208] Add waitra package --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 55c7d7b7..d8e951d8 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -735,6 +735,9 @@ packages: "Sönke Hahn soenkehahn@gmail.com @soenkehahn": - string-conversions + "Oleg Grenrus oleg.grenrus@iki.fi @phadej": + - waitra + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From d0f8ae6e34310e928292445b0a7e49925dc0bda4 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 11 Mar 2015 14:49:27 +0200 Subject: [PATCH 115/208] Expect nettle test failure --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 55c7d7b7..e3ee8c09 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1062,6 +1062,9 @@ expected-test-failures: # Expects a running PostgreSQL server - users-postgresql-simple + # Problems with linking with system libraries on Ubuntu 12.04 + - nettle + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From ba470b136b97f4255983a14c5f1fb7c4bb297c41 Mon Sep 17 00:00:00 2001 From: Tim Dysinger Date: Wed, 11 Mar 2015 09:50:57 -1000 Subject: [PATCH 116/208] Install alex & happy via PPA onto the docker image as a binary deb package Might be acceptable for #471 in the short term --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a83c42bc..c3956908 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,9 +14,9 @@ ADD debian-bootstrap.sh /tmp/debian-bootstrap.sh RUN DEBIAN_FRONTEND=noninteractive bash /tmp/debian-bootstrap.sh RUN rm /tmp/debian-bootstrap.sh -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cabal-install-1.20 ghc-7.8.4 +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cabal-install-1.20 ghc-7.8.4 alex-3.1.3 happy-1.19.4 -ENV PATH /home/stackage/.cabal/bin:/usr/local/sbin:/usr/local/bin:/opt/ghc/7.8.4/bin:/opt/cabal/1.20/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PATH /home/stackage/.cabal/bin:/usr/local/sbin:/usr/local/bin:/opt/ghc/7.8.4/bin:/opt/cabal/1.20/bin:/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:/usr/sbin:/usr/bin:/sbin:/bin RUN cabal update ADD . /tmp/stackage From 79ccb289bdde569f4ec148ae0f1b5781ab99be43 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 11 Mar 2015 22:11:32 +0200 Subject: [PATCH 117/208] Upper bound for #473 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index ef9b0fd4..3829e62f 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -783,6 +783,9 @@ packages: # https://github.com/fpco/stackage/issues/467 - lens < 4.8 + # https://github.com/fpco/stackage/issues/473 + - snap < 0.14 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 3ef123f4b4ecf642c15f99264358c99aa92c35ae Mon Sep 17 00:00:00 2001 From: Leon Mergen Date: Thu, 12 Mar 2015 12:05:20 +0700 Subject: [PATCH 118/208] Adds network-anonymous-i2p --- build-constraints.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 3829e62f..bbd379d9 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -718,8 +718,9 @@ packages: "Gabríel Arthúr Pétursson gabriel@system.is": - sdl2 - "Leon Mergen leon@solatis.com": + "Leon Mergen leon@solatis.com @solatis": - network-attoparsec + - network-anonymous-i2p "Timothy Jones git@zmthy.io @zmthy": - cabal-test-quickcheck From a30a4297744681087bdeb55f24d15e93827d1d6a Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 12 Mar 2015 08:12:35 +0200 Subject: [PATCH 119/208] Remove upper bounds and close #473 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index bbd379d9..7655b963 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -784,9 +784,6 @@ packages: # https://github.com/fpco/stackage/issues/467 - lens < 4.8 - # https://github.com/fpco/stackage/issues/473 - - snap < 0.14 - # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 4b651e8865fe4ee9e551fc6b35582d33d01cfa42 Mon Sep 17 00:00:00 2001 From: Tim Dysinger Date: Wed, 11 Mar 2015 14:34:53 -1000 Subject: [PATCH 120/208] add performbuild flag for dynamic executables --- Stackage/CompleteBuild.hs | 1 + Stackage/InstallBuild.hs | 1 + Stackage/PerformBuild.hs | 2 ++ 3 files changed, 4 insertions(+) diff --git a/Stackage/CompleteBuild.hs b/Stackage/CompleteBuild.hs index 341be2b4..62a7634e 100644 --- a/Stackage/CompleteBuild.hs +++ b/Stackage/CompleteBuild.hs @@ -206,6 +206,7 @@ getPerformBuild buildFlags Settings {..} = PerformBuild , pbEnableTests = bfEnableTests buildFlags , pbEnableHaddock = bfEnableHaddock buildFlags , pbEnableLibProfiling = bfEnableLibProfile buildFlags + , pbEnableExecDyn = bfEnableExecDyn buildFlags , pbVerbose = bfVerbose buildFlags , pbAllowNewer = bfSkipCheck buildFlags } diff --git a/Stackage/InstallBuild.hs b/Stackage/InstallBuild.hs index a6a6c25f..74c78427 100644 --- a/Stackage/InstallBuild.hs +++ b/Stackage/InstallBuild.hs @@ -51,6 +51,7 @@ getPerformBuild plan InstallFlags{..} = , pbEnableTests = ifEnableTests , pbEnableHaddock = ifEnableHaddock , pbEnableLibProfiling = ifEnableLibProfiling + , pbEnableExecDyn = ifEnableExecDyn , pbVerbose = ifVerbose , pbAllowNewer = ifSkipCheck } diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index e38f8e62..e25094c6 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -64,6 +64,7 @@ data PerformBuild = PerformBuild , pbEnableTests :: Bool , pbEnableHaddock :: Bool , pbEnableLibProfiling :: Bool + , pbEnableExecDyn :: Bool , pbVerbose :: Bool , pbAllowNewer :: Bool -- ^ Pass --allow-newer to cabal configure @@ -317,6 +318,7 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} = tell' $ "--flags=" ++ flags when (pbEnableLibProfiling && pcEnableLibProfile) $ tell' "--enable-library-profiling" + when pbEnableExecDyn $ tell' "--enable-executable-dynamic" where tell' x = tell (x:) From f6b95190f1f7420071e2dedc48ad9bc7cf32f31f Mon Sep 17 00:00:00 2001 From: Tim Dysinger Date: Wed, 11 Mar 2015 14:34:22 -1000 Subject: [PATCH 121/208] add installflag for dynamic executables --- Stackage/InstallBuild.hs | 1 + app/stackage.hs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Stackage/InstallBuild.hs b/Stackage/InstallBuild.hs index 74c78427..757939a7 100644 --- a/Stackage/InstallBuild.hs +++ b/Stackage/InstallBuild.hs @@ -30,6 +30,7 @@ data InstallFlags = InstallFlags , ifEnableTests :: !Bool , ifEnableHaddock :: !Bool , ifEnableLibProfiling :: !Bool + , ifEnableExecDyn :: !Bool , ifVerbose :: !Bool , ifSkipCheck :: !Bool } deriving (Show) diff --git a/app/stackage.hs b/app/stackage.hs index c8bb4f52..57497dfd 100644 --- a/app/stackage.hs +++ b/app/stackage.hs @@ -149,6 +149,9 @@ main = switch (long "enable-library-profiling" <> help "Enable profiling when building") <*> + switch + (long "enable-executable-dynamic" <> + help "Enable dynamic executables when building") <*> switch (long "verbose" <> short 'v' <> help "Output verbose detail about the build steps") <*> From 0ffdb203c3d340e2423b9d08b123491b94ef6225 Mon Sep 17 00:00:00 2001 From: Tim Dysinger Date: Wed, 11 Mar 2015 14:33:14 -1000 Subject: [PATCH 122/208] add buildflags for dynamic executables --- Stackage/CompleteBuild.hs | 1 + app/stackage.hs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Stackage/CompleteBuild.hs b/Stackage/CompleteBuild.hs index 62a7634e..ab9c3a3b 100644 --- a/Stackage/CompleteBuild.hs +++ b/Stackage/CompleteBuild.hs @@ -36,6 +36,7 @@ data BuildFlags = BuildFlags , bfEnableHaddock :: !Bool , bfDoUpload :: !Bool , bfEnableLibProfile :: !Bool + , bfEnableExecDyn :: !Bool , bfVerbose :: !Bool , bfSkipCheck :: !Bool } deriving (Show) diff --git a/app/stackage.hs b/app/stackage.hs index 57497dfd..1b9583c7 100644 --- a/app/stackage.hs +++ b/app/stackage.hs @@ -90,6 +90,9 @@ main = switch (long "enable-library-profiling" <> help "Enable profiling when building") <*> + switch + (long "enable-executable-dynamic" <> + help "Enable dynamic executables when building") <*> switch (long "verbose" <> short 'v' <> help "Output verbose detail about the build steps") <*> From eadca478ae0e3161308c64e0cc63e342ad3d303d Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 12 Mar 2015 14:26:16 +0200 Subject: [PATCH 123/208] First stab an incremental builds Pinging @chrisdone --- Stackage/CompleteBuild.hs | 4 +- Stackage/GhcPkg.hs | 79 ++++++++++++++++++++++ Stackage/PerformBuild.hs | 137 +++++++++++++++++++++++++++++++------- stackage.cabal | 2 + 4 files changed, 195 insertions(+), 27 deletions(-) create mode 100644 Stackage/GhcPkg.hs diff --git a/Stackage/CompleteBuild.hs b/Stackage/CompleteBuild.hs index 341be2b4..97e8ba72 100644 --- a/Stackage/CompleteBuild.hs +++ b/Stackage/CompleteBuild.hs @@ -67,7 +67,7 @@ nightlySettings :: Text -- ^ day -> Settings nightlySettings day plan' = Settings { planFile = nightlyPlanFile day - , buildDir = fpFromText $ "builds/stackage-nightly-" ++ day + , buildDir = fpFromText $ "builds/nightly" , logDir = fpFromText $ "logs/stackage-nightly-" ++ day , title = \ghcVer -> concat [ "Stackage Nightly " @@ -120,7 +120,7 @@ getSettings man (LTS bumpType) = do return Settings { planFile = newfile - , buildDir = fpFromText $ "builds/stackage-lts-" ++ tshow new + , buildDir = fpFromText $ "builds/lts" , logDir = fpFromText $ "logs/stackage-lts-" ++ tshow new , title = \ghcVer -> concat [ "LTS Haskell " diff --git a/Stackage/GhcPkg.hs b/Stackage/GhcPkg.hs new file mode 100644 index 00000000..4985d2f2 --- /dev/null +++ b/Stackage/GhcPkg.hs @@ -0,0 +1,79 @@ +{-# LANGUAGE NoImplicitPrelude #-} +-- | General commands related to ghc-pkg. + +module Stackage.GhcPkg where + +import Data.Conduit +import qualified Data.Conduit.List as CL +import Data.Conduit.Process +import qualified Data.Conduit.Text as CT +import Data.Maybe +import Data.Text (Text) +import qualified Data.Text as T +import Distribution.Compat.ReadP +import Distribution.Package +import Distribution.Text (parse) +import Filesystem.Path.CurrentOS (FilePath) +import qualified Filesystem.Path.CurrentOS as FP +import Data.Map (Map) +import Data.Version (Version) +import Stackage.Prelude + +setupPackageDatabase + :: Maybe FilePath -- ^ database location, Nothing if using global DB + -> Map PackageName Version -- ^ packages and versions to be installed + -> IO (Set PackageName) -- ^ packages remaining in the database after cleanup +setupPackageDatabase mdb toInstall = do + registered1 <- getRegisteredPackages flags + forM_ registered1 $ \(PackageIdentifier name version) -> + case lookup name toInstall of + Just version' | version /= version' -> unregisterPackage flags name + _ -> return () + broken <- getBrokenPackages flags + forM_ broken $ \(PackageIdentifier name _) -> unregisterPackage flags name + foldMap (\(PackageIdentifier name _) -> singletonSet name) + <$> getRegisteredPackages flags + where + flags = ghcPkgFlags mdb + +ghcPkgFlags :: Maybe FilePath -> [String] +ghcPkgFlags mdb = + "--no-user-package-db" : + case mdb of + Nothing -> ["--global"] + Just fp -> ["--package-db=" ++ fpToString fp] + +-- | Get broken packages. +getBrokenPackages :: [String] -> IO [PackageIdentifier] +getBrokenPackages flags = do + (_,ps) <- sourceProcessWithConsumer + (proc + "ghc-pkg" + ("check" : "--simple-output" : flags)) + (CT.decodeUtf8 $= CT.lines $= CL.consume) + return (mapMaybe parsePackageIdent (T.words (T.unlines ps))) + +-- | Get available packages. +getRegisteredPackages :: [String] -> IO [PackageIdentifier] +getRegisteredPackages flags = do + (_,ps) <- sourceProcessWithConsumer + (proc + "ghc-pkg" + ("list" : "--simple-output" : flags)) + (CT.decodeUtf8 $= CT.lines $= CL.consume) + return (mapMaybe parsePackageIdent (T.words (T.unlines ps))) + +-- | Parse a package identifier: foo-1.2.3 +parsePackageIdent :: Text -> Maybe PackageIdentifier +parsePackageIdent = fmap fst . + listToMaybe . + filter (null . snd) . + readP_to_S parse . T.unpack + +-- | Unregister a package. +unregisterPackage :: [String] -> PackageName -> IO () +unregisterPackage flags ident = do + void (readProcessWithExitCode + "ghc-pkg" + ("unregister": flags ++ ["--force", unpack $ display ident]) + "") diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index e38f8e62..fe8dac4a 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -19,11 +19,12 @@ import qualified Data.Map as Map import Data.NonNull (fromNullable) import Filesystem (canonicalizePath, createTree, getWorkingDirectory, isDirectory, - removeTree, rename) + removeTree, rename, isFile, removeFile) import Filesystem.Path (parent) import qualified Filesystem.Path as F import Stackage.BuildConstraints import Stackage.BuildPlan +import Stackage.GhcPkg import Stackage.PackageDescription import Stackage.Prelude hiding (pi) import System.Directory (findExecutable) @@ -134,6 +135,10 @@ pbLibDir pb = pbInstallDest pb "lib" pbDataDir pb = pbInstallDest pb "share" pbDocDir pb = pbInstallDest pb "doc" +-- | Directory keeping previous result info +pbPrevResDir :: PerformBuild -> FilePath +pbPrevResDir pb = pbInstallDest pb "prevres" + performBuild :: PerformBuild -> IO [Text] performBuild pb = do cwd <- getWorkingDirectory @@ -161,12 +166,13 @@ performBuild' pb@PerformBuild {..} = withBuildDir $ \builddir -> do $ \ClosedStream Inherited Inherited -> return () let removeTree' fp = whenM (isDirectory fp) (removeTree fp) - mapM_ removeTree' [pbInstallDest, pbLogDir] + removeTree' pbLogDir - forM_ (pbDatabase pb) $ \db -> do - createTree $ parent db - withCheckedProcess (proc "ghc-pkg" ["init", fpToString db]) - $ \ClosedStream Inherited Inherited -> return () + forM_ (pbDatabase pb) $ \db -> + unlessM (isFile $ db "package.cache") $ do + createTree $ parent db + withCheckedProcess (proc "ghc-pkg" ["init", fpToString db]) + $ \ClosedStream Inherited Inherited -> return () pbLog $ encodeUtf8 "Copying built-in Haddocks\n" copyBuiltInHaddocks (pbDocDir pb) @@ -186,7 +192,12 @@ performBuild' pb@PerformBuild {..} = withBuildDir $ \builddir -> do env <- getEnvironment haddockFiles <- newTVarIO mempty - forM_ packageMap $ \pi -> void $ async $ singleBuild pb SingleBuild + registeredPackages <- setupPackageDatabase + (pbDatabase pb) + (ppVersion <$> bpPackages pbPlan) + + forM_ packageMap $ \pi -> void $ async $ singleBuild pb registeredPackages + SingleBuild { sbSem = sem , sbErrsVar = errsVar , sbWarningsVar = warningsVar @@ -248,8 +259,10 @@ data SingleBuild = SingleBuild , sbHaddockFiles :: TVar (Map Text FilePath) -- ^ package-version, .haddock file } -singleBuild :: PerformBuild -> SingleBuild -> IO () -singleBuild pb@PerformBuild {..} SingleBuild {..} = +singleBuild :: PerformBuild + -> Set PackageName -- ^ registered packages + -> SingleBuild -> IO () +singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = withCounter sbActive $ handle updateErrs $ (`finally` void (atomically $ tryPutTMVar (piResult sbPackageInfo) False)) @@ -261,11 +274,12 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} = let wfd comps = waitForDeps sbToolMap sbPackageMap comps pbPlan sbPackageInfo . withTSem sbSem - wfd libComps buildLibrary + withUnpacked <- wfd libComps buildLibrary - wfd testComps runTests + wfd testComps (runTests withUnpacked) - name = display $ piName sbPackageInfo + pname = piName sbPackageInfo + name = display pname namever = concat [ name , "-" @@ -333,19 +347,34 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} = buildLibrary = wf libOut $ \outH -> do let run a b = do when pbVerbose $ log' (unwords (a : b)) runChild outH a b - log' $ "Unpacking " ++ namever - runParent outH "cabal" ["unpack", namever] - log' $ "Configuring " ++ namever - run "cabal" $ "configure" : configArgs + isUnpacked <- newIORef False + let withUnpacked inner = do + unlessM (readIORef isUnpacked) $ do + log' $ "Unpacking " ++ namever + runParent outH "cabal" ["unpack", namever] + writeIORef isUnpacked True + inner - log' $ "Building " ++ namever - run "cabal" ["build"] + isConfiged <- newIORef False + let withConfiged inner = withUnpacked $ do + unlessM (readIORef isConfiged) $ do + log' $ "Configuring " ++ namever + run "cabal" $ "configure" : configArgs + writeIORef isConfiged True + inner - log' $ "Copying/registering " ++ namever - run "cabal" ["copy"] - withMVar sbRegisterMutex $ const $ - run "cabal" ["register"] + unless (pname `member` registeredPackages) $ withConfiged $ do + deletePreviousResults pb pname + -- FIXME delete old Haddocks? + + log' $ "Building " ++ namever + run "cabal" ["build"] + + log' $ "Copying/registering " ++ namever + run "cabal" ["copy"] + withMVar sbRegisterMutex $ const $ + run "cabal" ["register"] -- Even if the tests later fail, we can allow other libraries to build -- on top of our successful results @@ -355,7 +384,11 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} = -- dependency's haddocks before this finishes atomically $ putTMVar (piResult sbPackageInfo) True - when (pbEnableHaddock && pcHaddocks /= Don'tBuild && not (null $ sdModules $ ppDesc $ piPlan sbPackageInfo)) $ do + prevHaddockResult <- getPreviousResult pb Haddock pname + let needHaddock = pbEnableHaddock + && checkPrevResult prevHaddockResult pcHaddocks + && not (null $ sdModules $ ppDesc $ piPlan sbPackageInfo) + when needHaddock $ withConfiged $ do log' $ "Haddocks " ++ namever hfs <- readTVarIO sbHaddockFiles let hfsOpts = flip map (mapToList hfs) $ \(pkgVer, hf) -> concat @@ -390,15 +423,21 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} = $ modifyTVar sbHaddockFiles $ insertMap namever newPath + savePreviousResult pb Haddock pname $ either (const False) (const True) eres case (eres, pcHaddocks) of (Left e, ExpectSuccess) -> throwM e (Right (), ExpectFailure) -> warn $ namever ++ ": unexpected Haddock success" _ -> return () - runTests = wf testOut $ \outH -> do + return withUnpacked + + runTests withUnpacked = wf testOut $ \outH -> do let run = runChild outH - when (pbEnableTests && pcTests /= Don'tBuild) $ do + prevTestResult <- getPreviousResult pb Test pname + let needTest = pbEnableTests + && checkPrevResult prevTestResult pcTests + when needTest $ withUnpacked $ do log' $ "Test configure " ++ namever run "cabal" $ "configure" : "--enable-tests" : configArgs @@ -409,6 +448,7 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} = log' $ "Test run " ++ namever run "cabal" ["test", "--log=" ++ fpToText testRunOut] + savePreviousResult pb Test pname $ either (const False) (const True) eres case (eres, pcTests) of (Left e, ExpectSuccess) -> throwM e (Right (), ExpectFailure) -> warn $ namever ++ ": unexpected test success" @@ -451,3 +491,50 @@ copyBuiltInHaddocks docdir = do src <- canonicalizePath (parent (fpFromString ghc) "../share/doc/ghc/html/libraries") copyDir src docdir + +------------- Previous results + +-- | The previous actions that can be run +data ResultType = Haddock | Test + deriving (Show, Enum, Eq, Ord, Bounded, Read) + +-- | The result generated on a previous run +data PrevResult = PRNoResult | PRSuccess | PRFailure + +-- | Check if we should rerun based on a PrevResult and the expected status +checkPrevResult _ Don'tBuild = False +checkPrevResult PRNoResult _ = True +checkPrevResult PRSuccess _ = False +checkPrevResult PRFailure ExpectSuccess = True +checkPrevResult PRFailure _ = False + +withPRPath :: PerformBuild -> ResultType -> PackageName -> (FilePath -> IO a) -> IO a +withPRPath pb rt (PackageName name) inner = do + createTree $ parent fp + inner fp + where + fp = pbPrevResDir pb fpFromString (show rt) fpFromString name + +successBS, failureBS :: ByteString +successBS = "success" +failureBS = "failure" + +getPreviousResult :: PerformBuild -> ResultType -> PackageName -> IO PrevResult +getPreviousResult w x y = withPRPath w x y $ \fp -> do + eres <- tryIO $ readFile fp + return $ case eres of + Right bs + | bs == successBS -> PRSuccess + | bs == failureBS -> PRFailure + _ -> PRNoResult + +savePreviousResult :: PerformBuild -> ResultType -> PackageName -> Bool -> IO () +savePreviousResult pb rt name res = + withPRPath pb rt name $ \fp -> writeFile fp $ + if res then successBS else failureBS + +deletePreviousResults :: PerformBuild -> PackageName -> IO () +deletePreviousResults pb name = + forM_ [minBound..maxBound] $ \rt -> + withPRPath pb rt name $ \fp -> + void $ tryIO $ removeFile fp diff --git a/stackage.cabal b/stackage.cabal index 94b42da9..2dec3030 100644 --- a/stackage.cabal +++ b/stackage.cabal @@ -23,6 +23,7 @@ library Stackage.BuildPlan Stackage.CheckBuildPlan Stackage.UpdateBuildPlan + Stackage.GhcPkg Stackage.GithubPings Stackage.InstallBuild Stackage.PackageDescription @@ -63,6 +64,7 @@ library , streaming-commons >= 0.1.7.1 , semigroups , xml-conduit + , conduit executable stackage default-language: Haskell2010 From f5bd0c777d99734bbb69b54bf98aeaff69eb8fee Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 12 Mar 2015 16:59:57 +0200 Subject: [PATCH 124/208] Add expected test failure network-anonymous-i2p --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 7655b963..1b343254 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1069,6 +1069,9 @@ expected-test-failures: # Problems with linking with system libraries on Ubuntu 12.04 - nettle + # Requires locally running services + - network-anonymous-i2p + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From e75b014b8b207330cd5d487010bf72daafc95e4e Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 12 Mar 2015 17:00:56 +0200 Subject: [PATCH 125/208] Delete old Haddocks when unregistering --- Stackage/GhcPkg.hs | 19 ++++++++++++------- Stackage/PerformBuild.hs | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Stackage/GhcPkg.hs b/Stackage/GhcPkg.hs index 4985d2f2..c741e96a 100644 --- a/Stackage/GhcPkg.hs +++ b/Stackage/GhcPkg.hs @@ -18,19 +18,21 @@ import qualified Filesystem.Path.CurrentOS as FP import Data.Map (Map) import Data.Version (Version) import Stackage.Prelude +import Filesystem (removeTree) setupPackageDatabase :: Maybe FilePath -- ^ database location, Nothing if using global DB + -> FilePath -- ^ documentation root -> Map PackageName Version -- ^ packages and versions to be installed -> IO (Set PackageName) -- ^ packages remaining in the database after cleanup -setupPackageDatabase mdb toInstall = do +setupPackageDatabase mdb docDir toInstall = do registered1 <- getRegisteredPackages flags - forM_ registered1 $ \(PackageIdentifier name version) -> + forM_ registered1 $ \pi@(PackageIdentifier name version) -> case lookup name toInstall of - Just version' | version /= version' -> unregisterPackage flags name + Just version' | version /= version' -> unregisterPackage docDir flags pi _ -> return () broken <- getBrokenPackages flags - forM_ broken $ \(PackageIdentifier name _) -> unregisterPackage flags name + forM_ broken $ unregisterPackage docDir flags foldMap (\(PackageIdentifier name _) -> singletonSet name) <$> getRegisteredPackages flags where @@ -71,9 +73,12 @@ parsePackageIdent = fmap fst . readP_to_S parse . T.unpack -- | Unregister a package. -unregisterPackage :: [String] -> PackageName -> IO () -unregisterPackage flags ident = do +unregisterPackage :: FilePath -- ^ doc directory + -> [String] -> PackageIdentifier -> IO () +unregisterPackage docDir flags ident@(PackageIdentifier name _) = do void (readProcessWithExitCode "ghc-pkg" - ("unregister": flags ++ ["--force", unpack $ display ident]) + ("unregister": flags ++ ["--force", unpack $ display name]) "") + + void $ tryIO $ removeTree $ docDir fpFromText (display ident) diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index fe8dac4a..5597cd63 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -194,6 +194,7 @@ performBuild' pb@PerformBuild {..} = withBuildDir $ \builddir -> do registeredPackages <- setupPackageDatabase (pbDatabase pb) + (pbDocDir pb) (ppVersion <$> bpPackages pbPlan) forM_ packageMap $ \pi -> void $ async $ singleBuild pb registeredPackages @@ -366,7 +367,6 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = unless (pname `member` registeredPackages) $ withConfiged $ do deletePreviousResults pb pname - -- FIXME delete old Haddocks? log' $ "Building " ++ namever run "cabal" ["build"] From 75faf6126bfb566efe5e837c571c2b7a295504ab Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 12 Mar 2015 17:57:43 +0200 Subject: [PATCH 126/208] Add logging when unregistering a package --- Stackage/GhcPkg.hs | 18 ++++++++++++------ Stackage/PerformBuild.hs | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Stackage/GhcPkg.hs b/Stackage/GhcPkg.hs index c741e96a..f6c3eccf 100644 --- a/Stackage/GhcPkg.hs +++ b/Stackage/GhcPkg.hs @@ -1,7 +1,10 @@ {-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} -- | General commands related to ghc-pkg. -module Stackage.GhcPkg where +module Stackage.GhcPkg + ( setupPackageDatabase + ) where import Data.Conduit import qualified Data.Conduit.List as CL @@ -23,16 +26,17 @@ import Filesystem (removeTree) setupPackageDatabase :: Maybe FilePath -- ^ database location, Nothing if using global DB -> FilePath -- ^ documentation root + -> (ByteString -> IO ()) -- ^ logging -> Map PackageName Version -- ^ packages and versions to be installed -> IO (Set PackageName) -- ^ packages remaining in the database after cleanup -setupPackageDatabase mdb docDir toInstall = do +setupPackageDatabase mdb docDir log' toInstall = do registered1 <- getRegisteredPackages flags forM_ registered1 $ \pi@(PackageIdentifier name version) -> case lookup name toInstall of - Just version' | version /= version' -> unregisterPackage docDir flags pi + Just version' | version /= version' -> unregisterPackage log' docDir flags pi _ -> return () broken <- getBrokenPackages flags - forM_ broken $ unregisterPackage docDir flags + forM_ broken $ unregisterPackage log' docDir flags foldMap (\(PackageIdentifier name _) -> singletonSet name) <$> getRegisteredPackages flags where @@ -73,9 +77,11 @@ parsePackageIdent = fmap fst . readP_to_S parse . T.unpack -- | Unregister a package. -unregisterPackage :: FilePath -- ^ doc directory +unregisterPackage :: (ByteString -> IO ()) -- ^ log func + -> FilePath -- ^ doc directory -> [String] -> PackageIdentifier -> IO () -unregisterPackage docDir flags ident@(PackageIdentifier name _) = do +unregisterPackage log' docDir flags ident@(PackageIdentifier name _) = do + log' $ "Unregistering " ++ encodeUtf8 (display ident) void (readProcessWithExitCode "ghc-pkg" ("unregister": flags ++ ["--force", unpack $ display name]) diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index 5597cd63..7a627a55 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -195,6 +195,7 @@ performBuild' pb@PerformBuild {..} = withBuildDir $ \builddir -> do registeredPackages <- setupPackageDatabase (pbDatabase pb) (pbDocDir pb) + pbLog (ppVersion <$> bpPackages pbPlan) forM_ packageMap $ \pi -> void $ async $ singleBuild pb registeredPackages From 351c03b8812f291f5625d3f8b6d5b096a44a7fe9 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 13 Mar 2015 08:39:50 +0200 Subject: [PATCH 127/208] Use PackageIdentifier --- Stackage/GhcPkg.hs | 2 +- Stackage/PerformBuild.hs | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Stackage/GhcPkg.hs b/Stackage/GhcPkg.hs index f6c3eccf..1e5171d8 100644 --- a/Stackage/GhcPkg.hs +++ b/Stackage/GhcPkg.hs @@ -81,7 +81,7 @@ unregisterPackage :: (ByteString -> IO ()) -- ^ log func -> FilePath -- ^ doc directory -> [String] -> PackageIdentifier -> IO () unregisterPackage log' docDir flags ident@(PackageIdentifier name _) = do - log' $ "Unregistering " ++ encodeUtf8 (display ident) + log' $ "Unregistering " ++ encodeUtf8 (display ident) ++ "\n" void (readProcessWithExitCode "ghc-pkg" ("unregister": flags ++ ["--force", unpack $ display name]) diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index 7a627a55..e43d0d5a 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -281,6 +281,7 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = wfd testComps (runTests withUnpacked) pname = piName sbPackageInfo + pident = PackageIdentifier pname (ppVersion $ piPlan sbPackageInfo) name = display pname namever = concat [ name @@ -385,7 +386,7 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = -- dependency's haddocks before this finishes atomically $ putTMVar (piResult sbPackageInfo) True - prevHaddockResult <- getPreviousResult pb Haddock pname + prevHaddockResult <- getPreviousResult pb Haddock pident let needHaddock = pbEnableHaddock && checkPrevResult prevHaddockResult pcHaddocks && not (null $ sdModules $ ppDesc $ piPlan sbPackageInfo) @@ -424,7 +425,7 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = $ modifyTVar sbHaddockFiles $ insertMap namever newPath - savePreviousResult pb Haddock pname $ either (const False) (const True) eres + savePreviousResult pb Haddock pident $ either (const False) (const True) eres case (eres, pcHaddocks) of (Left e, ExpectSuccess) -> throwM e (Right (), ExpectFailure) -> warn $ namever ++ ": unexpected Haddock success" @@ -435,7 +436,7 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = runTests withUnpacked = wf testOut $ \outH -> do let run = runChild outH - prevTestResult <- getPreviousResult pb Test pname + prevTestResult <- getPreviousResult pb Test pident let needTest = pbEnableTests && checkPrevResult prevTestResult pcTests when needTest $ withUnpacked $ do @@ -449,7 +450,7 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = log' $ "Test run " ++ namever run "cabal" ["test", "--log=" ++ fpToText testRunOut] - savePreviousResult pb Test pname $ either (const False) (const True) eres + savePreviousResult pb Test pident $ either (const False) (const True) eres case (eres, pcTests) of (Left e, ExpectSuccess) -> throwM e (Right (), ExpectFailure) -> warn $ namever ++ ": unexpected test success" @@ -501,26 +502,28 @@ data ResultType = Haddock | Test -- | The result generated on a previous run data PrevResult = PRNoResult | PRSuccess | PRFailure + deriving (Show, Enum, Eq, Ord, Bounded, Read) -- | Check if we should rerun based on a PrevResult and the expected status +checkPrevResult :: PrevResult -> TestState -> Bool checkPrevResult _ Don'tBuild = False checkPrevResult PRNoResult _ = True checkPrevResult PRSuccess _ = False checkPrevResult PRFailure ExpectSuccess = True checkPrevResult PRFailure _ = False -withPRPath :: PerformBuild -> ResultType -> PackageName -> (FilePath -> IO a) -> IO a -withPRPath pb rt (PackageName name) inner = do +withPRPath :: PerformBuild -> ResultType -> PackageIdentifier -> (FilePath -> IO a) -> IO a +withPRPath pb rt ident inner = do createTree $ parent fp inner fp where - fp = pbPrevResDir pb fpFromString (show rt) fpFromString name + fp = pbPrevResDir pb fpFromString (show rt) fpFromText (display ident) successBS, failureBS :: ByteString successBS = "success" failureBS = "failure" -getPreviousResult :: PerformBuild -> ResultType -> PackageName -> IO PrevResult +getPreviousResult :: PerformBuild -> ResultType -> PackageIdentifier -> IO PrevResult getPreviousResult w x y = withPRPath w x y $ \fp -> do eres <- tryIO $ readFile fp return $ case eres of @@ -529,12 +532,12 @@ getPreviousResult w x y = withPRPath w x y $ \fp -> do | bs == failureBS -> PRFailure _ -> PRNoResult -savePreviousResult :: PerformBuild -> ResultType -> PackageName -> Bool -> IO () -savePreviousResult pb rt name res = - withPRPath pb rt name $ \fp -> writeFile fp $ +savePreviousResult :: PerformBuild -> ResultType -> PackageIdentifier -> Bool -> IO () +savePreviousResult pb rt ident res = + withPRPath pb rt ident $ \fp -> writeFile fp $ if res then successBS else failureBS -deletePreviousResults :: PerformBuild -> PackageName -> IO () +deletePreviousResults :: PerformBuild -> PackageIdentifier -> IO () deletePreviousResults pb name = forM_ [minBound..maxBound] $ \rt -> withPRPath pb rt name $ \fp -> From cd0e717aab6478b91265512e56336c4441478970 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 13 Mar 2015 08:40:16 +0200 Subject: [PATCH 128/208] File for store build results --- Stackage/PerformBuild.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index e43d0d5a..1aef3af3 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -367,8 +367,10 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = writeIORef isConfiged True inner - unless (pname `member` registeredPackages) $ withConfiged $ do - deletePreviousResults pb pname + prevBuildResult <- getPreviousResult pb Build pident + unless (prevBuildResult == PRSuccess) $ withConfiged $ do + assert (pname `notMember` registeredPackages) $ do + deletePreviousResults pb pident log' $ "Building " ++ namever run "cabal" ["build"] @@ -378,6 +380,8 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = withMVar sbRegisterMutex $ const $ run "cabal" ["register"] + savePreviousResult pb Build pident True + -- Even if the tests later fail, we can allow other libraries to build -- on top of our successful results -- @@ -497,7 +501,7 @@ copyBuiltInHaddocks docdir = do ------------- Previous results -- | The previous actions that can be run -data ResultType = Haddock | Test +data ResultType = Build | Haddock | Test deriving (Show, Enum, Eq, Ord, Bounded, Read) -- | The result generated on a previous run From ca28a53e91bcb7d0cb8d95cb206b438351cad724 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 13 Mar 2015 08:46:02 +0200 Subject: [PATCH 129/208] Switch default library profiling to true (pinging @manny-fp) --- Stackage/BuildConstraints.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Stackage/BuildConstraints.hs b/Stackage/BuildConstraints.hs index e7aae355..c4ce1ceb 100644 --- a/Stackage/BuildConstraints.hs +++ b/Stackage/BuildConstraints.hs @@ -120,7 +120,7 @@ instance FromJSON PackageConstraints where pcBuildBenchmarks <- o .: "build-benchmarks" pcFlagOverrides <- Map.mapKeysWith const mkFlagName <$> o .: "flags" pcMaintainer <- o .:? "maintainer" - pcEnableLibProfile <- fmap (fromMaybe False) (o .:? "library-profiling") + pcEnableLibProfile <- fmap (fromMaybe True) (o .:? "library-profiling") return PackageConstraints {..} -- | The proposed plan from the requirements provided by contributors. From 19a64410d2f440c3d9f1f4fd746aa6b534013f15 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 12 Mar 2015 16:59:57 +0200 Subject: [PATCH 130/208] Add expected test failure network-anonymous-i2p --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 7655b963..1b343254 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1069,6 +1069,9 @@ expected-test-failures: # Problems with linking with system libraries on Ubuntu 12.04 - nettle + # Requires locally running services + - network-anonymous-i2p + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From d625c4747bc4e4d9ec77ae1139a21d971aa66ed0 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 13 Mar 2015 12:33:07 +0200 Subject: [PATCH 131/208] Expect Haddock failure: gtk --- build-constraints.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 1b343254..4036dc18 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1086,6 +1086,10 @@ expected-haddock-failures: # https://github.com/wereHamster/rethinkdb-client-driver/issues/1 - rethinkdb-client-driver + # Requires build before haddock, which doesn't always happen in incremental + # builds. Could consider special-casing this requirement. + - gtk + # Benchmarks which should not be built. Note that Stackage does *not* generally # build benchmarks. The difference here will be whether dependencies for these # benchmarks are included or not. From 8f74bbee495532162ab3d58225ff0a9661ccc019 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 14 Mar 2015 20:47:14 +0200 Subject: [PATCH 132/208] Delete previous results when unregistering Previously, package install status was determined by checking the package database. However, this didn't work for executables, so I switched it to keep explicit track of build results. I forgot to then clear those results when unregistering a package. Pinging @manny-fp @chrisdone --- Stackage/GhcPkg.hs | 11 +++++++---- Stackage/PerformBuild.hs | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Stackage/GhcPkg.hs b/Stackage/GhcPkg.hs index 1e5171d8..8f9f9431 100644 --- a/Stackage/GhcPkg.hs +++ b/Stackage/GhcPkg.hs @@ -28,15 +28,16 @@ setupPackageDatabase -> FilePath -- ^ documentation root -> (ByteString -> IO ()) -- ^ logging -> Map PackageName Version -- ^ packages and versions to be installed + -> (PackageIdentifier -> IO ()) -- ^ callback to be used when unregistering a package -> IO (Set PackageName) -- ^ packages remaining in the database after cleanup -setupPackageDatabase mdb docDir log' toInstall = do +setupPackageDatabase mdb docDir log' toInstall onUnregister = do registered1 <- getRegisteredPackages flags forM_ registered1 $ \pi@(PackageIdentifier name version) -> case lookup name toInstall of - Just version' | version /= version' -> unregisterPackage log' docDir flags pi + Just version' | version /= version' -> unregisterPackage log' onUnregister docDir flags pi _ -> return () broken <- getBrokenPackages flags - forM_ broken $ unregisterPackage log' docDir flags + forM_ broken $ unregisterPackage log' onUnregister docDir flags foldMap (\(PackageIdentifier name _) -> singletonSet name) <$> getRegisteredPackages flags where @@ -78,10 +79,12 @@ parsePackageIdent = fmap fst . -- | Unregister a package. unregisterPackage :: (ByteString -> IO ()) -- ^ log func + -> (PackageIdentifier -> IO ()) -- ^ callback to be used when unregistering a package -> FilePath -- ^ doc directory -> [String] -> PackageIdentifier -> IO () -unregisterPackage log' docDir flags ident@(PackageIdentifier name _) = do +unregisterPackage log' onUnregister docDir flags ident@(PackageIdentifier name _) = do log' $ "Unregistering " ++ encodeUtf8 (display ident) ++ "\n" + onUnregister ident void (readProcessWithExitCode "ghc-pkg" ("unregister": flags ++ ["--force", unpack $ display name]) diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index d922dab9..02fa14b7 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -198,6 +198,7 @@ performBuild' pb@PerformBuild {..} = withBuildDir $ \builddir -> do (pbDocDir pb) pbLog (ppVersion <$> bpPackages pbPlan) + (deletePreviousResults pb) forM_ packageMap $ \pi -> void $ async $ singleBuild pb registeredPackages SingleBuild From eef9c14d248d2e3ad696078e8843894dbf8a4b7c Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 15 Mar 2015 15:29:47 +0200 Subject: [PATCH 133/208] Delete libraries when unregistering Pinging @manny-fp --- Stackage/GhcPkg.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Stackage/GhcPkg.hs b/Stackage/GhcPkg.hs index 8f9f9431..27b7f9e1 100644 --- a/Stackage/GhcPkg.hs +++ b/Stackage/GhcPkg.hs @@ -85,9 +85,20 @@ unregisterPackage :: (ByteString -> IO ()) -- ^ log func unregisterPackage log' onUnregister docDir flags ident@(PackageIdentifier name _) = do log' $ "Unregistering " ++ encodeUtf8 (display ident) ++ "\n" onUnregister ident + + -- Delete libraries + sourceProcessWithConsumer + (proc "ghc-pkg" ("describe" : flags ++ [unpack $ display ident])) + (CT.decodeUtf8 + $= CT.lines + $= CL.mapMaybe parseLibraryDir + $= CL.mapM_ (void . tryIO . removeTree)) + void (readProcessWithExitCode "ghc-pkg" ("unregister": flags ++ ["--force", unpack $ display name]) "") void $ tryIO $ removeTree $ docDir fpFromText (display ident) + where + parseLibraryDir = fmap fpFromText . stripPrefix "library-dirs: " From e80a8d0acfbdc47809cd6418f2aa791751ee916c Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 15 Mar 2015 15:46:58 +0200 Subject: [PATCH 134/208] Only create log files when needed Did this for two reasons: 1. Easier to read incremental output this way 2. I believe that, with incremental builds, we were running out of file descriptors in some cases due to so rapidly plowing through all of the packages. I'm not certain this was the source of the errors I was seeing, but given (1), it made sense to try this first. --- Stackage/PerformBuild.hs | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index 02fa14b7..2b333044 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -30,7 +30,7 @@ import Stackage.Prelude hiding (pi) import System.Directory (findExecutable) import System.Environment (getEnvironment) import System.IO (IOMode (WriteMode), - withBinaryFile) + openBinaryFile) import System.IO.Temp (withSystemTempDirectory) data BuildException = BuildException (Map PackageName BuildFailure) [Text] @@ -291,11 +291,12 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = , display $ ppVersion $ piPlan sbPackageInfo ] - runIn wdir outH cmd args = - withCheckedProcess cp $ \ClosedStream UseProvidedHandle UseProvidedHandle -> + runIn wdir getOutH cmd args = do + outH <- getOutH + withCheckedProcess (cp outH) $ \ClosedStream UseProvidedHandle UseProvidedHandle -> (return () :: IO ()) where - cp = (proc (unpack $ asText cmd) (map (unpack . asText) args)) + cp outH = (proc (unpack $ asText cmd) (map (unpack . asText) args)) { cwd = Just $ fpToString wdir , std_out = UseHandle outH , std_err = UseHandle outH @@ -321,8 +322,21 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = testRunOut = pbLogDir fpFromText namever "test-run.out" wf fp inner' = do - createTree $ parent fp - withBinaryFile (fpToString fp) WriteMode inner' + ref <- newIORef Nothing + let cleanup = do + mh <- readIORef ref + forM_ mh hClose + getH = do + mh <- readIORef ref + case mh of + Just h -> return h + Nothing -> mask_ $ do + createTree $ parent fp + h <- openBinaryFile (fpToString fp) WriteMode + writeIORef ref $ Just h + return h + + inner' getH `finally` cleanup configArgs = ($ []) $ execWriter $ do when pbAllowNewer $ tell' "--allow-newer" @@ -350,15 +364,15 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = PackageConstraints {..} = ppConstraints $ piPlan sbPackageInfo - buildLibrary = wf libOut $ \outH -> do + buildLibrary = wf libOut $ \getOutH -> do let run a b = do when pbVerbose $ log' (unwords (a : b)) - runChild outH a b + runChild getOutH a b isUnpacked <- newIORef False let withUnpacked inner = do unlessM (readIORef isUnpacked) $ do log' $ "Unpacking " ++ namever - runParent outH "cabal" ["unpack", namever] + runParent getOutH "cabal" ["unpack", namever] writeIORef isUnpacked True inner @@ -440,8 +454,8 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = return withUnpacked - runTests withUnpacked = wf testOut $ \outH -> do - let run = runChild outH + runTests withUnpacked = wf testOut $ \getOutH -> do + let run = runChild getOutH prevTestResult <- getPreviousResult pb Test pident let needTest = pbEnableTests From 7dfde3ba49fb60209ccef21e1d03ba633b5fee3f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 15 Mar 2015 18:51:55 +0200 Subject: [PATCH 135/208] Generate v2 bundle during complete build --- Stackage/CompleteBuild.hs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Stackage/CompleteBuild.hs b/Stackage/CompleteBuild.hs index 80693dad..c3b26144 100644 --- a/Stackage/CompleteBuild.hs +++ b/Stackage/CompleteBuild.hs @@ -57,6 +57,8 @@ data Settings = Settings , setArgs :: Text -> UploadBundle -> UploadBundle , postBuild :: IO () , distroName :: Text -- ^ distro name on Hackage + , snapshotType :: SnapshotType + , bundleDest :: FilePath } nightlyPlanFile :: Text -- ^ day @@ -81,6 +83,8 @@ nightlySettings day plan' = Settings , plan = plan' , postBuild = return () , distroName = "Stackage" + , snapshotType = STNightly + , bundleDest = fpFromText $ "stackage-nightly-" ++ tshow day ++ ".bundle" } where slug' = "nightly-" ++ day @@ -142,6 +146,10 @@ getSettings man (LTS bumpType) = do putStrLn "Pushing to Git repository" git ["push"] , distroName = "LTSHaskell" + , snapshotType = + case new of + LTSVer x y -> STLTS x y + , bundleDest = fpFromText $ "stackage-lts-" ++ tshow new ++ ".bundle" } data LTSVer = LTSVer !Int !Int @@ -231,7 +239,16 @@ completeBuild buildType buildFlags = withManager tlsManagerSettings $ \man -> do checkBuildPlan plan putStrLn "Performing build" - performBuild (getPerformBuild buildFlags settings) >>= mapM_ putStrLn + let pb = getPerformBuild buildFlags settings + performBuild pb >>= mapM_ putStrLn + + putStrLn $ "Creating bundle (v2) at: " ++ fpToText bundleDest + createBundleV2 CreateBundleV2 + { cb2Plan = plan + , cb2Type = snapshotType + , cb2DocsDir = pbDocDir pb + , cb2Dest = bundleDest + } when (bfDoUpload buildFlags) $ finallyUpload settings man From fb1d2607bc6fc0b906e657b21f92117f116d2d0d Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 15 Mar 2015 19:15:57 +0200 Subject: [PATCH 136/208] Get rid of superfluous quotes --- Stackage/CompleteBuild.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Stackage/CompleteBuild.hs b/Stackage/CompleteBuild.hs index c3b26144..b5f41759 100644 --- a/Stackage/CompleteBuild.hs +++ b/Stackage/CompleteBuild.hs @@ -84,7 +84,7 @@ nightlySettings day plan' = Settings , postBuild = return () , distroName = "Stackage" , snapshotType = STNightly - , bundleDest = fpFromText $ "stackage-nightly-" ++ tshow day ++ ".bundle" + , bundleDest = fpFromText $ "stackage-nightly-" ++ day ++ ".bundle" } where slug' = "nightly-" ++ day From 43639bd6c5cd8a5d1eedec378c1ac305d0f4fd46 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 16 Mar 2015 12:33:29 +0200 Subject: [PATCH 137/208] Remove some expected failures c/o @chrisdone --- build-constraints.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 4036dc18..527574db 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -966,9 +966,6 @@ expected-test-failures: # https://github.com/BioHaskell/octree/issues/4 - Octree - # https://github.com/goldfirere/th-desugar/issues/12 - - th-desugar - # https://github.com/jmillikin/haskell-filesystem/issues/3 - system-filepath @@ -1077,9 +1074,6 @@ expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 - bytestring-progress - # https://github.com/ekmett/gl/issues/4 - - gl - # https://github.com/leventov/yarr/issues/5 - yarr From 923d655e0900dfc642a7a4b588f52339e6a42e4e Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 16 Mar 2015 17:17:45 +0200 Subject: [PATCH 138/208] Provide options for v2 uploads --- ChangeLog.md | 2 +- Stackage/CompleteBuild.hs | 87 +++++++++++++++++++++++---------------- Stackage/Upload.hs | 3 ++ app/stackage.hs | 36 +++++++++++++++- stackage.cabal | 5 ++- 5 files changed, 93 insertions(+), 40 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 3d7dd179..2aa9aea0 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,4 +1,4 @@ -## Unreleased +## 0.6.0 * Upload bundle V2 stuff diff --git a/Stackage/CompleteBuild.hs b/Stackage/CompleteBuild.hs index b5f41759..5f4735e6 100644 --- a/Stackage/CompleteBuild.hs +++ b/Stackage/CompleteBuild.hs @@ -8,6 +8,7 @@ module Stackage.CompleteBuild , completeBuild , justCheck , justUploadNightly + , getStackageAuthToken ) where import Control.Concurrent (threadDelay) @@ -39,6 +40,7 @@ data BuildFlags = BuildFlags , bfEnableExecDyn :: !Bool , bfVerbose :: !Bool , bfSkipCheck :: !Bool + , bfUploadV2 :: !Bool } deriving (Show) data BuildType = Nightly | LTS BumpType @@ -251,7 +253,7 @@ completeBuild buildType buildFlags = withManager tlsManagerSettings $ \man -> do } when (bfDoUpload buildFlags) $ - finallyUpload settings man + finallyUpload (bfUploadV2 buildFlags) settings man justUploadNightly :: Text -- ^ nightly date @@ -259,41 +261,63 @@ justUploadNightly justUploadNightly day = do plan <- decodeFileEither (fpToString $ nightlyPlanFile day) >>= either throwM return - withManager tlsManagerSettings $ finallyUpload $ nightlySettings day plan + withManager tlsManagerSettings $ finallyUpload False $ nightlySettings day plan + +getStackageAuthToken :: IO Text +getStackageAuthToken = do + mtoken <- lookupEnv "STACKAGE_AUTH_TOKEN" + case mtoken of + Nothing -> decodeUtf8 <$> readFile "/auth-token" + Just token -> return $ pack token -- | The final part of the complete build process: uploading a bundle, -- docs and a distro to hackage. -finallyUpload :: Settings -> Manager -> IO () -finallyUpload settings@Settings{..} man = do +finallyUpload :: Bool -- ^ use v2 upload + -> Settings -> Manager -> IO () +finallyUpload useV2 settings@Settings{..} man = do putStrLn "Uploading bundle to Stackage Server" - mtoken <- lookupEnv "STACKAGE_AUTH_TOKEN" - token <- - case mtoken of - Nothing -> decodeUtf8 <$> readFile "/auth-token" - Just token -> return $ pack token + token <- getStackageAuthToken - now <- epochTime - let ghcVer = display $ siGhcVersion $ bpSystemInfo plan - (ident, mloc) <- flip uploadBundle man $ setArgs ghcVer def - { ubContents = serverBundle now (title ghcVer) slug plan - , ubAuthToken = token - } - putStrLn $ "New ident: " ++ unSnapshotIdent ident - forM_ mloc $ \loc -> - putStrLn $ "Track progress at: " ++ loc + if useV2 + then do + res <- flip uploadBundleV2 man UploadBundleV2 + { ub2Server = def + , ub2AuthToken = token + , ub2Bundle = bundleDest + } + putStrLn $ "New snapshot available at: " ++ res + else do + now <- epochTime + let ghcVer = display $ siGhcVersion $ bpSystemInfo plan + (ident, mloc) <- flip uploadBundle man $ setArgs ghcVer def + { ubContents = serverBundle now (title ghcVer) slug plan + , ubAuthToken = token + } + putStrLn $ "New ident: " ++ unSnapshotIdent ident + forM_ mloc $ \loc -> + putStrLn $ "Track progress at: " ++ loc + + putStrLn "Uploading docs to Stackage Server" + res1 <- tryAny $ uploadDocs UploadDocs + { udServer = def + , udAuthToken = token + , udDocs = pbDocDir pb + , udSnapshot = ident + } man + putStrLn $ "Doc upload response: " ++ tshow res1 + + putStrLn "Uploading doc map" + tryAny (uploadDocMap UploadDocMap + { udmServer = def + , udmAuthToken = token + , udmSnapshot = ident + , udmDocDir = pbDocDir pb + , udmPlan = plan + } man) >>= print postBuild `catchAny` print - putStrLn "Uploading docs to Stackage Server" - res1 <- uploadDocs UploadDocs - { udServer = def - , udAuthToken = token - , udDocs = pbDocDir pb - , udSnapshot = ident - } man - putStrLn $ "Doc upload response: " ++ tshow res1 - ecreds <- tryIO $ readFile "/hackage-creds" case map encodeUtf8 $ words $ decodeUtf8 $ either (const "") id ecreds of [username, password] -> do @@ -301,14 +325,5 @@ finallyUpload settings@Settings{..} man = do res2 <- uploadHackageDistroNamed distroName plan username password man putStrLn $ "Distro upload response: " ++ tshow res2 _ -> putStrLn "No creds found, skipping Hackage distro upload" - - putStrLn "Uploading doc map" - uploadDocMap UploadDocMap - { udmServer = def - , udmAuthToken = token - , udmSnapshot = ident - , udmDocDir = pbDocDir pb - , udmPlan = plan - } man >>= print where pb = getPerformBuild (error "finallyUpload.buildFlags") settings diff --git a/Stackage/Upload.hs b/Stackage/Upload.hs index 3282bf91..28cdf730 100644 --- a/Stackage/Upload.hs +++ b/Stackage/Upload.hs @@ -16,6 +16,8 @@ module Stackage.Upload , uploadDocMap , uploadBundleV2 , UploadBundleV2 (..) + , def + , unStackageServer ) where import Control.Monad.Writer.Strict (execWriter, tell) @@ -224,6 +226,7 @@ data UploadBundleV2 = UploadBundleV2 uploadBundleV2 :: UploadBundleV2 -> Manager -> IO Text uploadBundleV2 UploadBundleV2 {..} man = IO.withBinaryFile (fpToString ub2Bundle) IO.ReadMode $ \h -> do size <- IO.hFileSize h + putStrLn $ "Bundle size: " ++ tshow size req1 <- parseUrl $ unpack $ unStackageServer ub2Server ++ "/upload2" let req2 = req1 { method = "PUT" diff --git a/app/stackage.hs b/app/stackage.hs index 1b9583c7..c53c4ee4 100644 --- a/app/stackage.hs +++ b/app/stackage.hs @@ -10,7 +10,11 @@ import Options.Applicative import Filesystem.Path.CurrentOS (decodeString) import Paths_stackage (version) import Stackage.CompleteBuild +import Stackage.Upload import Stackage.InstallBuild +import Network.HTTP.Client (withManager) +import Network.HTTP.Client.TLS (tlsManagerSettings) +import qualified Data.Text as T main :: IO () main = @@ -62,7 +66,13 @@ main = installBuild installFlags "install" - "Install a snapshot from an existing build plan"] + "Install a snapshot from an existing build plan" + , cmnd + uploadv2 + uploadv2Flags + "upload2" + "Upload a pre-existing v2 bundle" + ] cmnd exec parse name desc = command name $ @@ -98,7 +108,10 @@ main = help "Output verbose detail about the build steps") <*> switch (long "skip-check" <> - help "Skip the check phase, and pass --allow-newer to cabal configure") + help "Skip the check phase, and pass --allow-newer to cabal configure") <*> + switch + (long "upload-v2" <> + help "Use the V2 upload code") nightlyUploadFlags = fromString <$> strArgument (metavar "DATE" <> @@ -161,3 +174,22 @@ main = switch (long "skip-check" <> help "Skip the check phase, and pass --allow-newer to cabal configure") + + uploadv2 (path, url) = withManager tlsManagerSettings $ \man -> do + token <- getStackageAuthToken + res <- flip uploadBundleV2 man UploadBundleV2 + { ub2AuthToken = token + , ub2Server = fromString url + , ub2Bundle = decodeString path + } + putStrLn $ "New URL: " ++ T.unpack res + + uploadv2Flags = (,) + <$> (strArgument + (metavar "BUNDLE-PATH" <> + help "Bundle path")) + <*> strOption + (long "server-url" <> + metavar "SERVER-URL" <> + showDefault <> value (T.unpack $ unStackageServer def) <> + help "Server to upload bundle to") diff --git a/stackage.cabal b/stackage.cabal index df327327..7efbd149 100644 --- a/stackage.cabal +++ b/stackage.cabal @@ -1,5 +1,5 @@ name: stackage -version: 0.5.2 +version: 0.6.0 synopsis: "Stable Hackage," tools for creating a vetted set of packages from Hackage. description: Please see for a description and documentation. homepage: https://github.com/fpco/stackage @@ -75,6 +75,9 @@ executable stackage , stackage , optparse-applicative >= 0.11 , system-filepath + , http-client + , http-client-tls + , text ghc-options: -rtsopts -threaded -with-rtsopts=-N test-suite spec From ca22965695076fbc053c74d0d7df1fc5e349dcf1 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 17 Mar 2015 10:37:27 +0200 Subject: [PATCH 139/208] Upper bound for #476 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 527574db..bed49edf 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -784,6 +784,9 @@ packages: # https://github.com/fpco/stackage/issues/467 - lens < 4.8 + # https://github.com/fpco/stackage/issues/476 + - vector-space < 0.10 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From b872245bb5c0da650edff3c9dde22066559987d4 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 17 Mar 2015 10:37:27 +0200 Subject: [PATCH 140/208] Upper bound for #476 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 4036dc18..9bdd0e63 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -784,6 +784,9 @@ packages: # https://github.com/fpco/stackage/issues/467 - lens < 4.8 + # https://github.com/fpco/stackage/issues/476 + - vector-space < 0.10 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 56e1afd3e61502b1b3705e54ec0323f66d5ff4c7 Mon Sep 17 00:00:00 2001 From: "Adam C. Foltzer" Date: Tue, 17 Mar 2015 15:46:49 -0700 Subject: [PATCH 141/208] Add gitrev Hey, I've been using stackage for months now, might as well start contributing ;) --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 9bdd0e63..39b08db0 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -738,6 +738,9 @@ packages: "Oleg Grenrus oleg.grenrus@iki.fi @phadej": - waitra + + "Adam C. Foltzer acfoltzer@galois.com @acfoltzer": + - gitrev "Stackage upper bounds": From 705c6b28a72b415e45ddf742f16419daeec63679 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 18 Mar 2015 08:37:57 +0200 Subject: [PATCH 142/208] Extra #440 upper bound --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 39b08db0..633134b7 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -770,6 +770,7 @@ packages: # https://github.com/fpco/stackage/issues/440 - th-orphans < 0.9 - file-location < 0.4.7 + - th-desugar < 1.5.1 # https://github.com/fpco/stackage/issues/442 - blaze-builder < 0.4 From 03ac82de687fa2360e4be778f31129e4067a35df Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 18 Mar 2015 08:38:07 +0200 Subject: [PATCH 143/208] Upper bound for #478 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 633134b7..00b9e278 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -791,6 +791,9 @@ packages: # https://github.com/fpco/stackage/issues/476 - vector-space < 0.10 + # https://github.com/fpco/stackage/issues/478 + - linear < 1.18 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 1c71e419b18c047489d4d7d98b60209fa77b544e Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 18 Mar 2015 10:56:51 +0200 Subject: [PATCH 144/208] Fix haddocks --- Stackage/PerformBuild.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index 9ed578b9..41a460de 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -92,7 +92,7 @@ waitForDeps toolMap packageMap activeComps bp pi action = do Nothing | isCoreExe exe -> return () -- https://github.com/jgm/zip-archive/issues/23 - -- | otherwise -> throwSTM $ ToolMissing exe + -- - | otherwise -> throwSTM $ ToolMissing exe | otherwise -> return () Just packages -> ofoldl1' (<|>) packages action From 956060c5d3892ec7f426c4aeea7200729c978c5c Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 18 Mar 2015 11:13:47 +0200 Subject: [PATCH 145/208] Version bump --- stackage.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackage.cabal b/stackage.cabal index 7efbd149..d12c172b 100644 --- a/stackage.cabal +++ b/stackage.cabal @@ -1,5 +1,5 @@ name: stackage -version: 0.6.0 +version: 0.6.0.1 synopsis: "Stable Hackage," tools for creating a vetted set of packages from Hackage. description: Please see for a description and documentation. homepage: https://github.com/fpco/stackage From b7a582c18c886319f13e50681266f1f2b82b41b7 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 18 Mar 2015 12:00:23 +0200 Subject: [PATCH 146/208] Remove upper bounds and close #478 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index a0a665dd..92e45a9c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -791,9 +791,6 @@ packages: # https://github.com/fpco/stackage/issues/476 - vector-space < 0.10 - # https://github.com/fpco/stackage/issues/478 - - linear < 1.18 - # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 52580761e7bd6946b0072a9303047801cc895deb Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 18 Mar 2015 12:22:37 +0200 Subject: [PATCH 147/208] Upper bound for ekmett/linear#70 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 92e45a9c..8191928a 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -791,6 +791,9 @@ packages: # https://github.com/fpco/stackage/issues/476 - vector-space < 0.10 + # https://github.com/ekmett/linear/issues/70 + - linear < 1.18 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From d0138fae7aa50ad7afc1359e94000a44199c014c Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 18 Mar 2015 15:17:03 +0200 Subject: [PATCH 148/208] V2 upload by default, --server-url option when building --- ChangeLog.md | 4 ++++ Stackage/CompleteBuild.hs | 16 +++++++++++----- Stackage/Upload.hs | 1 + app/stackage.hs | 9 +++++++-- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 2aa9aea0..1dddb87e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ +## 0.6.1 + +* Switch to V2 upload by default + ## 0.6.0 * Upload bundle V2 stuff diff --git a/Stackage/CompleteBuild.hs b/Stackage/CompleteBuild.hs index 5f4735e6..fb1cdde5 100644 --- a/Stackage/CompleteBuild.hs +++ b/Stackage/CompleteBuild.hs @@ -40,7 +40,8 @@ data BuildFlags = BuildFlags , bfEnableExecDyn :: !Bool , bfVerbose :: !Bool , bfSkipCheck :: !Bool - , bfUploadV2 :: !Bool + , bfUploadV1 :: !Bool + , bfServer :: !StackageServer } deriving (Show) data BuildType = Nightly | LTS BumpType @@ -253,7 +254,11 @@ completeBuild buildType buildFlags = withManager tlsManagerSettings $ \man -> do } when (bfDoUpload buildFlags) $ - finallyUpload (bfUploadV2 buildFlags) settings man + finallyUpload + (not $ bfUploadV1 buildFlags) + (bfServer buildFlags) + settings + man justUploadNightly :: Text -- ^ nightly date @@ -261,7 +266,7 @@ justUploadNightly justUploadNightly day = do plan <- decodeFileEither (fpToString $ nightlyPlanFile day) >>= either throwM return - withManager tlsManagerSettings $ finallyUpload False $ nightlySettings day plan + withManager tlsManagerSettings $ finallyUpload False def $ nightlySettings day plan getStackageAuthToken :: IO Text getStackageAuthToken = do @@ -273,8 +278,9 @@ getStackageAuthToken = do -- | The final part of the complete build process: uploading a bundle, -- docs and a distro to hackage. finallyUpload :: Bool -- ^ use v2 upload + -> StackageServer -> Settings -> Manager -> IO () -finallyUpload useV2 settings@Settings{..} man = do +finallyUpload useV2 server settings@Settings{..} man = do putStrLn "Uploading bundle to Stackage Server" token <- getStackageAuthToken @@ -282,7 +288,7 @@ finallyUpload useV2 settings@Settings{..} man = do if useV2 then do res <- flip uploadBundleV2 man UploadBundleV2 - { ub2Server = def + { ub2Server = server , ub2AuthToken = token , ub2Bundle = bundleDest } diff --git a/Stackage/Upload.hs b/Stackage/Upload.hs index 28cdf730..64d21094 100644 --- a/Stackage/Upload.hs +++ b/Stackage/Upload.hs @@ -17,6 +17,7 @@ module Stackage.Upload , uploadBundleV2 , UploadBundleV2 (..) , def + , StackageServer , unStackageServer ) where diff --git a/app/stackage.hs b/app/stackage.hs index c53c4ee4..75e83108 100644 --- a/app/stackage.hs +++ b/app/stackage.hs @@ -110,8 +110,13 @@ main = (long "skip-check" <> help "Skip the check phase, and pass --allow-newer to cabal configure") <*> switch - (long "upload-v2" <> - help "Use the V2 upload code") + (long "upload-v1" <> + help "Use the V1 upload code") <*> + (fmap fromString (strOption + (long "server-url" <> + metavar "SERVER-URL" <> + showDefault <> value (T.unpack $ unStackageServer def) <> + help "Server to upload bundle to"))) nightlyUploadFlags = fromString <$> strArgument (metavar "DATE" <> From 076c477905575fead6fb672b7b116373d3aeeaf9 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 18 Mar 2015 15:45:54 +0200 Subject: [PATCH 149/208] skip-hoogle options --- ChangeLog.md | 1 + Stackage/CompleteBuild.hs | 2 ++ Stackage/InstallBuild.hs | 2 ++ Stackage/PerformBuild.hs | 17 +++++++++++------ app/stackage.hs | 14 ++++++++++++-- 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 1dddb87e..d168d7e0 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,7 @@ ## 0.6.1 * Switch to V2 upload by default +* --skip-hoogle option ## 0.6.0 diff --git a/Stackage/CompleteBuild.hs b/Stackage/CompleteBuild.hs index fb1cdde5..ee4996d6 100644 --- a/Stackage/CompleteBuild.hs +++ b/Stackage/CompleteBuild.hs @@ -42,6 +42,7 @@ data BuildFlags = BuildFlags , bfSkipCheck :: !Bool , bfUploadV1 :: !Bool , bfServer :: !StackageServer + , bfBuildHoogle :: !Bool } deriving (Show) data BuildType = Nightly | LTS BumpType @@ -221,6 +222,7 @@ getPerformBuild buildFlags Settings {..} = PerformBuild , pbEnableExecDyn = bfEnableExecDyn buildFlags , pbVerbose = bfVerbose buildFlags , pbAllowNewer = bfSkipCheck buildFlags + , pbBuildHoogle = bfBuildHoogle buildFlags } -- | Make a complete plan, build, test and upload bundle, docs and diff --git a/Stackage/InstallBuild.hs b/Stackage/InstallBuild.hs index 757939a7..2f896e35 100644 --- a/Stackage/InstallBuild.hs +++ b/Stackage/InstallBuild.hs @@ -33,6 +33,7 @@ data InstallFlags = InstallFlags , ifEnableExecDyn :: !Bool , ifVerbose :: !Bool , ifSkipCheck :: !Bool + , ifBuildHoogle :: !Bool } deriving (Show) -- | Source for build plan. @@ -55,6 +56,7 @@ getPerformBuild plan InstallFlags{..} = , pbEnableExecDyn = ifEnableExecDyn , pbVerbose = ifVerbose , pbAllowNewer = ifSkipCheck + , pbBuildHoogle = ifBuildHoogle } -- | Install stackage from an existing build plan. diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs index 41a460de..06c1edc6 100644 --- a/Stackage/PerformBuild.hs +++ b/Stackage/PerformBuild.hs @@ -69,6 +69,10 @@ data PerformBuild = PerformBuild , pbVerbose :: Bool , pbAllowNewer :: Bool -- ^ Pass --allow-newer to cabal configure + , pbBuildHoogle :: Bool + -- ^ Should we build Hoogle database? + -- + -- May be disabled due to: https://ghc.haskell.org/trac/ghc/ticket/9921 } data PackageInfo = PackageInfo @@ -421,12 +425,13 @@ singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = , "/," , fpToText hf ] - args = "haddock" - : "--hyperlink-source" - : "--html" - : "--hoogle" - : "--html-location=../$pkg-$version/" - : hfsOpts + args = ($ hfsOpts) $ execWriter $ do + let tell' x = tell (x:) + tell' "haddock" + tell' "--hyperlink-source" + tell' "--html" + when pbBuildHoogle $ tell' "--hoogle" + tell' "--html-location=../$pkg-$version/" eres <- tryAny $ run "cabal" args diff --git a/app/stackage.hs b/app/stackage.hs index 75e83108..d2618da2 100644 --- a/app/stackage.hs +++ b/app/stackage.hs @@ -116,7 +116,12 @@ main = (long "server-url" <> metavar "SERVER-URL" <> showDefault <> value (T.unpack $ unStackageServer def) <> - help "Server to upload bundle to"))) + help "Server to upload bundle to"))) <*> + fmap + not + (switch + (long "skip-hoogle" <> + help "Skip generating Hoogle input files")) nightlyUploadFlags = fromString <$> strArgument (metavar "DATE" <> @@ -178,7 +183,12 @@ main = help "Output verbose detail about the build steps") <*> switch (long "skip-check" <> - help "Skip the check phase, and pass --allow-newer to cabal configure") + help "Skip the check phase, and pass --allow-newer to cabal configure") <*> + fmap + not + (switch + (long "skip-hoogle" <> + help "Skip generating Hoogle input files")) uploadv2 (path, url) = withManager tlsManagerSettings $ \man -> do token <- getStackageAuthToken From baf7dca591bb2af70affdce4a5383522e3d2ef3d Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 19 Mar 2015 07:51:42 +0200 Subject: [PATCH 150/208] Upper bound for #479 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 8191928a..bc5ea9d3 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -794,6 +794,9 @@ packages: # https://github.com/ekmett/linear/issues/70 - linear < 1.18 + # https://github.com/fpco/stackage/issues/479 + - QuickCheck < 2.8 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 08c674509fe4370a080221fed299bec2cb927ba8 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 19 Mar 2015 07:55:57 +0200 Subject: [PATCH 151/208] Another upper bound on #440 --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index bc5ea9d3..9907bce6 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -771,6 +771,7 @@ packages: - th-orphans < 0.9 - file-location < 0.4.7 - th-desugar < 1.5.1 + - singletons < 1.1.1 # https://github.com/fpco/stackage/issues/442 - blaze-builder < 0.4 From c71cbd72decac6d427214a902f6fa64921190e8c Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Wed, 18 Mar 2015 23:59:58 -0700 Subject: [PATCH 152/208] Add executable-hash --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 9907bce6..f14892a8 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -67,6 +67,7 @@ packages: - csv-conduit - diagrams-cairo - dimensional + - executable-hash - executable-path - fgl - fixed-list From e8304baaf9b29a8f623f0f1d0f86c38dd8635203 Mon Sep 17 00:00:00 2001 From: ___ Date: Thu, 19 Mar 2015 14:34:41 +0000 Subject: [PATCH 153/208] Add jose-jwt library --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index f14892a8..6a9c58a7 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -743,6 +743,9 @@ packages: "Adam C. Foltzer acfoltzer@galois.com @acfoltzer": - gitrev + "Luke Taylor tekul.hs@gmail.com @tekul": + - jose-jwt + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From 38fd5a2b4a5124d9479f6cc4f2489919625cf44f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 19 Mar 2015 17:34:40 +0200 Subject: [PATCH 154/208] Expected test failure jose-jwt #482 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 6a9c58a7..05926055 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1087,6 +1087,9 @@ expected-test-failures: # Requires locally running services - network-anonymous-i2p + # https://github.com/fpco/stackage/pull/482#issuecomment-83635207 + - jose-jwt + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From a54f2711c57ef26db24e213db1f495ba97bc5c5f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 19 Mar 2015 19:11:58 +0200 Subject: [PATCH 155/208] Disable doctest for jose-jwt --- build-constraints.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 05926055..d969cf0d 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -857,6 +857,10 @@ package-flags: two-point-one: true two-point-two: false + # https://github.com/fpco/stackage/pull/482#issuecomment-83635207 + jose-jwt: + doctest: false + # By skipping a test suite, we do not pull in the build dependencies skipped-tests: - ReadArgs # old version of hspec @@ -1087,9 +1091,6 @@ expected-test-failures: # Requires locally running services - network-anonymous-i2p - # https://github.com/fpco/stackage/pull/482#issuecomment-83635207 - - jose-jwt - # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 2b3e44bbffc32dfc4dcc708ef7962c7584354943 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 20 Mar 2015 08:02:42 +0200 Subject: [PATCH 156/208] Upper bound for #483 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index d969cf0d..96d76ef2 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -802,6 +802,9 @@ packages: # https://github.com/fpco/stackage/issues/479 - QuickCheck < 2.8 + # https://github.com/fpco/stackage/issues/483 + - rethinkdb-client-driver < 0.0.15 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 452687cd61bbb26f72887c5d44de0f513fad8e4e Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 09:28:48 +0200 Subject: [PATCH 157/208] Upper bound for #484 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 96d76ef2..8657ff32 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -805,6 +805,9 @@ packages: # https://github.com/fpco/stackage/issues/483 - rethinkdb-client-driver < 0.0.15 + # https://github.com/fpco/stackage/issues/484 + - opaleye < 0.3.1.1 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 5dd8ca466c93c83b8e79e91e361417ef19dbc3d7 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 12:35:33 +0200 Subject: [PATCH 158/208] Upper bound for #485 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 8657ff32..a0d0652b 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -808,6 +808,9 @@ packages: # https://github.com/fpco/stackage/issues/484 - opaleye < 0.3.1.1 + # https://github.com/fpco/stackage/issues/485 + - parsec < 3.1.9 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 8f95d1879cc32c8180fd304283817d18bab19f1b Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 12:58:07 +0200 Subject: [PATCH 159/208] Remove upper bounds and close #484 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index a0d0652b..7596251a 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -805,9 +805,6 @@ packages: # https://github.com/fpco/stackage/issues/483 - rethinkdb-client-driver < 0.0.15 - # https://github.com/fpco/stackage/issues/484 - - opaleye < 0.3.1.1 - # https://github.com/fpco/stackage/issues/485 - parsec < 3.1.9 From 1891c1bfa79910555aeed6f105672acf8296d642 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 13:25:31 +0200 Subject: [PATCH 160/208] Separate out stackage-curator --- .gitignore | 9 - ChangeLog.md | 64 --- Dockerfile | 25 - README.md | 12 +- Setup.hs | 2 - Stackage/BuildConstraints.hs | 234 --------- Stackage/BuildPlan.hs | 214 -------- Stackage/CheckBuildPlan.hs | 162 ------ Stackage/CompleteBuild.hs | 337 ------------ Stackage/CorePackages.hs | 53 -- Stackage/GhcPkg.hs | 104 ---- Stackage/GithubPings.hs | 36 -- Stackage/InstallBuild.hs | 102 ---- Stackage/PackageDescription.hs | 200 ------- Stackage/PackageIndex.hs | 127 ----- Stackage/PerformBuild.hs | 560 -------------------- Stackage/Prelude.hs | 116 ---- Stackage/ServerBundle.hs | 271 ---------- Stackage/UpdateBuildPlan.hs | 54 -- Stackage/Upload.hs | 272 ---------- app/stackage.hs | 210 -------- build-constraints.yaml | 1 + cabal.config | 847 ------------------------------ debian-bootstrap.sh | 71 --- stackage.cabal | 105 ---- test/Spec.hs | 1 - test/Stackage/BuildPlanSpec.hs | 143 ----- test/Stackage/CorePackagesSpec.hs | 19 - test/Stackage/PackageIndexSpec.hs | 21 - test/test-build-constraints.yaml | 20 - 30 files changed, 9 insertions(+), 4383 deletions(-) delete mode 100644 ChangeLog.md delete mode 100644 Dockerfile delete mode 100644 Setup.hs delete mode 100644 Stackage/BuildConstraints.hs delete mode 100644 Stackage/BuildPlan.hs delete mode 100644 Stackage/CheckBuildPlan.hs delete mode 100644 Stackage/CompleteBuild.hs delete mode 100644 Stackage/CorePackages.hs delete mode 100644 Stackage/GhcPkg.hs delete mode 100644 Stackage/GithubPings.hs delete mode 100644 Stackage/InstallBuild.hs delete mode 100644 Stackage/PackageDescription.hs delete mode 100644 Stackage/PackageIndex.hs delete mode 100644 Stackage/PerformBuild.hs delete mode 100644 Stackage/Prelude.hs delete mode 100644 Stackage/ServerBundle.hs delete mode 100644 Stackage/UpdateBuildPlan.hs delete mode 100644 Stackage/Upload.hs delete mode 100644 app/stackage.hs delete mode 100644 cabal.config delete mode 100755 debian-bootstrap.sh delete mode 100644 stackage.cabal delete mode 100644 test/Spec.hs delete mode 100644 test/Stackage/BuildPlanSpec.hs delete mode 100644 test/Stackage/CorePackagesSpec.hs delete mode 100644 test/Stackage/PackageIndexSpec.hs delete mode 100644 test/test-build-constraints.yaml diff --git a/.gitignore b/.gitignore index a153cdeb..6b60ace9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,4 @@ -dist -*.o -*.hi -*.chi -*.chs.h -*.swp /builds/ /logs/ -/.cabal-sandbox/ -cabal.sandbox.config nightly-*.yaml lts-*.yaml -/tarballs/ diff --git a/ChangeLog.md b/ChangeLog.md deleted file mode 100644 index d168d7e0..00000000 --- a/ChangeLog.md +++ /dev/null @@ -1,64 +0,0 @@ -## 0.6.1 - -* Switch to V2 upload by default -* --skip-hoogle option - -## 0.6.0 - -* Upload bundle V2 stuff - -## 0.5.2 - -* Upload LTS to Hackage with the name LTSHaskell - -## 0.5.1 - -* `loadBuildConstraints` -* More command line options - -## 0.5.0 - -* Print "Still Alive" while checking, to avoid Travis timeouts -* Include `stackage upload-nightly` command -* Optional plan checking - -## 0.4.0 - -* Command line uses optparse-applicative with additional options -* Library profiling support during build -* Remove cfGlobalFlags (just use package-specific flags) - -## 0.3.1 - -* Added `justCheck` and `stackage check` command line. - -## 0.3.0.1 - -Pre-fetch all packages from Hackage to catch Hackage downtime early. - -## 0.3.0.0 - -* Return progress URL from uploadBundle - -## 0.2.1.4 - -Generate a `core` file in bundles. - -## 0.2.1.1 - -Run postBuild earlier to avoid problems from broken doc uploads. - -## 0.2.1.0 - -* Use TLS manager (to download from Github) - -## 0.2.0.0 - -* Minor fixes -* `pbGlobalInstall` - -## 0.1.0.0 - -First version of Stackage which is made available as its own package. The -codebase has been completely rewritten at this point, to be ready for generated -both Stackage Nightly and LTS Haskell distributions. diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index c3956908..00000000 --- a/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM ubuntu:12.04 - -ENV HOME /home/stackage -ENV LANG en_US.UTF-8 - -RUN mkdir /home/stackage -p -RUN locale-gen en_US.UTF-8 - -RUN DEBIAN_FRONTEND=noninteractive apt-get update -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common python-software-properties -RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:hvr/ghc -y - -ADD debian-bootstrap.sh /tmp/debian-bootstrap.sh -RUN DEBIAN_FRONTEND=noninteractive bash /tmp/debian-bootstrap.sh -RUN rm /tmp/debian-bootstrap.sh - -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cabal-install-1.20 ghc-7.8.4 alex-3.1.3 happy-1.19.4 - -ENV PATH /home/stackage/.cabal/bin:/usr/local/sbin:/usr/local/bin:/opt/ghc/7.8.4/bin:/opt/cabal/1.20/bin:/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:/usr/sbin:/usr/bin:/sbin:/bin - -RUN cabal update -ADD . /tmp/stackage -RUN cd /tmp/stackage && cabal install . hscolour cabal-install --constraint "Cabal < 1.22" && cp $HOME/.cabal/bin/* /usr/local/bin && rm -rf $HOME/.cabal $HOME/.ghc /tmp/stackage - -RUN cd /home/stackage && cabal update && stackage check diff --git a/README.md b/README.md index 82a9802d..848c9744 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,14 @@ __NOTE__ This repository is for package authors to get their code into Stackage. If you simply want to use Stackage as an end user, please follow the instructions on [http://www.stackage.org/](http://www.stackage.org). -A note about the codebase: the goal is to minimize dependencies and have -the maximum range of supported compiler versions. Therefore, we avoid -anything "complicated." For example, instead of using the text package, -we use Strings everywhere. +The Stackage project consists of multiple repositories. This repository +contains the metadata on packages to be included in future builds and some +project information. In addition, we have the following repositories: + +* [stackage-server](https://github.com/fpco/stackage-server) +* [stackage-curator](https://github.com/fpco/stackage-curator) +* [stackage-types](https://github.com/fpco/stackage-types) +* [lts-haskell](https://github.com/fpco/lts-haskell) Get your package included ------------------------- diff --git a/Setup.hs b/Setup.hs deleted file mode 100644 index 9a994af6..00000000 --- a/Setup.hs +++ /dev/null @@ -1,2 +0,0 @@ -import Distribution.Simple -main = defaultMain diff --git a/Stackage/BuildConstraints.hs b/Stackage/BuildConstraints.hs deleted file mode 100644 index c4ce1ceb..00000000 --- a/Stackage/BuildConstraints.hs +++ /dev/null @@ -1,234 +0,0 @@ -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE TupleSections #-} --- | The constraints on package selection for a new build plan. -module Stackage.BuildConstraints - ( BuildConstraints (..) - , PackageConstraints (..) - , TestState (..) - , SystemInfo (..) - , getSystemInfo - , defaultBuildConstraints - , toBC - , BuildConstraintsSource (..) - , loadBuildConstraints - ) where - -import Control.Monad.Writer.Strict (execWriter, tell) -import Data.Aeson -import qualified Data.Map as Map -import Data.Yaml (decodeEither', decodeFileEither) -import Distribution.Package (Dependency (..)) -import Distribution.System (Arch, OS) -import qualified Distribution.System -import Distribution.Version (anyVersion) -import Filesystem (isFile) -import Network.HTTP.Client (Manager, httpLbs, responseBody, Request) -import Stackage.CorePackages -import Stackage.Prelude - -data TestState = ExpectSuccess - | ExpectFailure - | Don'tBuild -- ^ when the test suite will pull in things we don't want - deriving (Show, Eq, Ord, Bounded, Enum) - -testStateToText :: TestState -> Text -testStateToText ExpectSuccess = "expect-success" -testStateToText ExpectFailure = "expect-failure" -testStateToText Don'tBuild = "do-not-build" - -instance ToJSON TestState where - toJSON = toJSON . testStateToText -instance FromJSON TestState where - parseJSON = withText "TestState" $ \t -> - case lookup t states of - Nothing -> fail $ "Invalid state: " ++ unpack t - Just v -> return v - where - states = asHashMap $ mapFromList - $ map (\x -> (testStateToText x, x)) [minBound..maxBound] - -data SystemInfo = SystemInfo - { siGhcVersion :: Version - , siOS :: OS - , siArch :: Arch - , siCorePackages :: Map PackageName Version - , siCoreExecutables :: Set ExeName - } - deriving (Show, Eq, Ord) -instance ToJSON SystemInfo where - toJSON SystemInfo {..} = object - [ "ghc-version" .= display siGhcVersion - , "os" .= display siOS - , "arch" .= display siArch - , "core-packages" .= Map.mapKeysWith const unPackageName (map display siCorePackages) - , "core-executables" .= siCoreExecutables - ] -instance FromJSON SystemInfo where - parseJSON = withObject "SystemInfo" $ \o -> do - let helper name = (o .: name) >>= either (fail . show) return . simpleParse - siGhcVersion <- helper "ghc-version" - siOS <- helper "os" - siArch <- helper "arch" - siCorePackages <- (o .: "core-packages") >>= goPackages - siCoreExecutables <- o .: "core-executables" - return SystemInfo {..} - where - goPackages = either (fail . show) return - . mapM simpleParse - . Map.mapKeysWith const mkPackageName - -data BuildConstraints = BuildConstraints - { bcPackages :: Set PackageName - -- ^ This does not include core packages. - , bcPackageConstraints :: PackageName -> PackageConstraints - - , bcSystemInfo :: SystemInfo - - , bcGithubUsers :: Map Text (Set Text) - -- ^ map an account to set of pingees - } - -data PackageConstraints = PackageConstraints - { pcVersionRange :: VersionRange - , pcMaintainer :: Maybe Maintainer - , pcTests :: TestState - , pcHaddocks :: TestState - , pcBuildBenchmarks :: Bool - , pcFlagOverrides :: Map FlagName Bool - , pcEnableLibProfile :: Bool - } - deriving (Show, Eq) -instance ToJSON PackageConstraints where - toJSON PackageConstraints {..} = object $ addMaintainer - [ "version-range" .= display pcVersionRange - , "tests" .= pcTests - , "haddocks" .= pcHaddocks - , "build-benchmarks" .= pcBuildBenchmarks - , "flags" .= Map.mapKeysWith const unFlagName pcFlagOverrides - , "library-profiling" .= pcEnableLibProfile - ] - where - addMaintainer = maybe id (\m -> (("maintainer" .= m):)) pcMaintainer -instance FromJSON PackageConstraints where - parseJSON = withObject "PackageConstraints" $ \o -> do - pcVersionRange <- (o .: "version-range") - >>= either (fail . show) return . simpleParse - pcTests <- o .: "tests" - pcHaddocks <- o .: "haddocks" - pcBuildBenchmarks <- o .: "build-benchmarks" - pcFlagOverrides <- Map.mapKeysWith const mkFlagName <$> o .: "flags" - pcMaintainer <- o .:? "maintainer" - pcEnableLibProfile <- fmap (fromMaybe True) (o .:? "library-profiling") - return PackageConstraints {..} - --- | The proposed plan from the requirements provided by contributors. --- --- Checks the current directory for a build-constraints.yaml file and uses it --- if present. If not, downloads from Github. -defaultBuildConstraints :: Manager -> IO BuildConstraints -defaultBuildConstraints = loadBuildConstraints BCSDefault - -data BuildConstraintsSource - = BCSDefault - | BCSFile FilePath - | BCSWeb Request - deriving (Show) - -loadBuildConstraints :: BuildConstraintsSource -> Manager -> IO BuildConstraints -loadBuildConstraints bcs man = do - case bcs of - BCSDefault -> do - e <- isFile fp0 - if e - then loadFile fp0 - else loadReq req0 - BCSFile fp -> loadFile fp - BCSWeb req -> loadReq req - where - fp0 = "build-constraints.yaml" - req0 = "https://raw.githubusercontent.com/fpco/stackage/master/build-constraints.yaml" - - loadFile fp = decodeFileEither (fpToString fp) >>= either throwIO toBC - loadReq req = httpLbs req man >>= - either throwIO toBC . decodeEither' . toStrict . responseBody - - -getSystemInfo :: IO SystemInfo -getSystemInfo = do - siCorePackages <- getCorePackages - siCoreExecutables <- getCoreExecutables - siGhcVersion <- getGhcVersion - return SystemInfo {..} - where - -- FIXME consider not hard-coding the next two values - siOS = Distribution.System.Linux - siArch = Distribution.System.X86_64 - -data ConstraintFile = ConstraintFile - { cfPackageFlags :: Map PackageName (Map FlagName Bool) - , cfSkippedTests :: Set PackageName - , cfExpectedTestFailures :: Set PackageName - , cfExpectedHaddockFailures :: Set PackageName - , cfSkippedBenchmarks :: Set PackageName - , cfPackages :: Map Maintainer (Vector Dependency) - , cfGithubUsers :: Map Text (Set Text) - , cfSkippedLibProfiling :: Set PackageName - } - -instance FromJSON ConstraintFile where - parseJSON = withObject "ConstraintFile" $ \o -> do - cfPackageFlags <- (goPackageMap . fmap goFlagMap) <$> o .: "package-flags" - cfSkippedTests <- getPackages o "skipped-tests" - cfExpectedTestFailures <- getPackages o "expected-test-failures" - cfExpectedHaddockFailures <- getPackages o "expected-haddock-failures" - cfSkippedBenchmarks <- getPackages o "skipped-benchmarks" - cfSkippedLibProfiling <- getPackages o "skipped-profiling" - cfPackages <- o .: "packages" - >>= mapM (mapM toDep) - . Map.mapKeysWith const Maintainer - cfGithubUsers <- o .: "github-users" - return ConstraintFile {..} - where - goFlagMap = Map.mapKeysWith const FlagName - goPackageMap = Map.mapKeysWith const PackageName - getPackages o name = (setFromList . map PackageName) <$> o .: name - - toDep :: Monad m => Text -> m Dependency - toDep = either (fail . show) return . simpleParse - -toBC :: ConstraintFile -> IO BuildConstraints -toBC ConstraintFile {..} = do - bcSystemInfo <- getSystemInfo - return BuildConstraints {..} - where - combine (maintainer, range1) (_, range2) = - (maintainer, intersectVersionRanges range1 range2) - revmap = unionsWith combine $ ($ []) $ execWriter - $ forM_ (mapToList cfPackages) - $ \(maintainer, deps) -> forM_ deps - $ \(Dependency name range) -> - tell (singletonMap name (maintainer, range):) - - bcPackages = Map.keysSet revmap - - bcPackageConstraints name = - PackageConstraints {..} - where - mpair = lookup name revmap - pcMaintainer = fmap fst mpair - pcVersionRange = maybe anyVersion snd mpair - pcEnableLibProfile = not (name `member` cfSkippedLibProfiling) - pcTests - | name `member` cfSkippedTests = Don'tBuild - | name `member` cfExpectedTestFailures = ExpectFailure - | otherwise = ExpectSuccess - pcBuildBenchmarks = name `notMember` cfSkippedBenchmarks - pcHaddocks - | name `member` cfExpectedHaddockFailures = ExpectFailure - - | otherwise = ExpectSuccess - pcFlagOverrides = fromMaybe mempty $ lookup name cfPackageFlags - - bcGithubUsers = cfGithubUsers diff --git a/Stackage/BuildPlan.hs b/Stackage/BuildPlan.hs deleted file mode 100644 index b8bc5376..00000000 --- a/Stackage/BuildPlan.hs +++ /dev/null @@ -1,214 +0,0 @@ -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE DeriveFoldable #-} -{-# LANGUAGE DeriveFunctor #-} -{-# LANGUAGE DeriveTraversable #-} -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE TupleSections #-} -{-# LANGUAGE TypeFamilies #-} --- | Representation of a concrete build plan, and how to generate a new one --- based on constraints. -module Stackage.BuildPlan - ( BuildPlan (..) - , PackagePlan (..) - , newBuildPlan - , makeToolMap - , getLatestAllowedPlans - ) where - -import Control.Monad.State.Strict (execState, get, put) -import Data.Aeson -import qualified Data.Map as Map -import qualified Data.Set as Set -import qualified Distribution.Compiler -import Distribution.PackageDescription -import Stackage.BuildConstraints -import Stackage.GithubPings -import Stackage.PackageDescription -import Stackage.PackageIndex -import Stackage.Prelude - -data BuildPlan = BuildPlan - { bpSystemInfo :: SystemInfo - , bpTools :: Vector (PackageName, Version) - , bpPackages :: Map PackageName PackagePlan - , bpGithubUsers :: Map Text (Set Text) - } - deriving (Show, Eq) - -instance ToJSON BuildPlan where - toJSON BuildPlan {..} = object - [ "system-info" .= bpSystemInfo - , "tools" .= map goTool bpTools - , "packages" .= Map.mapKeysWith const unPackageName bpPackages - , "github-users" .= bpGithubUsers - ] - where - goTool (k, v) = object - [ "name" .= display k - , "version" .= display v - ] -instance FromJSON BuildPlan where - parseJSON = withObject "BuildPlan" $ \o -> do - bpSystemInfo <- o .: "system-info" - bpTools <- (o .: "tools") >>= mapM goTool - bpPackages <- Map.mapKeysWith const mkPackageName <$> (o .: "packages") - bpGithubUsers <- o .:? "github-users" .!= mempty - return BuildPlan {..} - where - goTool = withObject "Tool" $ \o -> (,) - <$> ((o .: "name") >>= - either (fail . show) return . simpleParse . asText) - <*> ((o .: "version") >>= - either (fail . show) return . simpleParse . asText) - -data PackagePlan = PackagePlan - { ppVersion :: Version - , ppGithubPings :: Set Text - , ppUsers :: Set PackageName - , ppConstraints :: PackageConstraints - , ppDesc :: SimpleDesc - } - deriving (Show, Eq) - -instance ToJSON PackagePlan where - toJSON PackagePlan {..} = object - [ "version" .= asText (display ppVersion) - , "github-pings" .= ppGithubPings - , "users" .= map unPackageName (unpack ppUsers) - , "constraints" .= ppConstraints - , "description" .= ppDesc - ] -instance FromJSON PackagePlan where - parseJSON = withObject "PackageBuild" $ \o -> do - ppVersion <- o .: "version" - >>= either (fail . show) return - . simpleParse . asText - ppGithubPings <- o .:? "github-pings" .!= mempty - ppUsers <- Set.map PackageName <$> (o .:? "users" .!= mempty) - ppConstraints <- o .: "constraints" - ppDesc <- o .: "description" - return PackagePlan {..} - --- | Make a build plan given these package set and build constraints. -newBuildPlan :: MonadIO m => Map PackageName PackagePlan -> BuildConstraints -> m BuildPlan -newBuildPlan packagesOrig bc@BuildConstraints {..} = liftIO $ do - let toolMap = makeToolMap packagesOrig - packages = populateUsers $ removeUnincluded bc toolMap packagesOrig - toolNames :: [ExeName] - toolNames = concatMap (Map.keys . sdTools . ppDesc) packages - tools <- topologicalSortTools toolMap $ mapFromList $ do - exeName <- toolNames - guard $ exeName `notMember` siCoreExecutables - packageName <- maybe mempty setToList $ lookup exeName toolMap - packagePlan <- maybeToList $ lookup packageName packagesOrig - return (packageName, packagePlan) - -- FIXME topologically sort packages? maybe just leave that to the build phase - return BuildPlan - { bpSystemInfo = bcSystemInfo - , bpTools = tools - , bpPackages = packages - , bpGithubUsers = bcGithubUsers - } - where - SystemInfo {..} = bcSystemInfo - -makeToolMap :: Map PackageName PackagePlan - -> Map ExeName (Set PackageName) -makeToolMap = - unionsWith (++) . map go . mapToList - where - go (packageName, pp) = - foldMap go' $ sdProvidedExes $ ppDesc pp - where - go' exeName = singletonMap exeName (singletonSet packageName) - -topologicalSortTools :: MonadThrow m - => Map ExeName (Set PackageName) - -> Map PackageName PackagePlan - -> m (Vector (PackageName, Version)) -topologicalSortTools toolMap = topologicalSort - ppVersion - (concatMap (fromMaybe mempty . flip lookup toolMap) . Map.keys . sdTools . ppDesc) - --- | Include only packages which are dependencies of the required packages and --- their build tools. -removeUnincluded :: BuildConstraints - -> Map ExeName (Set PackageName) - -> Map PackageName PackagePlan - -> Map PackageName PackagePlan -removeUnincluded BuildConstraints {..} toolMap orig = - mapFromList $ filter (\(x, _) -> x `member` included) $ mapToList orig - where - SystemInfo {..} = bcSystemInfo - - included :: Set PackageName - included = flip execState mempty $ mapM_ add bcPackages - - add name = do - inc <- get - when (name `notMember` inc) $ do - put $ insertSet name inc - case lookup name orig of - Nothing -> return () - Just pb -> do - mapM_ add $ Map.keys $ sdPackages $ ppDesc pb - forM_ (Map.keys $ sdTools $ ppDesc pb) $ - \exeName -> when (exeName `notMember` siCoreExecutables) - $ mapM_ add $ fromMaybe mempty $ lookup exeName toolMap - -populateUsers :: Map PackageName PackagePlan - -> Map PackageName PackagePlan -populateUsers orig = - mapWithKey go orig - where - go name pb = pb { ppUsers = foldMap (go2 name) (mapToList orig) } - - go2 dep (user, pb) - | dep `member` sdPackages (ppDesc pb) = singletonSet user - | otherwise = mempty - --- | Check whether the given package/version combo meets the constraints --- currently in place. -isAllowed :: BuildConstraints - -> PackageName -> Version -> Bool -isAllowed bc = \name version -> - case lookup name $ siCorePackages $ bcSystemInfo bc of - Just _ -> False -- never reinstall a core package - Nothing -> withinRange version $ pcVersionRange $ bcPackageConstraints bc name - -mkPackagePlan :: MonadThrow m - => BuildConstraints - -> GenericPackageDescription - -> m PackagePlan -mkPackagePlan bc gpd = do - ppDesc <- toSimpleDesc CheckCond {..} gpd - return PackagePlan {..} - where - PackageIdentifier name ppVersion = package $ packageDescription gpd - ppGithubPings = getGithubPings bc gpd - ppConstraints = bcPackageConstraints bc name - ppUsers = mempty -- must be filled in later - - ccPackageName = name - ccOS = siOS - ccArch = siArch - ccCompilerFlavor = Distribution.Compiler.GHC - ccCompilerVersion = siGhcVersion - ccFlags = flags - ccIncludeTests = pcTests ppConstraints /= Don'tBuild - ccIncludeBenchmarks = pcBuildBenchmarks ppConstraints - - SystemInfo {..} = bcSystemInfo bc - - overrides = pcFlagOverrides ppConstraints - getFlag MkFlag {..} = - (flagName, fromMaybe flagDefault $ lookup flagName overrides) - flags = mapFromList $ map getFlag $ genPackageFlags gpd - -getLatestAllowedPlans :: MonadIO m => BuildConstraints -> m (Map PackageName PackagePlan) -getLatestAllowedPlans bc = - getLatestDescriptions - (isAllowed bc) - (mkPackagePlan bc) diff --git a/Stackage/CheckBuildPlan.hs b/Stackage/CheckBuildPlan.hs deleted file mode 100644 index 74bf3b83..00000000 --- a/Stackage/CheckBuildPlan.hs +++ /dev/null @@ -1,162 +0,0 @@ -{-# LANGUAGE TupleSections #-} -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE ViewPatterns #-} --- | Confirm that a build plan has a consistent set of dependencies. -module Stackage.CheckBuildPlan - ( checkBuildPlan - , BadBuildPlan - ) where - -import Control.Monad.Writer.Strict (Writer, execWriter, tell) -import qualified Data.Map.Strict as M -import qualified Data.Text as T -import Stackage.BuildConstraints -import Stackage.BuildPlan -import Stackage.PackageDescription -import Stackage.Prelude - --- | Check the build plan for missing deps, wrong versions, etc. -checkBuildPlan :: (MonadThrow m) => BuildPlan -> m () -checkBuildPlan BuildPlan {..} - | null errs' = return () - | otherwise = throwM errs - where - allPackages = map (,mempty) (siCorePackages bpSystemInfo) ++ - map (ppVersion &&& M.keys . M.filter libAndExe . sdPackages . ppDesc) bpPackages - errs@(BadBuildPlan errs') = - execWriter $ mapM_ (checkDeps allPackages) $ mapToList bpPackages - -- Only looking at libraries and executables, benchmarks and tests - -- are allowed to create cycles (e.g. test-framework depends on - -- text, which uses test-framework in its test-suite). - libAndExe (DepInfo cs _) = any (flip elem [CompLibrary,CompExecutable]) cs - --- | For a given package name and plan, check that its dependencies are: --- --- 1. Existent (existing in the provided package map) --- 2. Within version range --- 3. Check for dependency cycles. -checkDeps :: Map PackageName (Version,[PackageName]) - -> (PackageName, PackagePlan) - -> Writer BadBuildPlan () -checkDeps allPackages (user, pb) = - mapM_ go $ mapToList $ sdPackages $ ppDesc pb - where - go (dep, diRange -> range) = - case lookup dep allPackages of - Nothing -> tell $ BadBuildPlan $ singletonMap (dep, Nothing) errMap - Just (version,deps) - | version `withinRange` range -> - occursCheck allPackages - (\d v -> - tell $ BadBuildPlan $ singletonMap - (d,v) - errMap) - dep - deps - [] - | otherwise -> tell $ BadBuildPlan $ singletonMap - (dep, Just version) - errMap - where - errMap = singletonMap pu range - pu = PkgUser - { puName = user - , puVersion = ppVersion pb - , puMaintainer = pcMaintainer $ ppConstraints pb - , puGithubPings = ppGithubPings pb - } - --- | Check whether the package(s) occurs within its own dependency --- tree. -occursCheck - :: Monad m - => Map PackageName (Version,[PackageName]) - -- ^ All packages. - -> (PackageName -> Maybe Version -> m ()) - -- ^ Report an erroneous package. - -> PackageName - -- ^ Starting package to check for cycles in. - -> [PackageName] - -- ^ Dependencies of the package. - -> [PackageName] - -- ^ Previously seen packages up the dependency tree. - -> m () -occursCheck allPackages reportError = - go - where - go pkg deps seen = - case find (flip elem seen) deps of - Just cyclic -> - reportError cyclic $ - fmap fst (lookup cyclic allPackages) - Nothing -> - forM_ deps $ - \pkg' -> - case lookup pkg' allPackages of - Just (_v,deps') - | pkg' /= pkg -> go pkg' deps' seen' - _ -> return () - where seen' = pkg : seen - -data PkgUser = PkgUser - { puName :: PackageName - , puVersion :: Version - , puMaintainer :: Maybe Maintainer - , puGithubPings :: Set Text - } - deriving (Eq, Ord) - -pkgUserShow1 :: PkgUser -> Text -pkgUserShow1 PkgUser {..} = concat - [ display puName - , "-" - , display puVersion - ] - -pkgUserShow2 :: PkgUser -> Text -pkgUserShow2 PkgUser {..} = unwords - $ (maybe "No maintainer" unMaintainer puMaintainer ++ ".") - : map (cons '@') (setToList puGithubPings) - -newtype BadBuildPlan = - BadBuildPlan (Map (PackageName, Maybe Version) (Map PkgUser VersionRange)) - deriving Typeable -instance Exception BadBuildPlan -instance Show BadBuildPlan where - show (BadBuildPlan errs) = - unpack $ concatMap go $ mapToList errs - where - go ((dep, mdepVer), users) = unlines - $ "" - : showDepVer dep mdepVer - : map showUser (mapToList users) - - showDepVer :: PackageName -> Maybe Version -> Text - showDepVer dep Nothing = display dep ++ " (not present) depended on by:" - showDepVer dep (Just version) = concat - [ display dep - , "-" - , display version - , " depended on by:" - ] - - showUser :: (PkgUser, VersionRange) -> Text - showUser (pu, range) = concat - [ "- " - , pkgUserShow1 pu - , " (" - -- add a space after < to avoid confusing Markdown processors (like - -- Github's issue tracker) - , T.replace "<" "< " $ display range - , "). " - , pkgUserShow2 pu - ] - -instance Monoid BadBuildPlan where - mempty = BadBuildPlan mempty - mappend (BadBuildPlan x) (BadBuildPlan y) = - BadBuildPlan $ unionWith (unionWith intersectVersionRanges) x y diff --git a/Stackage/CompleteBuild.hs b/Stackage/CompleteBuild.hs deleted file mode 100644 index ee4996d6..00000000 --- a/Stackage/CompleteBuild.hs +++ /dev/null @@ -1,337 +0,0 @@ -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -module Stackage.CompleteBuild - ( BuildType (..) - , BumpType (..) - , BuildFlags (..) - , completeBuild - , justCheck - , justUploadNightly - , getStackageAuthToken - ) where - -import Control.Concurrent (threadDelay) -import Control.Concurrent.Async (withAsync) -import Data.Default.Class (def) -import Data.Semigroup (Max (..), Option (..)) -import Data.Text.Read (decimal) -import Data.Time -import Data.Yaml (decodeFileEither, encodeFile) -import Network.HTTP.Client -import Network.HTTP.Client.TLS (tlsManagerSettings) -import Stackage.BuildConstraints -import Stackage.BuildPlan -import Stackage.CheckBuildPlan -import Stackage.PerformBuild -import Stackage.Prelude -import Stackage.ServerBundle -import Stackage.UpdateBuildPlan -import Stackage.Upload -import System.Environment (lookupEnv) -import System.IO (BufferMode (LineBuffering), hSetBuffering) - --- | Flags passed in from the command line. -data BuildFlags = BuildFlags - { bfEnableTests :: !Bool - , bfEnableHaddock :: !Bool - , bfDoUpload :: !Bool - , bfEnableLibProfile :: !Bool - , bfEnableExecDyn :: !Bool - , bfVerbose :: !Bool - , bfSkipCheck :: !Bool - , bfUploadV1 :: !Bool - , bfServer :: !StackageServer - , bfBuildHoogle :: !Bool - } deriving (Show) - -data BuildType = Nightly | LTS BumpType - deriving (Show, Read, Eq, Ord) - -data BumpType = Major | Minor - deriving (Show, Read, Eq, Ord) - -data Settings = Settings - { plan :: BuildPlan - , planFile :: FilePath - , buildDir :: FilePath - , logDir :: FilePath - , title :: Text -> Text -- ^ GHC version -> title - , slug :: Text - , setArgs :: Text -> UploadBundle -> UploadBundle - , postBuild :: IO () - , distroName :: Text -- ^ distro name on Hackage - , snapshotType :: SnapshotType - , bundleDest :: FilePath - } - -nightlyPlanFile :: Text -- ^ day - -> FilePath -nightlyPlanFile day = fpFromText ("nightly-" ++ day) <.> "yaml" - -nightlySettings :: Text -- ^ day - -> BuildPlan - -> Settings -nightlySettings day plan' = Settings - { planFile = nightlyPlanFile day - , buildDir = fpFromText $ "builds/nightly" - , logDir = fpFromText $ "logs/stackage-nightly-" ++ day - , title = \ghcVer -> concat - [ "Stackage Nightly " - , day - , ", GHC " - , ghcVer - ] - , slug = slug' - , setArgs = \ghcVer ub -> ub { ubNightly = Just ghcVer } - , plan = plan' - , postBuild = return () - , distroName = "Stackage" - , snapshotType = STNightly - , bundleDest = fpFromText $ "stackage-nightly-" ++ day ++ ".bundle" - } - where - slug' = "nightly-" ++ day - -getSettings :: Manager -> BuildType -> IO Settings -getSettings man Nightly = do - day <- tshow . utctDay <$> getCurrentTime - bc <- defaultBuildConstraints man - pkgs <- getLatestAllowedPlans bc - plan' <- newBuildPlan pkgs bc - return $ nightlySettings day plan' -getSettings man (LTS bumpType) = do - Option mlts <- fmap (fmap getMax) $ runResourceT - $ sourceDirectory "." - $$ foldMapC (Option . fmap Max . parseLTSVer . filename) - - (new, plan') <- case bumpType of - Major -> do - let new = - case mlts of - Nothing -> LTSVer 0 0 - Just (LTSVer x _) -> LTSVer (x + 1) 0 - bc <- defaultBuildConstraints man - pkgs <- getLatestAllowedPlans bc - plan' <- newBuildPlan pkgs bc - return (new, plan') - Minor -> do - old <- maybe (error "No LTS plans found in current directory") return mlts - oldplan <- decodeFileEither (fpToString $ renderLTSVer old) - >>= either throwM return - let new = incrLTSVer old - let bc = updateBuildConstraints oldplan - pkgs <- getLatestAllowedPlans bc - plan' <- newBuildPlan pkgs bc - return (new, plan') - - let newfile = renderLTSVer new - - return Settings - { planFile = newfile - , buildDir = fpFromText $ "builds/lts" - , logDir = fpFromText $ "logs/stackage-lts-" ++ tshow new - , title = \ghcVer -> concat - [ "LTS Haskell " - , tshow new - , ", GHC " - , ghcVer - ] - , slug = "lts-" ++ tshow new - , setArgs = \_ ub -> ub { ubLTS = Just $ tshow new } - , plan = plan' - , postBuild = do - let git args = withCheckedProcess - (proc "git" args) $ \ClosedStream Inherited Inherited -> - return () - putStrLn "Committing new LTS file to Git" - git ["add", fpToString newfile] - git ["commit", "-m", "Added new LTS release: " ++ show new] - putStrLn "Pushing to Git repository" - git ["push"] - , distroName = "LTSHaskell" - , snapshotType = - case new of - LTSVer x y -> STLTS x y - , bundleDest = fpFromText $ "stackage-lts-" ++ tshow new ++ ".bundle" - } - -data LTSVer = LTSVer !Int !Int - deriving (Eq, Ord) -instance Show LTSVer where - show (LTSVer x y) = concat [show x, ".", show y] -incrLTSVer :: LTSVer -> LTSVer -incrLTSVer (LTSVer x y) = LTSVer x (y + 1) - -parseLTSVer :: FilePath -> Maybe LTSVer -parseLTSVer fp = do - w <- stripPrefix "lts-" $ fpToText fp - x <- stripSuffix ".yaml" w - Right (major, y) <- Just $ decimal x - z <- stripPrefix "." y - Right (minor, "") <- Just $ decimal z - return $ LTSVer major minor -renderLTSVer :: LTSVer -> FilePath -renderLTSVer lts = fpFromText $ concat - [ "lts-" - , tshow lts - , ".yaml" - ] - --- | Just print a message saying "still alive" every minute, to appease Travis. -stillAlive :: IO () -> IO () -stillAlive inner = - withAsync (printer 1) $ const inner - where - printer i = forever $ do - threadDelay 60000000 - putStrLn $ "Still alive: " ++ tshow i - printer $! i + 1 - --- | Generate and check a new build plan, but do not execute it. --- --- Since 0.3.1 -justCheck :: IO () -justCheck = stillAlive $ withManager tlsManagerSettings $ \man -> do - putStrLn "Loading build constraints" - bc <- defaultBuildConstraints man - - putStrLn "Creating build plan" - plans <- getLatestAllowedPlans bc - plan <- newBuildPlan plans bc - - putStrLn $ "Writing build plan to check-plan.yaml" - encodeFile "check-plan.yaml" plan - - putStrLn "Checking plan" - checkBuildPlan plan - - putStrLn "Plan seems valid!" - -getPerformBuild :: BuildFlags -> Settings -> PerformBuild -getPerformBuild buildFlags Settings {..} = PerformBuild - { pbPlan = plan - , pbInstallDest = buildDir - , pbLogDir = logDir - , pbLog = hPut stdout - , pbJobs = 8 - , pbGlobalInstall = False - , pbEnableTests = bfEnableTests buildFlags - , pbEnableHaddock = bfEnableHaddock buildFlags - , pbEnableLibProfiling = bfEnableLibProfile buildFlags - , pbEnableExecDyn = bfEnableExecDyn buildFlags - , pbVerbose = bfVerbose buildFlags - , pbAllowNewer = bfSkipCheck buildFlags - , pbBuildHoogle = bfBuildHoogle buildFlags - } - --- | Make a complete plan, build, test and upload bundle, docs and --- distro. -completeBuild :: BuildType -> BuildFlags -> IO () -completeBuild buildType buildFlags = withManager tlsManagerSettings $ \man -> do - hSetBuffering stdout LineBuffering - - putStrLn $ "Loading settings for: " ++ tshow buildType - settings@Settings {..} <- getSettings man buildType - - putStrLn $ "Writing build plan to: " ++ fpToText planFile - encodeFile (fpToString planFile) plan - - if bfSkipCheck buildFlags - then putStrLn "Skipping build plan check" - else do - putStrLn "Checking build plan" - checkBuildPlan plan - - putStrLn "Performing build" - let pb = getPerformBuild buildFlags settings - performBuild pb >>= mapM_ putStrLn - - putStrLn $ "Creating bundle (v2) at: " ++ fpToText bundleDest - createBundleV2 CreateBundleV2 - { cb2Plan = plan - , cb2Type = snapshotType - , cb2DocsDir = pbDocDir pb - , cb2Dest = bundleDest - } - - when (bfDoUpload buildFlags) $ - finallyUpload - (not $ bfUploadV1 buildFlags) - (bfServer buildFlags) - settings - man - -justUploadNightly - :: Text -- ^ nightly date - -> IO () -justUploadNightly day = do - plan <- decodeFileEither (fpToString $ nightlyPlanFile day) - >>= either throwM return - withManager tlsManagerSettings $ finallyUpload False def $ nightlySettings day plan - -getStackageAuthToken :: IO Text -getStackageAuthToken = do - mtoken <- lookupEnv "STACKAGE_AUTH_TOKEN" - case mtoken of - Nothing -> decodeUtf8 <$> readFile "/auth-token" - Just token -> return $ pack token - --- | The final part of the complete build process: uploading a bundle, --- docs and a distro to hackage. -finallyUpload :: Bool -- ^ use v2 upload - -> StackageServer - -> Settings -> Manager -> IO () -finallyUpload useV2 server settings@Settings{..} man = do - putStrLn "Uploading bundle to Stackage Server" - - token <- getStackageAuthToken - - if useV2 - then do - res <- flip uploadBundleV2 man UploadBundleV2 - { ub2Server = server - , ub2AuthToken = token - , ub2Bundle = bundleDest - } - putStrLn $ "New snapshot available at: " ++ res - else do - now <- epochTime - let ghcVer = display $ siGhcVersion $ bpSystemInfo plan - (ident, mloc) <- flip uploadBundle man $ setArgs ghcVer def - { ubContents = serverBundle now (title ghcVer) slug plan - , ubAuthToken = token - } - putStrLn $ "New ident: " ++ unSnapshotIdent ident - forM_ mloc $ \loc -> - putStrLn $ "Track progress at: " ++ loc - - putStrLn "Uploading docs to Stackage Server" - res1 <- tryAny $ uploadDocs UploadDocs - { udServer = def - , udAuthToken = token - , udDocs = pbDocDir pb - , udSnapshot = ident - } man - putStrLn $ "Doc upload response: " ++ tshow res1 - - putStrLn "Uploading doc map" - tryAny (uploadDocMap UploadDocMap - { udmServer = def - , udmAuthToken = token - , udmSnapshot = ident - , udmDocDir = pbDocDir pb - , udmPlan = plan - } man) >>= print - - postBuild `catchAny` print - - ecreds <- tryIO $ readFile "/hackage-creds" - case map encodeUtf8 $ words $ decodeUtf8 $ either (const "") id ecreds of - [username, password] -> do - putStrLn "Uploading as Hackage distro" - res2 <- uploadHackageDistroNamed distroName plan username password man - putStrLn $ "Distro upload response: " ++ tshow res2 - _ -> putStrLn "No creds found, skipping Hackage distro upload" - where - pb = getPerformBuild (error "finallyUpload.buildFlags") settings diff --git a/Stackage/CorePackages.hs b/Stackage/CorePackages.hs deleted file mode 100644 index 896ff002..00000000 --- a/Stackage/CorePackages.hs +++ /dev/null @@ -1,53 +0,0 @@ -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -module Stackage.CorePackages - ( getCorePackages - , getCoreExecutables - , getGhcVersion - ) where - -import qualified Data.Text as T -import Filesystem (listDirectory) -import Stackage.Prelude -import System.Directory (findExecutable) - --- | Get a @Map@ of all of the core packages. Core packages are defined as --- packages which ship with GHC itself. --- --- Precondition: GHC global package database has only core packages, and GHC --- ships with just a single version of each packages. -getCorePackages :: IO (Map PackageName Version) -getCorePackages = - withCheckedProcess cp $ \ClosedStream src Inherited -> - src $$ decodeUtf8C =$ linesUnboundedC =$ foldMapMC parsePackage - where - cp = proc "ghc-pkg" ["--no-user-package-conf", "list"] - parsePackage t - | ":" `isInfixOf` t = return mempty - | Just p <- stripSuffix "-" p' = singletonMap - <$> simpleParse p - <*> simpleParse v - | otherwise = return mempty - where - (p', v) = T.breakOnEnd "-" $ dropParens $ T.strip t - - dropParens s - | length s > 2 && headEx s == '(' && lastEx s == ')' = - initEx $ tailEx s - | otherwise = s - --- | A list of executables that are shipped with GHC. -getCoreExecutables :: IO (Set ExeName) -getCoreExecutables = do - mfp <- findExecutable "ghc" - dir <- - case mfp of - Nothing -> error "No ghc executable found on PATH" - Just fp -> return $ directory $ fpFromString fp - (setFromList . map (ExeName . fpToText . filename)) <$> listDirectory dir - -getGhcVersion :: IO Version -getGhcVersion = do - withCheckedProcess (proc "ghc" ["--numeric-version"]) $ - \ClosedStream src Inherited -> - (src $$ decodeUtf8C =$ foldC) >>= simpleParse diff --git a/Stackage/GhcPkg.hs b/Stackage/GhcPkg.hs deleted file mode 100644 index 27b7f9e1..00000000 --- a/Stackage/GhcPkg.hs +++ /dev/null @@ -1,104 +0,0 @@ -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} --- | General commands related to ghc-pkg. - -module Stackage.GhcPkg - ( setupPackageDatabase - ) where - -import Data.Conduit -import qualified Data.Conduit.List as CL -import Data.Conduit.Process -import qualified Data.Conduit.Text as CT -import Data.Maybe -import Data.Text (Text) -import qualified Data.Text as T -import Distribution.Compat.ReadP -import Distribution.Package -import Distribution.Text (parse) -import Filesystem.Path.CurrentOS (FilePath) -import qualified Filesystem.Path.CurrentOS as FP -import Data.Map (Map) -import Data.Version (Version) -import Stackage.Prelude -import Filesystem (removeTree) - -setupPackageDatabase - :: Maybe FilePath -- ^ database location, Nothing if using global DB - -> FilePath -- ^ documentation root - -> (ByteString -> IO ()) -- ^ logging - -> Map PackageName Version -- ^ packages and versions to be installed - -> (PackageIdentifier -> IO ()) -- ^ callback to be used when unregistering a package - -> IO (Set PackageName) -- ^ packages remaining in the database after cleanup -setupPackageDatabase mdb docDir log' toInstall onUnregister = do - registered1 <- getRegisteredPackages flags - forM_ registered1 $ \pi@(PackageIdentifier name version) -> - case lookup name toInstall of - Just version' | version /= version' -> unregisterPackage log' onUnregister docDir flags pi - _ -> return () - broken <- getBrokenPackages flags - forM_ broken $ unregisterPackage log' onUnregister docDir flags - foldMap (\(PackageIdentifier name _) -> singletonSet name) - <$> getRegisteredPackages flags - where - flags = ghcPkgFlags mdb - -ghcPkgFlags :: Maybe FilePath -> [String] -ghcPkgFlags mdb = - "--no-user-package-db" : - case mdb of - Nothing -> ["--global"] - Just fp -> ["--package-db=" ++ fpToString fp] - --- | Get broken packages. -getBrokenPackages :: [String] -> IO [PackageIdentifier] -getBrokenPackages flags = do - (_,ps) <- sourceProcessWithConsumer - (proc - "ghc-pkg" - ("check" : "--simple-output" : flags)) - (CT.decodeUtf8 $= CT.lines $= CL.consume) - return (mapMaybe parsePackageIdent (T.words (T.unlines ps))) - --- | Get available packages. -getRegisteredPackages :: [String] -> IO [PackageIdentifier] -getRegisteredPackages flags = do - (_,ps) <- sourceProcessWithConsumer - (proc - "ghc-pkg" - ("list" : "--simple-output" : flags)) - (CT.decodeUtf8 $= CT.lines $= CL.consume) - return (mapMaybe parsePackageIdent (T.words (T.unlines ps))) - --- | Parse a package identifier: foo-1.2.3 -parsePackageIdent :: Text -> Maybe PackageIdentifier -parsePackageIdent = fmap fst . - listToMaybe . - filter (null . snd) . - readP_to_S parse . T.unpack - --- | Unregister a package. -unregisterPackage :: (ByteString -> IO ()) -- ^ log func - -> (PackageIdentifier -> IO ()) -- ^ callback to be used when unregistering a package - -> FilePath -- ^ doc directory - -> [String] -> PackageIdentifier -> IO () -unregisterPackage log' onUnregister docDir flags ident@(PackageIdentifier name _) = do - log' $ "Unregistering " ++ encodeUtf8 (display ident) ++ "\n" - onUnregister ident - - -- Delete libraries - sourceProcessWithConsumer - (proc "ghc-pkg" ("describe" : flags ++ [unpack $ display ident])) - (CT.decodeUtf8 - $= CT.lines - $= CL.mapMaybe parseLibraryDir - $= CL.mapM_ (void . tryIO . removeTree)) - - void (readProcessWithExitCode - "ghc-pkg" - ("unregister": flags ++ ["--force", unpack $ display name]) - "") - - void $ tryIO $ removeTree $ docDir fpFromText (display ident) - where - parseLibraryDir = fmap fpFromText . stripPrefix "library-dirs: " diff --git a/Stackage/GithubPings.hs b/Stackage/GithubPings.hs deleted file mode 100644 index bb7369f4..00000000 --- a/Stackage/GithubPings.hs +++ /dev/null @@ -1,36 +0,0 @@ -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ViewPatterns #-} -module Stackage.GithubPings - ( getGithubPings - ) where - -import Distribution.PackageDescription -import Stackage.BuildConstraints -import Stackage.Prelude - --- | Determine accounts to be pinged on Github based on various metadata in the --- package description. -getGithubPings :: BuildConstraints -- ^ for mapping to pingees - -> GenericPackageDescription -> Set Text -getGithubPings bc gpd = - foldMap (\(pack -> name) -> fromMaybe (singletonSet name) (lookup name (bcGithubUsers bc))) $ - goHomepage (homepage $ packageDescription gpd) ++ - concatMap goRepo (sourceRepos $ packageDescription gpd) - where - goHomepage t = do - prefix <- - [ "http://github.com/" - , "https://github.com/" - , "git://github.com/" - , "git@github.com:" - ] - t' <- maybeToList $ stripPrefix prefix t - let t'' = takeWhile (/= '/') t' - guard $ not $ null t'' - return t'' - - goRepo sr = - case (repoType sr, repoLocation sr) of - (Just Git, Just s) -> goHomepage s - _ -> [] diff --git a/Stackage/InstallBuild.hs b/Stackage/InstallBuild.hs deleted file mode 100644 index 2f896e35..00000000 --- a/Stackage/InstallBuild.hs +++ /dev/null @@ -1,102 +0,0 @@ -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE ScopedTypeVariables #-} -module Stackage.InstallBuild - ( InstallFlags (..) - , BuildPlanSource (..) - , installBuild - ) where - -import qualified Codec.Archive.Tar as Tar -import qualified Codec.Compression.GZip as GZip -import qualified Data.Yaml as Yaml -import Network.HTTP.Client -import Network.HTTP.Client.TLS (tlsManagerSettings) -import Stackage.BuildPlan -import Stackage.CheckBuildPlan -import Stackage.PerformBuild -import Stackage.Prelude -import System.IO (BufferMode (LineBuffering), hSetBuffering) - --- | Flags passed in from the command line. -data InstallFlags = InstallFlags - { ifPlanSource :: !BuildPlanSource - , ifInstallDest :: !FilePath - , ifLogDir :: !(Maybe FilePath) - , ifJobs :: !Int - , ifGlobalInstall :: !Bool - , ifEnableTests :: !Bool - , ifEnableHaddock :: !Bool - , ifEnableLibProfiling :: !Bool - , ifEnableExecDyn :: !Bool - , ifVerbose :: !Bool - , ifSkipCheck :: !Bool - , ifBuildHoogle :: !Bool - } deriving (Show) - --- | Source for build plan. -data BuildPlanSource = BPSBundleWeb String - | BPSFile FilePath - deriving (Show) - -getPerformBuild :: BuildPlan -> InstallFlags -> PerformBuild -getPerformBuild plan InstallFlags{..} = - PerformBuild - { pbPlan = plan - , pbInstallDest = ifInstallDest - , pbLogDir = fromMaybe (ifInstallDest "logs") ifLogDir - , pbLog = hPut stdout - , pbJobs = ifJobs - , pbGlobalInstall = ifGlobalInstall - , pbEnableTests = ifEnableTests - , pbEnableHaddock = ifEnableHaddock - , pbEnableLibProfiling = ifEnableLibProfiling - , pbEnableExecDyn = ifEnableExecDyn - , pbVerbose = ifVerbose - , pbAllowNewer = ifSkipCheck - , pbBuildHoogle = ifBuildHoogle - } - --- | Install stackage from an existing build plan. -installBuild :: InstallFlags -> IO () -installBuild installFlags@InstallFlags{..} = do - hSetBuffering stdout LineBuffering - - putStrLn $ "Loading build plan" - plan <- case ifPlanSource of - BPSBundleWeb url -> withManager tlsManagerSettings $ \man -> do - req <- parseUrl url - res <- httpLbs req man - planBSL <- getPlanEntry $ Tar.read $ GZip.decompress (responseBody res) - decodeBuildPlan planBSL - BPSFile path -> Yaml.decodeFileEither (fpToString path) >>= either throwM return - - if ifSkipCheck - then putStrLn "Skipping build plan check" - else do - putStrLn "Checking build plan" - checkBuildPlan plan - - putStrLn "Performing build" - performBuild (getPerformBuild plan installFlags) >>= mapM_ putStrLn - - where - getPlanEntry Tar.Done = throwIO NoBuildPlanException - getPlanEntry (Tar.Fail e) = throwIO e - getPlanEntry (Tar.Next entry entries) - | Tar.entryPath entry == "build-plan.yaml" = - case Tar.entryContent entry of - Tar.NormalFile bs _ -> return bs - _ -> throwIO NoBuildPlanException - | otherwise = getPlanEntry entries - - decodeBuildPlan = - either throwIO return . Yaml.decodeEither' . toStrict - -data InstallBuildException = NoBuildPlanException - deriving (Typeable) -instance Exception InstallBuildException -instance Show InstallBuildException where - show NoBuildPlanException = "Bundle has missing or invalid build-plan.yaml" diff --git a/Stackage/PackageDescription.hs b/Stackage/PackageDescription.hs deleted file mode 100644 index 24263701..00000000 --- a/Stackage/PackageDescription.hs +++ /dev/null @@ -1,200 +0,0 @@ -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE DeriveFoldable #-} -{-# LANGUAGE DeriveFunctor #-} -{-# LANGUAGE DeriveTraversable #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE TypeFamilies #-} --- | Manipulate @GenericPackageDescription@ from Cabal into something more --- useful for us. -module Stackage.PackageDescription - ( SimpleDesc (..) - , toSimpleDesc - , CheckCond (..) - , Component (..) - , DepInfo (..) - ) where - -import Control.Monad.Writer.Strict (MonadWriter, execWriterT, - tell) -import Data.Aeson -import qualified Data.Map as Map -import Distribution.Compiler (CompilerFlavor) -import Distribution.Package (Dependency (..)) -import Distribution.PackageDescription -import Distribution.System (Arch, OS) -import Stackage.Prelude - -data Component = CompLibrary - | CompExecutable - | CompTestSuite - | CompBenchmark - deriving (Show, Read, Eq, Ord, Enum, Bounded) - -compToText :: Component -> Text -compToText CompLibrary = "library" -compToText CompExecutable = "executable" -compToText CompTestSuite = "test-suite" -compToText CompBenchmark = "benchmark" - -instance ToJSON Component where - toJSON = toJSON . compToText -instance FromJSON Component where - parseJSON = withText "Component" $ \t -> maybe - (fail $ "Invalid component: " ++ unpack t) - return - (lookup t comps) - where - comps = asHashMap $ mapFromList $ map (compToText &&& id) [minBound..maxBound] - -data DepInfo = DepInfo - { diComponents :: Set Component - , diRange :: VersionRange - } - deriving (Show, Eq) - -instance Semigroup DepInfo where - DepInfo a x <> DepInfo b y = DepInfo - (a <> b) - (intersectVersionRanges x y) -instance ToJSON DepInfo where - toJSON DepInfo {..} = object - [ "components" .= diComponents - , "range" .= display diRange - ] -instance FromJSON DepInfo where - parseJSON = withObject "DepInfo" $ \o -> do - diComponents <- o .: "components" - diRange <- o .: "range" >>= either (fail . show) return . simpleParse - return DepInfo {..} - --- | A simplified package description that tracks: --- --- * Package dependencies --- --- * Build tool dependencies --- --- * Provided executables --- --- It has fully resolved all conditionals -data SimpleDesc = SimpleDesc - { sdPackages :: Map PackageName DepInfo - , sdTools :: Map ExeName DepInfo - , sdProvidedExes :: Set ExeName - , sdModules :: Set Text - -- ^ modules exported by the library - } - deriving (Show, Eq) -instance Monoid SimpleDesc where - mempty = SimpleDesc mempty mempty mempty mempty - mappend (SimpleDesc a b c d) (SimpleDesc w x y z) = SimpleDesc - (unionWith (<>) a w) - (unionWith (<>) b x) - (c ++ y) - (d ++ z) -instance ToJSON SimpleDesc where - toJSON SimpleDesc {..} = object - [ "packages" .= Map.mapKeysWith const unPackageName sdPackages - , "tools" .= Map.mapKeysWith const unExeName sdTools - , "provided-exes" .= sdProvidedExes - , "modules" .= sdModules - ] -instance FromJSON SimpleDesc where - parseJSON = withObject "SimpleDesc" $ \o -> do - sdPackages <- Map.mapKeysWith const mkPackageName <$> (o .: "packages") - sdTools <- Map.mapKeysWith const ExeName <$> (o .: "tools") - sdProvidedExes <- o .: "provided-exes" - sdModules <- o .: "modules" - return SimpleDesc {..} - --- | Convert a 'GenericPackageDescription' into a 'SimpleDesc' by following the --- constraints in the provided 'CheckCond'. -toSimpleDesc :: MonadThrow m - => CheckCond - -> GenericPackageDescription - -> m SimpleDesc -toSimpleDesc cc gpd = execWriterT $ do - forM_ (condLibrary gpd) $ tellTree cc CompLibrary libBuildInfo getModules - forM_ (condExecutables gpd) $ tellTree cc CompExecutable buildInfo noModules . snd - tell mempty { sdProvidedExes = setFromList - $ map (fromString . fst) - $ condExecutables gpd - } - when (ccIncludeTests cc) $ forM_ (condTestSuites gpd) - $ tellTree cc CompTestSuite testBuildInfo noModules . snd - when (ccIncludeBenchmarks cc) $ forM_ (condBenchmarks gpd) - $ tellTree cc CompBenchmark benchmarkBuildInfo noModules . snd - where - noModules = const mempty - getModules = setFromList . map display . exposedModules - --- | Convert a single CondTree to a 'SimpleDesc'. -tellTree :: (MonadWriter SimpleDesc m, MonadThrow m) - => CheckCond - -> Component - -> (a -> BuildInfo) - -> (a -> Set Text) -- ^ get module names - -> CondTree ConfVar [Dependency] a - -> m () -tellTree cc component getBI getModules = - loop - where - loop (CondNode dat deps comps) = do - tell mempty - { sdPackages = unionsWith (<>) $ flip map deps - $ \(Dependency x y) -> singletonMap x DepInfo - { diComponents = singletonSet component - , diRange = simplifyVersionRange y - } - , sdTools = unionsWith (<>) $ flip map (buildTools $ getBI dat) - $ \(Dependency name range) -> singletonMap - -- In practice, cabal files refer to the exe name, not the - -- package name. - (ExeName $ unPackageName name) - DepInfo - { diComponents = singletonSet component - , diRange = simplifyVersionRange range - } - , sdModules = getModules dat - } - forM_ comps $ \(cond, ontrue, onfalse) -> do - b <- checkCond cc cond - if b - then loop ontrue - else maybe (return ()) loop onfalse - --- | Resolve a condition to a boolean based on the provided 'CheckCond'. -checkCond :: MonadThrow m => CheckCond -> Condition ConfVar -> m Bool -checkCond CheckCond {..} cond0 = - go cond0 - where - go (Var (OS os)) = return $ os == ccOS - go (Var (Arch arch)) = return $ arch == ccArch - go (Var (Flag flag)) = - case lookup flag ccFlags of - Nothing -> throwM $ FlagNotDefined ccPackageName flag cond0 - Just b -> return b - go (Var (Impl flavor range)) = return - $ flavor == ccCompilerFlavor - && ccCompilerVersion `withinRange` range - go (Lit b) = return b - go (CNot c) = not `liftM` go c - go (CAnd x y) = (&&) `liftM` go x `ap` go y - go (COr x y) = (||) `liftM` go x `ap` go y - -data CheckCondException = FlagNotDefined PackageName FlagName (Condition ConfVar) - deriving (Show, Typeable) -instance Exception CheckCondException - -data CheckCond = CheckCond - { ccPackageName :: PackageName -- for debugging only - , ccOS :: OS - , ccArch :: Arch - , ccFlags :: Map FlagName Bool - , ccCompilerFlavor :: CompilerFlavor - , ccCompilerVersion :: Version - , ccIncludeTests :: Bool - , ccIncludeBenchmarks :: Bool - } diff --git a/Stackage/PackageIndex.hs b/Stackage/PackageIndex.hs deleted file mode 100644 index 6b4c8087..00000000 --- a/Stackage/PackageIndex.hs +++ /dev/null @@ -1,127 +0,0 @@ -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ViewPatterns #-} --- | Dealing with the 00-index file and all its cabal files. -module Stackage.PackageIndex - ( sourcePackageIndex - , UnparsedCabalFile (..) - , getLatestDescriptions - ) where - -import qualified Codec.Archive.Tar as Tar -import Data.Conduit.Lazy (MonadActive, - lazyConsume) -import qualified Data.Text as T -import Distribution.PackageDescription (package, - packageDescription) -import Distribution.PackageDescription.Parse (ParseResult (..), - parsePackageDescription) -import Distribution.ParseUtils (PError) -import Stackage.Prelude -import System.Directory (getAppUserDataDirectory) - --- | Name of the 00-index.tar downloaded from Hackage. -getPackageIndexPath :: MonadIO m => m FilePath -getPackageIndexPath = liftIO $ do - c <- getCabalRoot - configLines <- runResourceT $ sourceFile (c "config") - $$ decodeUtf8C - =$ linesUnboundedC - =$ concatMapC getRemoteCache - =$ sinkList - case configLines of - [x] -> return $ x "hackage.haskell.org" "00-index.tar" - [] -> error $ "No remote-repo-cache found in Cabal config file" - _ -> error $ "Multiple remote-repo-cache entries found in Cabal config file" - where - getCabalRoot :: IO FilePath - getCabalRoot = fpFromString <$> getAppUserDataDirectory "cabal" - - getRemoteCache s = do - ("remote-repo-cache", stripPrefix ":" -> Just v) <- Just $ break (== ':') s - Just $ fpFromText $ T.strip v - --- | A cabal file with name and version parsed from the filepath, and the --- package description itself ready to be parsed. It's left in unparsed form --- for efficiency. -data UnparsedCabalFile = UnparsedCabalFile - { ucfName :: PackageName - , ucfVersion :: Version - , ucfParse :: forall m. MonadThrow m => m GenericPackageDescription - } - --- | Stream all of the cabal files from the 00-index tar file. -sourcePackageIndex :: (MonadThrow m, MonadResource m, MonadActive m, MonadBaseControl IO m) - => Producer m UnparsedCabalFile -sourcePackageIndex = do - fp <- getPackageIndexPath - -- yay for the tar package. Use lazyConsume instead of readFile to get some - -- kind of resource protection - lbs <- lift $ fromChunks <$> lazyConsume (sourceFile fp) - loop (Tar.read lbs) - where - loop (Tar.Next e es) = goE e >> loop es - loop Tar.Done = return () - loop (Tar.Fail e) = throwM e - - goE e - | Just front <- stripSuffix ".cabal" $ pack $ Tar.entryPath e - , Tar.NormalFile lbs _size <- Tar.entryContent e = do - (name, version) <- parseNameVersion front - yield UnparsedCabalFile - { ucfName = name - , ucfVersion = version - , ucfParse = goContent (Tar.entryPath e) name version lbs - } - | otherwise = return () - - goContent fp name version lbs = - case parsePackageDescription $ unpack $ decodeUtf8 lbs of - ParseFailed e -> throwM $ CabalParseException (fpFromString fp) e - ParseOk _warnings gpd -> do - let pd = packageDescription gpd - PackageIdentifier name' version' = package pd - when (name /= name' || version /= version') $ - throwM $ MismatchedNameVersion (fpFromString fp) - name name' version version' - return gpd - - parseNameVersion t1 = do - let (p', t2) = break (== '/') $ T.replace "\\" "/" t1 - p <- simpleParse p' - t3 <- maybe (throwM $ InvalidCabalPath t1 "no slash") return - $ stripPrefix "/" t2 - let (v', t4) = break (== '/') t3 - v <- simpleParse v' - when (t4 /= cons '/' p') $ throwM $ InvalidCabalPath t1 $ "Expected at end: " ++ p' - return (p, v) - -data InvalidCabalPath = InvalidCabalPath Text Text - deriving (Show, Typeable) -instance Exception InvalidCabalPath - -data CabalParseException = CabalParseException FilePath PError - | MismatchedNameVersion FilePath PackageName PackageName Version Version - deriving (Show, Typeable) -instance Exception CabalParseException - --- | Get all of the latest descriptions for name/version pairs matching the --- given criterion. -getLatestDescriptions :: MonadIO m - => (PackageName -> Version -> Bool) - -> (GenericPackageDescription -> IO desc) - -> m (Map PackageName desc) -getLatestDescriptions f parseDesc = liftIO $ do - m <- runResourceT $ sourcePackageIndex $$ filterC f' =$ foldlC add mempty - forM m $ \ucf -> liftIO $ ucfParse ucf >>= parseDesc - where - f' ucf = f (ucfName ucf) (ucfVersion ucf) - add m ucf = - case lookup name m of - Just ucf' | ucfVersion ucf < ucfVersion ucf' -> m - _ -> insertMap name ucf m - where - name = ucfName ucf diff --git a/Stackage/PerformBuild.hs b/Stackage/PerformBuild.hs deleted file mode 100644 index 06c1edc6..00000000 --- a/Stackage/PerformBuild.hs +++ /dev/null @@ -1,560 +0,0 @@ --- | Perform an actual build, generate a binary package database and a --- documentation directory in the process. -{-# LANGUAGE CPP #-} -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -module Stackage.PerformBuild - ( performBuild - , PerformBuild (..) - , BuildException (..) - , pbDocDir - ) where - -import Control.Concurrent.Async (async) -import Control.Concurrent.STM.TSem -import Control.Monad.Writer.Strict (execWriter, tell) -import qualified Data.Map as Map -import Data.NonNull (fromNullable) -import Filesystem (canonicalizePath, createTree, - getWorkingDirectory, isDirectory, - removeTree, rename, isFile, removeFile) -import Filesystem.Path (parent) -import qualified Filesystem.Path as F -import Stackage.BuildConstraints -import Stackage.BuildPlan -import Stackage.GhcPkg -import Stackage.PackageDescription -import Stackage.Prelude hiding (pi) -import System.Directory (findExecutable) -import System.Environment (getEnvironment) -import System.IO (IOMode (WriteMode), - openBinaryFile) -import System.IO.Temp (withSystemTempDirectory) - -data BuildException = BuildException (Map PackageName BuildFailure) [Text] - deriving Typeable -instance Exception BuildException -instance Show BuildException where - show (BuildException m warnings) = - unlines $ map go (mapToList m) ++ map unpack warnings - where - go (PackageName name, bf) = concat - [ name - , ": " - , show bf - ] - -data BuildFailure = DependencyFailed PackageName - | DependencyMissing PackageName - | ToolMissing ExeName - | NotImplemented - | BuildFailureException SomeException - deriving (Show, Typeable) -instance Exception BuildFailure - -data PerformBuild = PerformBuild - { pbPlan :: BuildPlan - , pbInstallDest :: FilePath - , pbLog :: ByteString -> IO () - , pbLogDir :: FilePath - , pbJobs :: Int - , pbGlobalInstall :: Bool - -- ^ Register packages in the global database - , pbEnableTests :: Bool - , pbEnableHaddock :: Bool - , pbEnableLibProfiling :: Bool - , pbEnableExecDyn :: Bool - , pbVerbose :: Bool - , pbAllowNewer :: Bool - -- ^ Pass --allow-newer to cabal configure - , pbBuildHoogle :: Bool - -- ^ Should we build Hoogle database? - -- - -- May be disabled due to: https://ghc.haskell.org/trac/ghc/ticket/9921 - } - -data PackageInfo = PackageInfo - { piPlan :: PackagePlan - , piName :: PackageName - , piResult :: TMVar Bool - } - -waitForDeps :: Map ExeName (Set PackageName) - -> Map PackageName PackageInfo - -> Set Component - -> BuildPlan - -> PackageInfo - -> IO a - -> IO a -waitForDeps toolMap packageMap activeComps bp pi action = do - atomically $ do - mapM_ checkPackage $ Map.keys $ filterUnused $ sdPackages $ ppDesc $ piPlan pi - forM_ (Map.keys $ filterUnused $ sdTools $ ppDesc $ piPlan pi) $ \exe -> do - case lookup exe toolMap >>= fromNullable . map checkPackage . setToList of - Nothing - | isCoreExe exe -> return () - -- https://github.com/jgm/zip-archive/issues/23 - -- - | otherwise -> throwSTM $ ToolMissing exe - | otherwise -> return () - Just packages -> ofoldl1' (<|>) packages - action - where - filterUnused :: Ord key => Map key DepInfo -> Map key DepInfo - filterUnused = - mapFromList . filter (go . snd) . mapToList - where - go = not . null . intersection activeComps . diComponents - - checkPackage package | package == piName pi = return () - checkPackage package = - case lookup package packageMap of - Nothing - | isCore package -> return () - | otherwise -> throwSTM $ DependencyMissing package - Just dep -> do - res <- readTMVar $ piResult dep - unless res $ throwSTM $ DependencyFailed package - - isCore = (`member` siCorePackages (bpSystemInfo bp)) - isCoreExe = (`member` siCoreExecutables (bpSystemInfo bp)) - -withCounter :: TVar Int -> IO a -> IO a -withCounter counter = bracket_ - (atomically $ modifyTVar counter (+ 1)) - (atomically $ modifyTVar counter (subtract 1)) - -withTSem :: TSem -> IO a -> IO a -withTSem sem = bracket_ (atomically $ waitTSem sem) (atomically $ signalTSem sem) - --- | Returns @Nothing@ if installing to a global database -pbDatabase :: PerformBuild -> Maybe FilePath -pbDatabase pb - | pbGlobalInstall pb = Nothing - | otherwise = Just $ pbInstallDest pb "pkgdb" - -pbBinDir, pbLibDir, pbDataDir, pbDocDir :: PerformBuild -> FilePath -pbBinDir pb = pbInstallDest pb "bin" -pbLibDir pb = pbInstallDest pb "lib" -pbDataDir pb = pbInstallDest pb "share" -pbDocDir pb = pbInstallDest pb "doc" - --- | Directory keeping previous result info -pbPrevResDir :: PerformBuild -> FilePath -pbPrevResDir pb = pbInstallDest pb "prevres" - -performBuild :: PerformBuild -> IO [Text] -performBuild pb = do - cwd <- getWorkingDirectory - performBuild' pb - { pbInstallDest = cwd pbInstallDest pb - , pbLogDir = cwd pbLogDir pb - } - -performBuild' :: PerformBuild -> IO [Text] -performBuild' pb@PerformBuild {..} = withBuildDir $ \builddir -> do - -- First make sure to fetch all of the dependencies... just in case Hackage - -- has an outage. Don't feel like wasting hours of CPU time. - pbLog $ encodeUtf8 "Pre-fetching all packages\n" - let toDownload = flip map (mapToList $ bpPackages pbPlan) - $ \(name, plan) -> unpack $ concat - [ display name - , "-" - , display $ ppVersion plan - ] - withCheckedProcess - (proc "cabal" - $ "fetch" - : "--no-dependencies" - : toDownload) - $ \ClosedStream Inherited Inherited -> return () - - let removeTree' fp = whenM (isDirectory fp) (removeTree fp) - removeTree' pbLogDir - - forM_ (pbDatabase pb) $ \db -> - unlessM (isFile $ db "package.cache") $ do - createTree $ parent db - withCheckedProcess (proc "ghc-pkg" ["init", fpToString db]) - $ \ClosedStream Inherited Inherited -> return () - pbLog $ encodeUtf8 "Copying built-in Haddocks\n" - copyBuiltInHaddocks (pbDocDir pb) - - sem <- atomically $ newTSem pbJobs - active <- newTVarIO (0 :: Int) - let toolMap = makeToolMap $ bpPackages pbPlan - packageMap <- fmap fold $ forM (mapToList $ bpPackages pbPlan) - $ \(name, plan) -> do - let piPlan = plan - piName = name - piResult <- newEmptyTMVarIO - return $ singletonMap name PackageInfo {..} - - errsVar <- newTVarIO mempty - warningsVar <- newTVarIO id - mutex <- newMVar () - env <- getEnvironment - haddockFiles <- newTVarIO mempty - - registeredPackages <- setupPackageDatabase - (pbDatabase pb) - (pbDocDir pb) - pbLog - (ppVersion <$> bpPackages pbPlan) - (deletePreviousResults pb) - - forM_ packageMap $ \pi -> void $ async $ singleBuild pb registeredPackages - SingleBuild - { sbSem = sem - , sbErrsVar = errsVar - , sbWarningsVar = warningsVar - , sbActive = active - , sbToolMap = toolMap - , sbPackageMap = packageMap - , sbBuildDir = builddir - , sbPackageInfo = pi - , sbRegisterMutex = mutex - , sbModifiedEnv = maybe - id - (\db -> (("HASKELL_PACKAGE_SANDBOX", fpToString db):)) - (pbDatabase pb) - (filter allowedEnv $ map fixEnv env) - , sbHaddockFiles = haddockFiles - } - - void $ tryAny $ atomically $ readTVar active >>= checkSTM . (== 0) - - warnings <- ($ []) <$> readTVarIO warningsVar - errs <- readTVarIO errsVar - when (not $ null errs) $ throwM $ BuildException errs warnings - return warnings - where - withBuildDir f = withSystemTempDirectory "stackage-build" (f . fpFromString) - - fixEnv (p, x) - -- Thank you Windows having case-insensitive environment variables... - | toUpper p == "PATH" = (p, fpToString (pbBinDir pb) ++ pathSep : x) - | otherwise = (p, x) - - allowedEnv (k, _) = k `notMember` bannedEnvs - - -- | Separate for the PATH environment variable - pathSep :: Char -#ifdef mingw32_HOST_OS - pathSep = ';' -#else - pathSep = ':' -#endif - --- | Environment variables we don't allow to be passed on to child processes. -bannedEnvs :: Set String -bannedEnvs = setFromList - [ "STACKAGE_AUTH_TOKEN" - ] - -data SingleBuild = SingleBuild - { sbSem :: TSem - , sbErrsVar :: TVar (Map PackageName BuildFailure) - , sbWarningsVar :: TVar ([Text] -> [Text]) - , sbActive :: TVar Int - , sbToolMap :: Map ExeName (Set PackageName) - , sbPackageMap :: Map PackageName PackageInfo - , sbBuildDir :: FilePath - , sbPackageInfo :: PackageInfo - , sbRegisterMutex :: MVar () - , sbModifiedEnv :: [(String, String)] - , sbHaddockFiles :: TVar (Map Text FilePath) -- ^ package-version, .haddock file - } - -singleBuild :: PerformBuild - -> Set PackageName -- ^ registered packages - -> SingleBuild -> IO () -singleBuild pb@PerformBuild {..} registeredPackages SingleBuild {..} = - withCounter sbActive - $ handle updateErrs - $ (`finally` void (atomically $ tryPutTMVar (piResult sbPackageInfo) False)) - $ inner - where - libComps = setFromList [CompLibrary, CompExecutable] - testComps = insertSet CompTestSuite libComps - inner = do - let wfd comps = - waitForDeps sbToolMap sbPackageMap comps pbPlan sbPackageInfo - . withTSem sbSem - withUnpacked <- wfd libComps buildLibrary - - wfd testComps (runTests withUnpacked) - - pname = piName sbPackageInfo - pident = PackageIdentifier pname (ppVersion $ piPlan sbPackageInfo) - name = display pname - namever = concat - [ name - , "-" - , display $ ppVersion $ piPlan sbPackageInfo - ] - - runIn wdir getOutH cmd args = do - outH <- getOutH - withCheckedProcess (cp outH) $ \ClosedStream UseProvidedHandle UseProvidedHandle -> - (return () :: IO ()) - where - cp outH = (proc (unpack $ asText cmd) (map (unpack . asText) args)) - { cwd = Just $ fpToString wdir - , std_out = UseHandle outH - , std_err = UseHandle outH - , env = Just sbModifiedEnv - } - runParent = runIn sbBuildDir - runChild = runIn childDir - childDir = sbBuildDir fpFromText namever - - log' t = do - i <- readTVarIO sbActive - errs <- readTVarIO sbErrsVar - pbLog $ encodeUtf8 $ concat - [ t - , " (pending: " - , tshow i - , ", failures: " - , tshow $ length errs - , ")\n" - ] - libOut = pbLogDir fpFromText namever "build.out" - testOut = pbLogDir fpFromText namever "test.out" - testRunOut = pbLogDir fpFromText namever "test-run.out" - - wf fp inner' = do - ref <- newIORef Nothing - let cleanup = do - mh <- readIORef ref - forM_ mh hClose - getH = do - mh <- readIORef ref - case mh of - Just h -> return h - Nothing -> mask_ $ do - createTree $ parent fp - h <- openBinaryFile (fpToString fp) WriteMode - writeIORef ref $ Just h - return h - - inner' getH `finally` cleanup - - configArgs = ($ []) $ execWriter $ do - when pbAllowNewer $ tell' "--allow-newer" - tell' "--package-db=clear" - tell' "--package-db=global" - forM_ (pbDatabase pb) $ \db -> tell' $ "--package-db=" ++ fpToText db - tell' $ "--libdir=" ++ fpToText (pbLibDir pb) - tell' $ "--bindir=" ++ fpToText (pbBinDir pb) - tell' $ "--datadir=" ++ fpToText (pbDataDir pb) - tell' $ "--docdir=" ++ fpToText (pbDocDir pb) - tell' $ "--flags=" ++ flags - when (pbEnableLibProfiling && pcEnableLibProfile) $ - tell' "--enable-library-profiling" - when pbEnableExecDyn $ tell' "--enable-executable-dynamic" - where - tell' x = tell (x:) - - flags :: Text - flags = unwords $ map go $ mapToList pcFlagOverrides - where - go (name', isOn) = concat - [ if isOn then "" else "-" - , unFlagName name' - ] - - PackageConstraints {..} = ppConstraints $ piPlan sbPackageInfo - - buildLibrary = wf libOut $ \getOutH -> do - let run a b = do when pbVerbose $ log' (unwords (a : b)) - runChild getOutH a b - - isUnpacked <- newIORef False - let withUnpacked inner = do - unlessM (readIORef isUnpacked) $ do - log' $ "Unpacking " ++ namever - runParent getOutH "cabal" ["unpack", namever] - writeIORef isUnpacked True - inner - - isConfiged <- newIORef False - let withConfiged inner = withUnpacked $ do - unlessM (readIORef isConfiged) $ do - log' $ "Configuring " ++ namever - run "cabal" $ "configure" : configArgs - writeIORef isConfiged True - inner - - prevBuildResult <- getPreviousResult pb Build pident - unless (prevBuildResult == PRSuccess) $ withConfiged $ do - assert (pname `notMember` registeredPackages) $ do - deletePreviousResults pb pident - - log' $ "Building " ++ namever - run "cabal" ["build"] - - log' $ "Copying/registering " ++ namever - run "cabal" ["copy"] - withMVar sbRegisterMutex $ const $ - run "cabal" ["register"] - - savePreviousResult pb Build pident True - - -- Even if the tests later fail, we can allow other libraries to build - -- on top of our successful results - -- - -- FIXME do we need to wait to do this until after Haddocks build? - -- otherwise, we could have a race condition and try to build a - -- dependency's haddocks before this finishes - atomically $ putTMVar (piResult sbPackageInfo) True - - prevHaddockResult <- getPreviousResult pb Haddock pident - let needHaddock = pbEnableHaddock - && checkPrevResult prevHaddockResult pcHaddocks - && not (null $ sdModules $ ppDesc $ piPlan sbPackageInfo) - when needHaddock $ withConfiged $ do - log' $ "Haddocks " ++ namever - hfs <- readTVarIO sbHaddockFiles - let hfsOpts = flip map (mapToList hfs) $ \(pkgVer, hf) -> concat - [ "--haddock-options=--read-interface=" - , "../" - , pkgVer - , "/," - , fpToText hf - ] - args = ($ hfsOpts) $ execWriter $ do - let tell' x = tell (x:) - tell' "haddock" - tell' "--hyperlink-source" - tell' "--html" - when pbBuildHoogle $ tell' "--hoogle" - tell' "--html-location=../$pkg-$version/" - - eres <- tryAny $ run "cabal" args - - forM_ eres $ \() -> do - renameOrCopy - (childDir "dist" "doc" "html" fpFromText name) - (pbDocDir pb fpFromText namever) - - enewPath <- tryIO - $ canonicalizePath - $ pbDocDir pb - fpFromText namever - fpFromText name <.> "haddock" - case enewPath of - Left e -> warn $ tshow e - Right newPath -> atomically - $ modifyTVar sbHaddockFiles - $ insertMap namever newPath - - savePreviousResult pb Haddock pident $ either (const False) (const True) eres - case (eres, pcHaddocks) of - (Left e, ExpectSuccess) -> throwM e - (Right (), ExpectFailure) -> warn $ namever ++ ": unexpected Haddock success" - _ -> return () - - return withUnpacked - - runTests withUnpacked = wf testOut $ \getOutH -> do - let run = runChild getOutH - - prevTestResult <- getPreviousResult pb Test pident - let needTest = pbEnableTests - && checkPrevResult prevTestResult pcTests - when needTest $ withUnpacked $ do - log' $ "Test configure " ++ namever - run "cabal" $ "configure" : "--enable-tests" : configArgs - - eres <- tryAny $ do - log' $ "Test build " ++ namever - run "cabal" ["build"] - - log' $ "Test run " ++ namever - run "cabal" ["test", "--log=" ++ fpToText testRunOut] - - savePreviousResult pb Test pident $ either (const False) (const True) eres - case (eres, pcTests) of - (Left e, ExpectSuccess) -> throwM e - (Right (), ExpectFailure) -> warn $ namever ++ ": unexpected test success" - _ -> return () - - warn t = atomically $ modifyTVar sbWarningsVar (. (t:)) - - updateErrs exc = do - log' $ concat - [ display (piName sbPackageInfo) - , ": " - , tshow exc - ] - atomically $ modifyTVar sbErrsVar $ insertMap (piName sbPackageInfo) exc' - where - exc' = - case fromException exc of - Just bf -> bf - Nothing -> BuildFailureException exc - -renameOrCopy :: FilePath -> FilePath -> IO () -renameOrCopy src dest = rename src dest `catchIO` \_ -> copyDir src dest - -copyBuiltInHaddocks :: FilePath -> IO () -copyBuiltInHaddocks docdir = do - mghc <- findExecutable "ghc" - case mghc of - Nothing -> error "GHC not found on PATH" - Just ghc -> do - src <- canonicalizePath - (parent (fpFromString ghc) "../share/doc/ghc/html/libraries") - copyDir src docdir - -------------- Previous results - --- | The previous actions that can be run -data ResultType = Build | Haddock | Test - deriving (Show, Enum, Eq, Ord, Bounded, Read) - --- | The result generated on a previous run -data PrevResult = PRNoResult | PRSuccess | PRFailure - deriving (Show, Enum, Eq, Ord, Bounded, Read) - --- | Check if we should rerun based on a PrevResult and the expected status -checkPrevResult :: PrevResult -> TestState -> Bool -checkPrevResult _ Don'tBuild = False -checkPrevResult PRNoResult _ = True -checkPrevResult PRSuccess _ = False -checkPrevResult PRFailure ExpectSuccess = True -checkPrevResult PRFailure _ = False - -withPRPath :: PerformBuild -> ResultType -> PackageIdentifier -> (FilePath -> IO a) -> IO a -withPRPath pb rt ident inner = do - createTree $ parent fp - inner fp - where - fp = pbPrevResDir pb fpFromString (show rt) fpFromText (display ident) - -successBS, failureBS :: ByteString -successBS = "success" -failureBS = "failure" - -getPreviousResult :: PerformBuild -> ResultType -> PackageIdentifier -> IO PrevResult -getPreviousResult w x y = withPRPath w x y $ \fp -> do - eres <- tryIO $ readFile fp - return $ case eres of - Right bs - | bs == successBS -> PRSuccess - | bs == failureBS -> PRFailure - _ -> PRNoResult - -savePreviousResult :: PerformBuild -> ResultType -> PackageIdentifier -> Bool -> IO () -savePreviousResult pb rt ident res = - withPRPath pb rt ident $ \fp -> writeFile fp $ - if res then successBS else failureBS - -deletePreviousResults :: PerformBuild -> PackageIdentifier -> IO () -deletePreviousResults pb name = - forM_ [minBound..maxBound] $ \rt -> - withPRPath pb rt name $ \fp -> - void $ tryIO $ removeFile fp diff --git a/Stackage/Prelude.hs b/Stackage/Prelude.hs deleted file mode 100644 index 28fff061..00000000 --- a/Stackage/Prelude.hs +++ /dev/null @@ -1,116 +0,0 @@ -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE TypeFamilies #-} -module Stackage.Prelude - ( module X - , module Stackage.Prelude - ) where - -import ClassyPrelude.Conduit as X -import Data.Aeson (FromJSON, ToJSON) -import Data.Conduit.Process as X -import qualified Data.Map as Map -import Data.Typeable (TypeRep, typeOf) -import Distribution.Package as X (PackageIdentifier (..), PackageName (PackageName)) -import Distribution.PackageDescription as X (FlagName (..), GenericPackageDescription) -import qualified Distribution.Text as DT -import Distribution.Version as X (Version (..), - VersionRange) -import Distribution.Version as X (withinRange) -import qualified Distribution.Version as C -import Filesystem (createTree) -import Filesystem.Path (parent) -import qualified Filesystem.Path as F - -unPackageName :: PackageName -> Text -unPackageName (PackageName str) = pack str - -unFlagName :: FlagName -> Text -unFlagName (FlagName str) = pack str - -mkPackageName :: Text -> PackageName -mkPackageName = PackageName . unpack - -mkFlagName :: Text -> FlagName -mkFlagName = FlagName . unpack - -display :: DT.Text a => a -> Text -display = fromString . DT.display - -simpleParse :: (MonadThrow m, DT.Text a, Typeable a) => Text -> m a -simpleParse orig = withTypeRep $ \rep -> - case DT.simpleParse str of - Nothing -> throwM (ParseFailedException rep (pack str)) - Just v -> return v - where - str = unpack orig - - withTypeRep :: Typeable a => (TypeRep -> m a) -> m a - withTypeRep f = - res - where - res = f (typeOf (unwrap res)) - - unwrap :: m a -> a - unwrap _ = error "unwrap" - -data ParseFailedException = ParseFailedException TypeRep Text - deriving (Show, Typeable) -instance Exception ParseFailedException - -newtype Maintainer = Maintainer { unMaintainer :: Text } - deriving (Show, Eq, Ord, Hashable, ToJSON, FromJSON, IsString) - --- | Name of an executable. -newtype ExeName = ExeName { unExeName :: Text } - deriving (Show, Eq, Ord, Hashable, ToJSON, FromJSON, IsString) - -intersectVersionRanges :: VersionRange -> VersionRange -> VersionRange -intersectVersionRanges x y = C.simplifyVersionRange $ C.intersectVersionRanges x y - --- | There seems to be a bug in Cabal where serializing and deserializing --- version ranges winds up with different representations. So we have a --- super-simplifier to deal with that. -simplifyVersionRange :: VersionRange -> VersionRange -simplifyVersionRange vr = - fromMaybe (assert False vr') $ simpleParse $ display vr' - where - vr' = C.simplifyVersionRange vr - --- | Topologically sort so that items with dependencies occur after those --- dependencies. -topologicalSort :: (Ord key, Show key, MonadThrow m, Typeable key) - => (value -> finalValue) - -> (value -> Set key) -- ^ deps - -> Map key value - -> m (Vector (key, finalValue)) -topologicalSort toFinal toDeps = - loop id . mapWithKey removeSelfDeps . fmap (toDeps &&& toFinal) - where - removeSelfDeps k (deps, final) = (deleteSet k deps, final) - loop front toProcess | null toProcess = return $ pack $ front [] - loop front toProcess - | null noDeps = throwM $ NoEmptyDeps (map fst toProcess') - | otherwise = loop (front . noDeps') (mapFromList hasDeps) - where - toProcess' = fmap (first removeUnavailable) toProcess - allKeys = Map.keysSet toProcess - removeUnavailable = asSet . setFromList . filter (`member` allKeys) . setToList - (noDeps, hasDeps) = partition (null . fst . snd) $ mapToList toProcess' - noDeps' = (map (second snd) noDeps ++) - -data TopologicalSortException key = NoEmptyDeps (Map key (Set key)) - deriving (Show, Typeable) -instance (Show key, Typeable key) => Exception (TopologicalSortException key) - -copyDir :: FilePath -> FilePath -> IO () -copyDir src dest = - runResourceT $ sourceDirectoryDeep False src $$ mapM_C go - where - src' = src "" - go fp = forM_ (F.stripPrefix src' fp) $ \suffix -> do - let dest' = dest suffix - liftIO $ createTree $ parent dest' - sourceFile fp $$ (sinkFile dest' :: Sink ByteString (ResourceT IO) ()) diff --git a/Stackage/ServerBundle.hs b/Stackage/ServerBundle.hs deleted file mode 100644 index 5aedb090..00000000 --- a/Stackage/ServerBundle.hs +++ /dev/null @@ -1,271 +0,0 @@ --- | Create a bundle to be uploaded to Stackage Server. -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -module Stackage.ServerBundle - ( serverBundle - , epochTime - , bpAllPackages - , docsListing - , createBundleV2 - , CreateBundleV2 (..) - , SnapshotType (..) - , writeIndexStyle - , DocMap - , PackageDocs (..) - ) where - -import qualified Codec.Archive.Tar as Tar -import qualified Codec.Archive.Tar.Entry as Tar -import qualified Codec.Compression.GZip as GZip -import qualified Data.Map as M -import Data.Aeson (ToJSON (..), (.=), object, FromJSON (..), (.:), withObject) -import System.IO.Temp (withTempDirectory) -import qualified Data.Yaml as Y -import Filesystem (isFile, getWorkingDirectory, listDirectory, isDirectory, canonicalizePath) -import Foreign.C.Types (CTime (CTime)) -import Stackage.BuildConstraints -import Stackage.BuildPlan -import Stackage.Prelude -import System.IO.Temp (withTempDirectory) -import qualified System.PosixCompat.Time as PC -import qualified Text.XML as X -import Text.XML.Cursor -import System.PosixCompat.Files (createSymbolicLink) - --- | Get current time -epochTime :: IO Tar.EpochTime -epochTime = (\(CTime t) -> fromIntegral t) <$> PC.epochTime - --- | All package/versions in a build plan, including core packages. --- --- Note that this may include packages not available on Hackage. -bpAllPackages :: BuildPlan -> Map PackageName Version -bpAllPackages BuildPlan {..} = - siCorePackages bpSystemInfo ++ map ppVersion bpPackages - -serverBundle :: Tar.EpochTime - -> Text -- ^ title - -> Text -- ^ slug - -> BuildPlan - -> LByteString -serverBundle time title slug bp@BuildPlan {..} = GZip.compress $ Tar.write - [ fe "build-plan.yaml" (fromStrict $ Y.encode bp) - , fe "hackage" hackage - , fe "slug" (fromStrict $ encodeUtf8 slug) - , fe "desc" (fromStrict $ encodeUtf8 title) - , fe "core" corePackagesList - ] - where - fe name contents = - case Tar.toTarPath False name of - Left s -> error s - Right name' -> (Tar.fileEntry name' contents) - { Tar.entryTime = time - } - hackage = builderToLazy $ foldMap goPair $ mapToList packageMap - - -- need to remove some packages that don't exist on Hackage - packageMap = foldr deleteMap (bpAllPackages bp) $ map PackageName - [ "bin-package-db" - , "ghc" - , "rts" - ] - - goPair (name, version) = - toBuilder (display name) ++ - toBuilder (asText "-") ++ - toBuilder (display version) ++ - toBuilder (asText "\n") - - corePackagesList = - builderToLazy $ toBuilder $ unlines $ - map (\(PackageName name) -> name) - (M.keys $ siCorePackages bpSystemInfo) - --- | Package name is key -type DocMap = Map Text PackageDocs -data PackageDocs = PackageDocs - { pdVersion :: Text - , pdModules :: Map Text [Text] - -- ^ module name, path - } -instance ToJSON PackageDocs where - toJSON PackageDocs {..} = object - [ "version" .= pdVersion - , "modules" .= pdModules - ] -instance FromJSON PackageDocs where - parseJSON = withObject "PackageDocs" $ \o -> PackageDocs - <$> o .: "version" - <*> o .: "modules" - -docsListing :: BuildPlan - -> FilePath -- ^ docs directory - -> IO DocMap -docsListing bp docsDir = - fmap fold $ mapM go $ mapToList $ bpAllPackages bp - where - go :: (PackageName, Version) -> IO DocMap - go (package, version) = do -- handleAny (const $ return mempty) $ do - let dirname = fpFromText (concat - [ display package - , "-" - , display version - ]) - indexFP = (docsDir dirname "index.html") - ie <- isFile indexFP - if ie - then do - doc <- flip X.readFile indexFP X.def - { X.psDecodeEntities = X.decodeHtmlEntities - } - let cursor = fromDocument doc - getPair x = take 1 $ do - href <- attribute "href" x - let name = concat $ x $// content - guard $ not $ null name - return (href, name) - pairs = cursor $// attributeIs "class" "module" - &/ laxElement "a" >=> getPair - m <- fmap fold $ forM pairs $ \(href, name) -> do - let suffix = dirname fpFromText href - e <- isFile $ docsDir suffix - return $ if e - then asMap $ singletonMap name [fpToText dirname, href] - else mempty - return $ singletonMap (display package) $ PackageDocs - { pdVersion = display version - , pdModules = m - } - else return mempty - -data SnapshotType = STNightly - | STLTS !Int !Int -- ^ major, minor - deriving (Show, Read, Eq, Ord) - -instance ToJSON SnapshotType where - toJSON STNightly = object - [ "type" .= asText "nightly" - ] - toJSON (STLTS major minor) = object - [ "type" .= asText "lts" - , "major" .= major - , "minor" .= minor - ] -instance FromJSON SnapshotType where - parseJSON = withObject "SnapshotType" $ \o -> do - t <- o .: "type" - case asText t of - "nightly" -> return STNightly - "lts" -> STLTS - <$> o .: "major" - <*> o .: "minor" - _ -> fail $ "Unknown type for SnapshotType: " ++ unpack t - -data CreateBundleV2 = CreateBundleV2 - { cb2Plan :: BuildPlan - , cb2Type :: SnapshotType - , cb2DocsDir :: FilePath - , cb2Dest :: FilePath - } - --- | Create a V2 bundle, which contains the build plan, metadata, docs, and doc --- map. -createBundleV2 :: CreateBundleV2 -> IO () -createBundleV2 CreateBundleV2 {..} = do - docsDir <- canonicalizePath cb2DocsDir - docMap <- docsListing cb2Plan cb2DocsDir - - Y.encodeFile (fpToString $ docsDir "build-plan.yaml") cb2Plan - Y.encodeFile (fpToString $ docsDir "build-type.yaml") cb2Type - Y.encodeFile (fpToString $ docsDir "docs-map.yaml") docMap - void $ writeIndexStyle Nothing cb2DocsDir - - currentDir <- getWorkingDirectory - files <- listDirectory docsDir - - let args = "cfJ" - : fpToString (currentDir cb2Dest) - : "--dereference" - : map (fpToString . filename) files - cp = (proc "tar" args) { cwd = Just $ fpToString docsDir } - withCheckedProcess cp $ \ClosedStream Inherited Inherited -> return () - -writeIndexStyle :: Maybe Text -- ^ snapshot id - -> FilePath -- ^ docs dir - -> IO [String] -writeIndexStyle msnapid dir = do - dirs <- fmap sort - $ runResourceT - $ sourceDirectory dir - $$ filterMC (liftIO . isDirectory) - =$ mapC (fpToString . filename) - =$ sinkList - writeFile (dir "index.html") $ mkIndex - (unpack <$> msnapid) - dirs - writeFile (dir "style.css") styleCss - return dirs - -mkIndex :: Maybe String -> [String] -> String -mkIndex msnapid dirs = concat - [ "\nHaddocks index" - , "" - , "" - , "" - , "" - , "
    " - , "
    " - , "

    Haddock documentation index

    " - , flip foldMap msnapid $ \snapid -> concat - [ "

    Return to snapshot

    " - ] - , "
      " - , concatMap toLI dirs - , "
    " - ] - where - toLI name = concat - [ "
  • " - , name - , "
  • " - ] - -styleCss :: String -styleCss = concat - [ "@media (min-width: 530px) {" - , "ul { -webkit-column-count: 2; -moz-column-count: 2; column-count: 2 }" - , "}" - , "@media (min-width: 760px) {" - , "ul { -webkit-column-count: 3; -moz-column-count: 3; column-count: 3 }" - , "}" - , "ul {" - , " margin-left: 0;" - , " padding-left: 0;" - , " list-style-type: none;" - , "}" - , "body {" - , " background: #f0f0f0;" - , " font-family: 'Lato', sans-serif;" - , " text-shadow: 1px 1px 1px #ffffff;" - , " font-size: 20px;" - , " line-height: 30px;" - , " padding-bottom: 5em;" - , "}" - , "h1 {" - , " font-weight: normal;" - , " color: #06537d;" - , " font-size: 45px;" - , "}" - , ".return a {" - , " color: #06537d;" - , " font-style: italic;" - , "}" - , ".return {" - , " margin-bottom: 1em;" - , "}"] diff --git a/Stackage/UpdateBuildPlan.hs b/Stackage/UpdateBuildPlan.hs deleted file mode 100644 index 8c67c5ef..00000000 --- a/Stackage/UpdateBuildPlan.hs +++ /dev/null @@ -1,54 +0,0 @@ -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} --- | Take an existing build plan and bump all packages to the newest version in --- the same major version number. -module Stackage.UpdateBuildPlan - ( updateBuildConstraints - , updateBuildPlan - ) where - -import qualified Data.Map as Map -import Distribution.Version (anyVersion, earlierVersion, - orLaterVersion) -import Stackage.BuildConstraints -import Stackage.BuildPlan -import Stackage.Prelude - -updateBuildPlan :: Map PackageName PackagePlan -> BuildPlan -> IO BuildPlan -updateBuildPlan packagesOrig - = newBuildPlan packagesOrig . updateBuildConstraints - -updateBuildConstraints :: BuildPlan -> BuildConstraints -updateBuildConstraints BuildPlan {..} = - BuildConstraints {..} - where - bcSystemInfo = bpSystemInfo - bcPackages = Map.keysSet bpPackages - bcGithubUsers = bpGithubUsers - - bcPackageConstraints name = PackageConstraints - { pcVersionRange = addBumpRange (maybe anyVersion pcVersionRange moldPC) - , pcMaintainer = moldPC >>= pcMaintainer - , pcTests = maybe ExpectSuccess pcTests moldPC - , pcHaddocks = maybe ExpectSuccess pcHaddocks moldPC - , pcBuildBenchmarks = maybe True pcBuildBenchmarks moldPC - , pcFlagOverrides = maybe mempty pcFlagOverrides moldPC - , pcEnableLibProfile = maybe False pcEnableLibProfile moldPC - } - where - moldBP = lookup name bpPackages - moldPC = ppConstraints <$> moldBP - - addBumpRange oldRange = - case moldBP of - Nothing -> oldRange - Just bp -> intersectVersionRanges oldRange - $ bumpRange $ ppVersion bp - - bumpRange version = intersectVersionRanges - (orLaterVersion version) - (earlierVersion $ bumpVersion version) - bumpVersion (Version (x:y:_) _) = Version [x, y + 1] [] - bumpVersion (Version [x] _) = Version [x, 1] [] - bumpVersion (Version [] _) = assert False $ Version [1, 0] [] diff --git a/Stackage/Upload.hs b/Stackage/Upload.hs deleted file mode 100644 index 64d21094..00000000 --- a/Stackage/Upload.hs +++ /dev/null @@ -1,272 +0,0 @@ --- | Upload to Stackage and Hackage -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE TupleSections #-} -module Stackage.Upload - ( UploadBundle (..) - , SnapshotIdent (..) - , uploadBundle - , UploadDocs (..) - , uploadDocs - , uploadHackageDistro - , uploadHackageDistroNamed - , UploadDocMap (..) - , uploadDocMap - , uploadBundleV2 - , UploadBundleV2 (..) - , def - , StackageServer - , unStackageServer - ) where - -import Control.Monad.Writer.Strict (execWriter, tell) -import Data.Default.Class (Default (..)) -import Data.Function (fix) -import Filesystem (isDirectory, isFile) -import Network.HTTP.Client -import qualified Network.HTTP.Client.Conduit as HCC -import Network.HTTP.Client.MultipartFormData -import Stackage.BuildPlan (BuildPlan) -import Stackage.Prelude -import Stackage.ServerBundle (bpAllPackages, docsListing, writeIndexStyle) -import System.IO.Temp (withSystemTempFile) -import qualified System.IO as IO -import qualified Data.Yaml as Y - -newtype StackageServer = StackageServer { unStackageServer :: Text } - deriving (Show, Eq, Ord, Hashable, IsString) -instance Default StackageServer where - def = "http://www.stackage.org" - -data UploadBundle = UploadBundle - { ubServer :: StackageServer - , ubContents :: LByteString - , ubAlias :: Maybe Text - , ubNightly :: Maybe Text -- ^ should be GHC version - , ubLTS :: Maybe Text -- ^ e.g. 2.3 - , ubAuthToken :: Text - } -instance Default UploadBundle where - def = UploadBundle - { ubServer = def - , ubContents = mempty - , ubAlias = Nothing - , ubNightly = Nothing - , ubLTS = Nothing - , ubAuthToken = "no-auth-token-provided" - } - -newtype SnapshotIdent = SnapshotIdent { unSnapshotIdent :: Text } - deriving (Show, Eq, Ord, Hashable, IsString) - -uploadBundle :: UploadBundle -> Manager -> IO (SnapshotIdent, Maybe Text) -uploadBundle UploadBundle {..} man = do - req1 <- parseUrl $ unpack $ unStackageServer ubServer ++ "/upload" - req2 <- formDataBody formData req1 - let req3 = req2 - { method = "PUT" - , requestHeaders = - [ ("Authorization", encodeUtf8 ubAuthToken) - , ("Accept", "application/json") - ] ++ requestHeaders req2 - , redirectCount = 0 - , checkStatus = \_ _ _ -> Nothing - , responseTimeout = Just 300000000 - } - res <- httpLbs req3 man - case lookup "x-stackage-ident" $ responseHeaders res of - Just snapid -> return - ( SnapshotIdent $ decodeUtf8 snapid - , decodeUtf8 <$> lookup "location" (responseHeaders res) - ) - Nothing -> error $ "An error occurred: " ++ show res - where - params = mapMaybe (\(x, y) -> (x, ) <$> y) - [ ("alias", ubAlias) - , ("nightly", ubNightly) - , ("lts", ubLTS) - ] - formData = ($ []) $ execWriter $ do - forM_ params $ \(key, value) -> - tell' $ partBS key $ encodeUtf8 value - tell' $ partFileRequestBody "stackage" "stackage" - $ RequestBodyLBS ubContents - - tell' x = tell (x:) - -data UploadDocs = UploadDocs - { udServer :: StackageServer - , udDocs :: FilePath -- ^ may be a directory or a tarball - , udAuthToken :: Text - , udSnapshot :: SnapshotIdent - } - -uploadDocs :: UploadDocs -> Manager -> IO (Response LByteString) -uploadDocs (UploadDocs (StackageServer host) fp0 token ident) man = do - fe <- isFile fp0 - if fe - then uploadDocsFile $ fpToString fp0 - else do - de <- isDirectory fp0 - if de - then uploadDocsDir - else error $ "Path not found: " ++ fpToString fp0 - where - uploadDocsDir = withSystemTempFile "haddocks.tar.xz" $ \fp h -> do - hClose h - dirs <- writeIndexStyle (Just $ unSnapshotIdent ident) fp0 - let cp = (proc "tar" $ "cJf" : fp : "index.html" : "style.css" : dirs) - { cwd = Just $ fpToString fp0 - } - withCheckedProcess cp $ \Inherited Inherited Inherited -> return () - uploadDocsFile fp - uploadDocsFile fp = do - req1 <- parseUrl $ unpack $ concat - [ host - , "/upload-haddock/" - , unSnapshotIdent ident - ] - let formData = - [ partFileSource "tarball" fp - ] - req2 <- formDataBody formData req1 - let req3 = req2 - { method = "PUT" - , requestHeaders = - [ ("Authorization", encodeUtf8 token) - , ("Accept", "application/json") - ] ++ requestHeaders req2 - , redirectCount = 0 - , checkStatus = \_ _ _ -> Nothing - , responseTimeout = Just 300000000 - } - httpLbs req3 man - -uploadHackageDistro :: BuildPlan - -> ByteString -- ^ Hackage username - -> ByteString -- ^ Hackage password - -> Manager - -> IO (Response LByteString) -uploadHackageDistro = uploadHackageDistroNamed "Stackage" - -uploadHackageDistroNamed - :: Text -- ^ distro name - -> BuildPlan - -> ByteString -- ^ Hackage username - -> ByteString -- ^ Hackage password - -> Manager - -> IO (Response LByteString) -uploadHackageDistroNamed name bp username password manager = do - req1 <- parseUrl $ concat - [ "http://hackage.haskell.org/distro/" - , unpack name - , "/packages.csv" - ] - let req2 = req1 - { requestHeaders = [("Content-Type", "text/csv")] - , requestBody = RequestBodyLBS csv - , checkStatus = \_ _ _ -> Nothing - , method = "PUT" - } - httpLbs (applyBasicAuth username password req2) manager - where - csv = encodeUtf8 - $ builderToLazy - $ mconcat - $ intersperse "\n" - $ map go - $ mapToList - $ bpAllPackages bp - go (name, version) = - "\"" ++ - (toBuilder $ display name) ++ - "\",\"" ++ - (toBuilder $ display version) ++ - "\",\"http://www.stackage.org/package/" ++ - (toBuilder $ display name) ++ - "\"" - -data UploadDocMap = UploadDocMap - { udmServer :: StackageServer - , udmAuthToken :: Text - , udmSnapshot :: SnapshotIdent - , udmDocDir :: FilePath - , udmPlan :: BuildPlan - } - -uploadDocMap :: UploadDocMap -> Manager -> IO (Response LByteString) -uploadDocMap UploadDocMap {..} man = do - docmap <- docsListing udmPlan udmDocDir - req1 <- parseUrl $ unpack $ unStackageServer udmServer ++ "/upload-doc-map" - req2 <- formDataBody (formData $ Y.encode docmap) req1 - let req3 = req2 - { method = "PUT" - , requestHeaders = - [ ("Authorization", encodeUtf8 udmAuthToken) - , ("Accept", "application/json") - ] ++ requestHeaders req2 - , redirectCount = 0 - , checkStatus = \_ _ _ -> Nothing - , responseTimeout = Just 300000000 - } - httpLbs req3 man - where - formData docmap = - [ partBS "snapshot" (encodeUtf8 $ unSnapshotIdent udmSnapshot) - , partFileRequestBody "docmap" "docmap" $ RequestBodyBS docmap - ] - -data UploadBundleV2 = UploadBundleV2 - { ub2Server :: StackageServer - , ub2AuthToken :: Text - , ub2Bundle :: FilePath - } - -uploadBundleV2 :: UploadBundleV2 -> Manager -> IO Text -uploadBundleV2 UploadBundleV2 {..} man = IO.withBinaryFile (fpToString ub2Bundle) IO.ReadMode $ \h -> do - size <- IO.hFileSize h - putStrLn $ "Bundle size: " ++ tshow size - req1 <- parseUrl $ unpack $ unStackageServer ub2Server ++ "/upload2" - let req2 = req1 - { method = "PUT" - , requestHeaders = - [ ("Authorization", encodeUtf8 ub2AuthToken) - , ("Accept", "application/json") - , ("Content-Type", "application/x-tar") - ] - , requestBody = HCC.requestBodySource (fromIntegral size) - $ sourceHandle h $= printProgress size - } - sink = decodeUtf8C =$ fix (\loop -> do - mx <- peekC - case mx of - Nothing -> error $ "uploadBundleV2: premature end of stream" - Just _ -> do - l <- lineC $ takeCE 4096 =$ foldC - let (cmd, msg') = break (== ':') l - msg = dropWhile (== ' ') $ dropWhile (== ':') msg' - case cmd of - "CONT" -> do - putStrLn msg - loop - "FAILURE" -> error $ "uploadBundleV2 failed: " ++ unpack msg - "SUCCESS" -> return msg - _ -> error $ "uploadBundleV2: unknown command " ++ unpack cmd - ) - withResponse req2 man $ \res -> HCC.bodyReaderSource (responseBody res) $$ sink - where - printProgress total = - loop 0 0 - where - loop sent lastPercent = - await >>= maybe (putStrLn "Upload complete") go - where - go bs = do - yield bs - let sent' = sent + fromIntegral (length bs) - percent = sent' * 100 `div` total - when (percent /= lastPercent) - $ putStrLn $ "Upload progress: " ++ tshow percent ++ "%" - loop sent' percent diff --git a/app/stackage.hs b/app/stackage.hs deleted file mode 100644 index d2618da2..00000000 --- a/app/stackage.hs +++ /dev/null @@ -1,210 +0,0 @@ -{-# LANGUAGE TupleSections #-} - -module Main where - -import Control.Monad -import Data.Monoid -import Data.String (fromString) -import Data.Version -import Options.Applicative -import Filesystem.Path.CurrentOS (decodeString) -import Paths_stackage (version) -import Stackage.CompleteBuild -import Stackage.Upload -import Stackage.InstallBuild -import Network.HTTP.Client (withManager) -import Network.HTTP.Client.TLS (tlsManagerSettings) -import qualified Data.Text as T - -main :: IO () -main = - join $ - execParser $ - info - (helpOption <*> versionOption <*> config) - (header "Stackage" <> - fullDesc) - where - helpOption = - abortOption ShowHelpText $ - long "help" <> - help "Show this help text" - versionOption = - infoOption - ("stackage version " ++ showVersion version) - (long "version" <> - help "Show stackage version") - config = - subparser $ - mconcat - [ cmnd - (uncurry completeBuild) - (fmap (Nightly, ) buildFlags) - "nightly" - "Build, test and upload the Nightly snapshot" - , cmnd - (uncurry completeBuild) - (fmap (LTS Major, ) buildFlags) - "lts-major" - "Build, test and upload the LTS (major) snapshot" - , cmnd - (uncurry completeBuild) - (fmap (LTS Minor, ) buildFlags) - "lts-minor" - "Build, test and upload the LTS (minor) snapshot" - , cmnd - justUploadNightly - nightlyUploadFlags - "upload-nightly" - "Upload an already-built nightly snapshot" - , cmnd - (const justCheck) - (pure ()) - "check" - "Just check that the build plan is ok" - , cmnd - installBuild - installFlags - "install" - "Install a snapshot from an existing build plan" - , cmnd - uploadv2 - uploadv2Flags - "upload2" - "Upload a pre-existing v2 bundle" - ] - - cmnd exec parse name desc = - command name $ - info - (fmap exec (parse <**> helpOption)) - (progDesc desc) - - buildFlags = - BuildFlags <$> - fmap - not - (switch - (long "skip-tests" <> - help "Skip build and running the test suites")) <*> - fmap - not - (switch - (long "skip-haddock" <> - help "Skip generating haddock documentation")) <*> - fmap - not - (switch - (long "skip-upload" <> - help "Skip uploading bundle, docs, etc.")) <*> - switch - (long "enable-library-profiling" <> - help "Enable profiling when building") <*> - switch - (long "enable-executable-dynamic" <> - help "Enable dynamic executables when building") <*> - switch - (long "verbose" <> short 'v' <> - help "Output verbose detail about the build steps") <*> - switch - (long "skip-check" <> - help "Skip the check phase, and pass --allow-newer to cabal configure") <*> - switch - (long "upload-v1" <> - help "Use the V1 upload code") <*> - (fmap fromString (strOption - (long "server-url" <> - metavar "SERVER-URL" <> - showDefault <> value (T.unpack $ unStackageServer def) <> - help "Server to upload bundle to"))) <*> - fmap - not - (switch - (long "skip-hoogle" <> - help "Skip generating Hoogle input files")) - - nightlyUploadFlags = fromString <$> strArgument - (metavar "DATE" <> - help "Date, in YYYY-MM-DD format") - - installFlags = - InstallFlags <$> - (fmap - BPSBundleWeb - (strOption - (long "bundle" <> - metavar "URL" <> - help "Stackage bundle containing build plan")) <|> - fmap - (BPSFile . decodeString) - (strOption - (long "build-plan" <> - metavar "PATH" <> - help "Build-plan YAML file"))) <*> - fmap - decodeString - (strArgument - (metavar "DESTINATION-PATH" <> - help "Destination directory path")) <*> - (fmap - (Just . decodeString) - (strOption - (long "log-dir" <> - metavar "PATH" <> - help "Location of log files (default DESTINATION-PATH/logs)")) <|> - pure Nothing) <*> - option - auto - (long "jobs" <> - metavar "NUMBER" <> - showDefault <> value 8 <> - help "Number of threads") <*> - switch - (long "global" <> - help "Install in global package database") <*> - fmap - not - (switch - (long "skip-tests" <> - help "Skip build and running the test suites")) <*> - fmap - not - (switch - (long "skip-haddock" <> - help "Skip generating haddock documentation")) <*> - switch - (long "enable-library-profiling" <> - help "Enable profiling when building") <*> - switch - (long "enable-executable-dynamic" <> - help "Enable dynamic executables when building") <*> - switch - (long "verbose" <> short 'v' <> - help "Output verbose detail about the build steps") <*> - switch - (long "skip-check" <> - help "Skip the check phase, and pass --allow-newer to cabal configure") <*> - fmap - not - (switch - (long "skip-hoogle" <> - help "Skip generating Hoogle input files")) - - uploadv2 (path, url) = withManager tlsManagerSettings $ \man -> do - token <- getStackageAuthToken - res <- flip uploadBundleV2 man UploadBundleV2 - { ub2AuthToken = token - , ub2Server = fromString url - , ub2Bundle = decodeString path - } - putStrLn $ "New URL: " ++ T.unpack res - - uploadv2Flags = (,) - <$> (strArgument - (metavar "BUNDLE-PATH" <> - help "Bundle path")) - <*> strOption - (long "server-url" <> - metavar "SERVER-URL" <> - showDefault <> value (T.unpack $ unStackageServer def) <> - help "Server to upload bundle to") diff --git a/build-constraints.yaml b/build-constraints.yaml index 7596251a..206af9e8 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -93,6 +93,7 @@ packages: - shelly - smtLib - stackage + - stackage-curator - statistics-linreg - th-expand-syns - thyme diff --git a/cabal.config b/cabal.config deleted file mode 100644 index cc656768..00000000 --- a/cabal.config +++ /dev/null @@ -1,847 +0,0 @@ --- Stackage snapshot from: http://www.stackage.org/snapshot/nightly-2014-12-24 --- Please place this file next to your .cabal file as cabal.config --- To only use tested packages, uncomment the following line: --- remote-repo: stackage-nightly-2014-12-24:http://www.stackage.org/snapshot/nightly-2014-12-24 -constraints: abstract-deque ==0.3, - abstract-par ==0.3.3, - accelerate ==0.15.0.0, - ace ==0.6, - action-permutations ==0.0.0.1, - active ==0.1.0.17, - AC-Vector ==2.3.2, - ad ==4.2.1.1, - adjunctions ==4.2, - aeson ==0.8.0.2, - aeson-pretty ==0.7.2, - aeson-qq ==0.7.4, - aeson-utils ==0.2.2.1, - alarmclock ==0.2.0.5, - alex ==3.1.3, - amqp ==0.10.1, - ansi-terminal ==0.6.2.1, - ansi-wl-pprint ==0.6.7.1, - appar ==0.1.4, - approximate ==0.2.1.1, - arbtt ==0.8.1.4, - arithmoi ==0.4.1.1, - array installed, - arrow-list ==0.6.1.5, - asn1-data ==0.7.1, - asn1-encoding ==0.9.0, - asn1-parse ==0.9.0, - asn1-types ==0.3.0, - async ==2.0.2, - atto-lisp ==0.2.2, - attoparsec ==0.12.1.2, - attoparsec-conduit ==1.1.0, - attoparsec-enumerator ==0.3.3, - attoparsec-expr ==0.1.1.1, - authenticate ==1.3.2.11, - auto-update ==0.1.2.1, - aws ==0.11, - bake ==0.2, - bank-holidays-england ==0.1.0.1, - barecheck ==0.2.0.6, - base16-bytestring ==0.1.1.6, - base64-bytestring ==1.0.0.1, - base-compat ==0.5.0, - base-prelude ==0.1.8, - base-unicode-symbols ==0.2.2.4, - basic-prelude ==0.3.10, - bifunctors ==4.2, - binary installed, - binary-list ==1.0.1.0, - bindings-DSL ==1.0.21, - bioace ==0.0.1, - bioalign ==0.0.5, - biocore ==0.3.1, - biofasta ==0.0.3, - biofastq ==0.1, - biophd ==0.0.5, - biopsl ==0.4, - biosff ==0.3.7.1, - bits ==0.4, - BlastHTTP ==1.0.1, - blastxml ==0.3.2, - blaze-builder ==0.3.3.4, - blaze-builder-enumerator ==0.2.0.6, - blaze-html ==0.7.0.3, - blaze-markup ==0.6.1.1, - blaze-svg ==0.3.4, - blaze-textual ==0.2.0.9, - BlogLiterately ==0.7.1.7, - BlogLiterately-diagrams ==0.1.4.3, - bloodhound ==0.5.0.1, - bmp ==1.2.5.2, - Boolean ==0.2.3, - bool-extras ==0.4.0, - bound ==1.0.4, - BoundedChan ==1.0.3.0, - bson ==0.3.1, - bumper ==0.6.0.2, - byteable ==0.1.1, - bytedump ==1.0, - byteorder ==1.0.4, - bytes ==0.14.1.2, - bytestring installed, - bytestring-builder ==0.10.4.0.1, - bytestring-lexing ==0.4.3.2, - bytestring-mmap ==0.2.2, - bytestring-progress ==1.0.3, - bytestring-trie ==0.2.4, - bzlib ==0.5.0.4, - bzlib-conduit ==0.2.1.3, - c2hs ==0.20.1, - Cabal installed, - cabal-install ==1.18.0.6, - cabal-src ==0.2.5, - cairo ==0.13.0.5, - case-insensitive ==1.2.0.3, - cases ==0.1.2, - cassava ==0.4.2.1, - cautious-file ==1.0.2, - cereal ==0.4.1.0, - cereal-conduit ==0.7.2.3, - certificate ==1.3.9, - charset ==0.3.7, - Chart ==1.3.2, - Chart-diagrams ==1.3.2, - ChasingBottoms ==1.3.0.8, - check-email ==1.0, - checkers ==0.4.1, - chell ==0.4, - chell-quickcheck ==0.2.4, - chunked-data ==0.1.0.1, - cipher-aes ==0.2.9, - cipher-blowfish ==0.0.3, - cipher-camellia ==0.0.2, - cipher-des ==0.0.6, - cipher-rc4 ==0.1.4, - circle-packing ==0.1.0.3, - classy-prelude ==0.10.2, - classy-prelude-conduit ==0.10.2, - classy-prelude-yesod ==0.10.2, - clientsession ==0.9.1.1, - clock ==0.4.1.3, - cmdargs ==0.10.12, - code-builder ==0.1.3, - colour ==2.3.3, - comonad ==4.2.2, - comonads-fd ==4.0, - comonad-transformers ==4.0, - compdata ==0.9, - compensated ==0.6.1, - composition ==1.0.1.0, - compressed ==3.10, - concatenative ==1.0.1, - concurrent-extra ==0.7.0.9, - concurrent-supply ==0.1.7, - cond ==0.4.1.1, - conduit ==1.2.3.1, - conduit-combinators ==0.3.0.5, - conduit-extra ==1.1.5.1, - configurator ==0.3.0.0, - connection ==0.2.3, - constraints ==0.4.1.1, - containers installed, - containers-unicode-symbols ==0.3.1.1, - contravariant ==1.2, - control-monad-free ==0.5.3, - control-monad-loop ==0.1, - convertible ==1.1.0.0, - cookie ==0.4.1.4, - courier ==0.1.0.15, - cpphs ==1.18.6, - cprng-aes ==0.6.1, - cpu ==0.1.2, - criterion ==1.0.2.0, - crypto-api ==0.13.2, - cryptocipher ==0.6.2, - crypto-cipher-tests ==0.0.11, - crypto-cipher-types ==0.0.9, - cryptohash ==0.11.6, - cryptohash-conduit ==0.1.1, - cryptohash-cryptoapi ==0.1.3, - crypto-numbers ==0.2.3, - crypto-pubkey ==0.2.6, - crypto-pubkey-types ==0.4.2.3, - crypto-random ==0.0.8, - crypto-random-api ==0.2.0, - css-text ==0.1.2.1, - csv ==0.1.2, - csv-conduit ==0.6.3, - curl ==1.3.8, - data-accessor ==0.2.2.6, - data-accessor-mtl ==0.2.0.4, - data-binary-ieee754 ==0.4.4, - data-default ==0.5.3, - data-default-class ==0.0.1, - data-default-instances-base ==0.0.1, - data-default-instances-containers ==0.0.1, - data-default-instances-dlist ==0.0.1, - data-default-instances-old-locale ==0.0.1, - data-inttrie ==0.1.0, - data-lens-light ==0.1.2.1, - data-memocombinators ==0.5.1, - data-reify ==0.6, - DAV ==1.0.3, - deepseq installed, - deepseq-generics ==0.1.1.2, - derive ==2.5.18, - diagrams ==1.2, - diagrams-builder ==0.6.0.2, - diagrams-cairo ==1.2.0.4, - diagrams-contrib ==1.1.2.4, - diagrams-core ==1.2.0.4, - diagrams-haddock ==0.2.2.12, - diagrams-lib ==1.2.0.7, - diagrams-postscript ==1.1.0.3, - diagrams-svg ==1.1.0.3, - Diff ==0.3.0, - digest ==0.0.1.2, - digestive-functors ==0.7.1.3, - dimensional ==0.13.0.1, - directory installed, - directory-tree ==0.12.0, - direct-sqlite ==2.3.14, - distributed-process ==0.5.3, - distributed-process-async ==0.2.0, - distributed-process-client-server ==0.1.1, - distributed-process-execution ==0.1.0, - distributed-process-extras ==0.1.1, - distributed-process-simplelocalnet ==0.2.2.0, - distributed-process-supervisor ==0.1.1, - distributed-process-task ==0.1.0, - distributed-static ==0.3.1.0, - distributive ==0.4.4, - djinn-ghc ==0.0.2.2, - djinn-lib ==0.0.1.2, - dlist ==0.7.1, - dlist-instances ==0.1, - doctest ==0.9.11.1, - double-conversion ==2.0.1.0, - dual-tree ==0.2.0.5, - easy-file ==0.2.0, - either ==4.3.2.1, - elm-build-lib ==0.14.0.0, - elm-compiler ==0.14, - elm-core-sources ==1.0.0, - elm-package ==0.2.2, - email-validate ==2.0.1, - enclosed-exceptions ==1.0.1, - entropy ==0.3.4.1, - enumerator ==0.4.20, - eq ==4.0.3, - erf ==2.0.0.0, - errorcall-eq-instance ==0.1.0, - errors ==1.4.7, - ersatz ==0.2.6.1, - esqueleto ==2.1.2.1, - exceptions ==0.6.1, - exception-transformers ==0.3.0.4, - executable-path ==0.0.3, - ex-pool ==0.2, - extensible-exceptions ==0.1.1.4, - extra ==1.0, - failure ==0.2.0.3, - fast-logger ==2.2.3, - fay ==0.21.2.1, - fay-base ==0.19.4.1, - fay-builder ==0.2.0.1, - fay-dom ==0.5, - fay-jquery ==0.6.0.2, - fay-text ==0.3.2, - fay-uri ==0.2.0.0, - fb ==1.0.7, - fb-persistent ==0.3.4, - fclabels ==2.0.2, - FenwickTree ==0.1.1, - fgl ==5.5.0.1, - file-embed ==0.0.7, - file-location ==0.4.5.3, - filemanip ==0.3.6.2, - filepath installed, - fingertree ==0.1.0.0, - fixed ==0.2.1, - fixed-list ==0.1.5, - flexible-defaults ==0.0.1.1, - focus ==0.1.3, - foldl ==1.0.7, - force-layout ==0.3.0.8, - foreign-store ==0.1, - formatting ==6.0.0, - fpco-api ==1.2.0.4, - free ==4.10.0.1, - freenect ==1.2, - frisby ==0.2, - fsnotify ==0.1.0.3, - fuzzcheck ==0.1.1, - gd ==3000.7.3, - generic-aeson ==0.2.0.2, - generic-deriving ==1.6.3, - generics-sop ==0.1.0.4, - ghc-heap-view ==0.5.3, - ghcid ==0.3.3, - ghc-mod ==5.2.1.1, - ghc-mtl ==1.2.1.0, - ghc-paths ==0.1.0.9, - ghc-prim installed, - ghc-syb-utils ==0.2.2, - gio ==0.13.0.3, - git-embed ==0.1.0, - gl ==0.6.2, - glib ==0.13.0.6, - Glob ==0.7.5, - GLURaw ==1.4.0.1, - GLUT ==2.5.1.1, - graph-core ==0.2.1.0, - graphs ==0.5.0.1, - graphviz ==2999.17.0.1, - gravatar ==0.6, - groundhog ==0.7.0.1, - groundhog-mysql ==0.7.0.1, - groundhog-postgresql ==0.7.0.1, - groundhog-sqlite ==0.7.0.1, - groundhog-th ==0.7.0, - groupoids ==4.0, - groups ==0.4.0.0, - gtk ==0.13.3, - gtk2hs-buildtools ==0.13.0.3, - haddock-api ==2.15.0.1, - haddock-library ==1.1.1, - half ==0.2.0.1, - HandsomeSoup ==0.3.5, - happstack-server ==7.3.9, - happy ==1.19.4, - hashable ==1.2.3.1, - hashable-extras ==0.2.0.1, - hashmap ==1.3.0.1, - hashtables ==1.2.0.1, - haskeline installed, - haskell2010 installed, - haskell98 installed, - haskell-lexer ==1.0, - haskell-names ==0.4.1, - haskell-packages ==0.2.4.3, - haskell-src ==1.0.1.6, - haskell-src-exts ==1.16.0.1, - haskell-src-meta ==0.6.0.8, - hasql ==0.4.1, - hasql-backend ==0.2.2, - hasql-postgres ==0.9.1, - hastache ==0.6.1, - HaTeX ==3.16.0.0, - HaXml ==1.24.1, - haxr ==3000.10.3.1, - HCodecs ==0.5, - hdaemonize ==0.5.0.0, - hdevtools ==0.1.0.6, - heaps ==0.3.1, - hebrew-time ==0.1.1, - heist ==0.14.0.1, - here ==1.2.6, - heredoc ==0.2.0.0, - highlighting-kate ==0.5.11.1, - hinotify ==0.3.7, - hint ==0.4.2.1, - histogram-fill ==0.8.3.0, - hit ==0.6.2, - hjsmin ==0.1.4.7, - hledger ==0.23.3, - hledger-lib ==0.23.3, - hlibgit2 ==0.18.0.13, - hlint ==1.9.13, - hmatrix ==0.16.1.2, - hmatrix-gsl ==0.16.0.2, - holy-project ==0.1.1.1, - hoogle ==4.2.36, - hoopl installed, - hOpenPGP ==1.11, - hopenpgp-tools ==0.13, - hostname ==1.0, - hostname-validate ==1.0.0, - hourglass ==0.2.6, - hpc installed, - hPDB ==1.2.0, - hPDB-examples ==1.1.2, - hs-bibutils ==5.5, - hscolour ==1.20.3, - hse-cpp ==0.1, - hslogger ==1.2.6, - hslua ==0.3.13, - hspec ==2.1.2, - hspec2 ==0.6.1, - hspec-core ==2.1.2, - hspec-discover ==2.1.2, - hspec-expectations ==0.6.1, - hspec-meta ==2.0.0, - hspec-wai ==0.6.2, - hspec-wai-json ==0.6.0, - HStringTemplate ==0.7.3, - hsyslog ==2.0, - HTF ==0.12.2.3, - html ==1.0.1.2, - html-conduit ==1.1.1.1, - HTTP ==4000.2.19, - http-client ==0.4.6.1, - http-client-tls ==0.2.2, - http-conduit ==2.1.5, - http-date ==0.0.4, - http-reverse-proxy ==0.4.1.2, - http-types ==0.8.5, - HUnit ==1.2.5.2, - hweblib ==0.6.3, - hxt ==9.3.1.10, - hxt-charproperties ==9.2.0.0, - hxt-http ==9.1.5, - hxt-pickle-utils ==0.1.0.2, - hxt-regex-xmlschema ==9.2.0, - hxt-relaxng ==9.1.5.1, - hxt-unicode ==9.0.2.2, - hybrid-vectors ==0.1.2, - hyphenation ==0.4, - idna ==0.3.0, - ieee754 ==0.7.4, - imagesize-conduit ==1.0.0.4, - immortal ==0.2, - incremental-parser ==0.2.3.3, - indents ==0.3.3, - ini ==0.2.2, - integer-gmp installed, - integration ==0.2.0.1, - interpolate ==0.1.0, - interpolatedstring-perl6 ==0.9.0, - intervals ==0.7.0.1, - io-choice ==0.0.5, - io-manager ==0.1.0.2, - io-memoize ==1.1.1.0, - iproute ==1.3.1, - iterable ==3.0, - ixset ==1.0.6, - js-flot ==0.8.3, - js-jquery ==1.11.1, - json-schema ==0.7.3.0, - JuicyPixels ==3.1.7.1, - JuicyPixels-repa ==0.7, - kan-extensions ==4.1.1, - kdt ==0.2.2, - keter ==1.3.7.1, - keys ==3.10.1, - kure ==2.4.10, - language-c ==0.4.7, - language-ecmascript ==0.16.2, - language-glsl ==0.1.1, - language-haskell-extract ==0.2.4, - language-java ==0.2.7, - language-javascript ==0.5.13, - lazy-csv ==0.5, - lca ==0.2.4, - lens ==4.6.0.1, - lens-aeson ==1.0.0.3, - lens-family-th ==0.4.0.0, - lhs2tex ==1.18.1, - libgit ==0.3.0, - libnotify ==0.1.1.0, - lifted-async ==0.2.0.2, - lifted-base ==0.2.3.3, - linear ==1.15.5, - linear-accelerate ==0.2, - list-t ==0.3.1, - loch-th ==0.2.1, - log-domain ==0.9.3, - logfloat ==0.12.1, - logict ==0.6.0.2, - loop ==0.2.0, - lucid ==2.5, - machines ==0.4.1, - mandrill ==0.1.1.0, - map-syntax ==0.2, - markdown ==0.1.13, - markdown-unlit ==0.2.0.1, - math-functions ==0.1.5.2, - matrix ==0.3.4.0, - MaybeT ==0.1.2, - MemoTrie ==0.6.2, - mersenne-random-pure64 ==0.2.0.4, - messagepack ==0.3.0, - messagepack-rpc ==0.1.0.3, - mime-mail ==0.4.6.2, - mime-mail-ses ==0.3.2.1, - mime-types ==0.1.0.5, - missing-foreign ==0.1.1, - MissingH ==1.3.0.1, - mmap ==0.5.9, - mmorph ==1.0.4, - MonadCatchIO-transformers ==0.3.1.3, - monad-control ==0.3.3.0, - monad-coroutine ==0.8.0.1, - monadcryptorandom ==0.6.1, - monad-extras ==0.5.9, - monadic-arrays ==0.2.1.3, - monad-journal ==0.6.0.2, - monad-logger ==0.3.11.1, - monad-loops ==0.4.2.1, - monad-par ==0.3.4.7, - monad-parallel ==0.7.1.3, - monad-par-extras ==0.3.3, - monad-primitive ==0.1, - monad-products ==4.0.0.1, - MonadPrompt ==1.0.0.5, - MonadRandom ==0.3.0.1, - monad-st ==0.2.4, - monads-tf ==0.1.0.2, - mongoDB ==2.0.3, - monoid-extras ==0.3.3.5, - monoid-subclasses ==0.3.6.2, - mono-traversable ==0.7.0, - mtl ==2.1.3.1, - mtlparse ==0.1.2, - mtl-prelude ==1.0.1, - multimap ==1.2.1, - multipart ==0.1.2, - MusicBrainz ==0.2.2, - mwc-random ==0.13.2.2, - mysql ==0.1.1.7, - mysql-simple ==0.2.2.4, - nanospec ==0.2.0, - nats ==1, - neat-interpolation ==0.2.2, - nettle ==0.1.0, - network ==2.6.0.2, - network-conduit-tls ==1.1.0.2, - network-info ==0.2.0.5, - network-multicast ==0.0.11, - network-simple ==0.4.0.2, - network-transport ==0.4.1.0, - network-transport-tcp ==0.4.1, - network-transport-tests ==0.2.1.0, - network-uri ==2.6.0.1, - newtype ==0.2, - nsis ==0.2.4, - numbers ==3000.2.0.1, - numeric-extras ==0.0.3, - NumInstances ==1.4, - numtype ==1.1, - Octree ==0.5.3, - old-locale installed, - old-time installed, - OneTuple ==0.2.1, - opaleye ==0.3, - OpenGL ==2.9.2.0, - OpenGLRaw ==1.5.0.0, - openpgp-asciiarmor ==0.1, - operational ==0.2.3.2, - options ==1.2.1, - optparse-applicative ==0.11.0.1, - osdkeys ==0.0, - pandoc ==1.13.2, - pandoc-citeproc ==0.6, - pandoc-types ==1.12.4.1, - pango ==0.13.0.4, - parallel ==3.2.0.5, - parallel-io ==0.3.3, - parseargs ==0.1.5.2, - parsec ==3.1.7, - parsers ==0.12.1.1, - partial-handler ==0.1.0, - path-pieces ==0.1.5, - patience ==0.1.1, - pcre-light ==0.4.0.3, - pdfinfo ==1.5.1, - pem ==0.2.2, - persistent ==2.1.1.3, - persistent-mongoDB ==2.1.2, - persistent-mysql ==2.1.2, - persistent-postgresql ==2.1.2, - persistent-sqlite ==2.1.1.2, - persistent-template ==2.1.0.1, - phantom-state ==0.2.0.2, - pipes ==4.1.4, - pipes-concurrency ==2.0.2, - pipes-parse ==3.0.2, - placeholders ==0.1, - pointed ==4.1.1, - polyparse ==1.9, - pool-conduit ==0.1.2.3, - postgresql-binary ==0.5.0, - postgresql-libpq ==0.9.0.1, - postgresql-simple ==0.4.8.0, - pqueue ==1.2.1, - prefix-units ==0.1.0.2, - prelude-extras ==0.4, - present ==2.2, - pretty installed, - prettyclass ==1.0.0.0, - pretty-class ==1.0.1.1, - pretty-show ==1.6.8, - primes ==0.2.1.0, - primitive ==0.5.4.0, - process installed, - process-conduit ==1.2.0.1, - process-extras ==0.2.0, - product-profunctors ==0.6, - profunctor-extras ==4.0, - profunctors ==4.3.2, - project-template ==0.1.4.2, - publicsuffixlist ==0.1, - punycode ==2.0, - pure-io ==0.2.1, - pureMD5 ==2.1.2.1, - pwstore-fast ==2.4.4, - quandl-api ==0.2.0.0, - QuasiText ==0.1.2.5, - QuickCheck ==2.7.6, - quickcheck-assertions ==0.1.1, - quickcheck-instances ==0.3.9, - quickcheck-io ==0.1.1, - quickpull ==0.4.0.0, - rainbow ==0.20.0.4, - rainbow-tests ==0.20.0.4, - random ==1.0.1.1, - random-fu ==0.2.6.1, - random-shuffle ==0.0.4, - random-source ==0.3.0.6, - rank1dynamic ==0.2.0.1, - raw-strings-qq ==1.0.2, - ReadArgs ==1.2.2, - reducers ==3.10.3, - reflection ==1.5.1, - regex-applicative ==0.3.0.3, - regex-base ==0.93.2, - regex-compat ==0.95.1, - regex-pcre-builtin ==0.94.4.8.8.35, - regex-posix ==0.95.2, - regexpr ==0.5.4, - regex-tdfa ==1.2.0, - regex-tdfa-rc ==1.1.8.3, - regular ==0.3.4.3, - regular-xmlpickler ==0.2, - rematch ==0.2.0.0, - repa ==3.3.1.2, - repa-algorithms ==3.3.1.2, - repa-devil ==0.3.2.2, - repa-io ==3.3.1.2, - reroute ==0.2.2.1, - resource-pool ==0.2.3.2, - resourcet ==1.1.3.3, - rest-client ==0.4.0.2, - rest-core ==0.33.1.2, - rest-gen ==0.16.1.3, - rest-happstack ==0.2.10.3, - rest-snap ==0.1.17.14, - rest-stringmap ==0.2.0.2, - rest-types ==1.11.1.1, - rest-wai ==0.1.0.4, - rev-state ==0.1, - rfc5051 ==0.1.0.3, - runmemo ==1.0.0.1, - rvar ==0.2.0.2, - safe ==0.3.8, - safecopy ==0.8.3, - scientific ==0.3.3.3, - scotty ==0.9.0, - scrobble ==0.2.1.1, - securemem ==0.1.4, - semigroupoid-extras ==4.0, - semigroupoids ==4.2, - semigroups ==0.16.0.1, - sendfile ==0.7.9, - seqloc ==0.6, - setenv ==0.1.1.2, - SHA ==1.6.4.1, - shake ==0.14.2, - shake-language-c ==0.6.3, - shakespeare ==2.0.2.1, - shakespeare-i18n ==1.1.0, - shakespeare-text ==1.1.0, - shell-conduit ==4.5, - shelly ==1.5.6, - silently ==1.2.4.1, - simple-reflect ==0.3.2, - simple-sendfile ==0.2.18, - singletons ==1.0, - siphash ==1.0.3, - skein ==1.0.9.2, - slave-thread ==0.1.5, - smallcheck ==1.1.1, - smtLib ==1.0.7, - snap ==0.13.3.2, - snap-core ==0.9.6.4, - snaplet-fay ==0.3.3.8, - snap-server ==0.9.4.6, - socks ==0.5.4, - sodium ==0.11.0.2, - sourcemap ==0.1.3.0, - speculation ==1.5.0.1, - sphinx ==0.6.0.1, - split ==0.2.2, - Spock ==0.7.5.1, - spoon ==0.3.1, - sqlite-simple ==0.4.8.0, - stateref ==0.3, - statestack ==0.2.0.3, - statistics ==0.13.2.1, - statistics-linreg ==0.3, - stm ==2.4.4, - stm-chans ==3.0.0.2, - stm-conduit ==2.5.2, - stm-containers ==0.2.7, - stm-stats ==0.2.0.0, - storable-complex ==0.2.1, - storable-endian ==0.2.5, - streaming-commons ==0.1.8, - streams ==3.2, - strict ==0.3.2, - stringable ==0.1.3, - stringbuilder ==0.5.0, - stringprep ==1.0.0, - stringsearch ==0.3.6.5, - stylish-haskell ==0.5.11.0, - SVGFonts ==1.4.0.3, - syb ==0.4.2, - syb-with-class ==0.6.1.5, - system-canonicalpath ==0.2.0.0, - system-fileio ==0.3.16, - system-filepath ==0.4.13, - system-posix-redirect ==1.1.0.1, - tabular ==0.2.2.5, - tagged ==0.7.3, - tagshare ==0.0, - tagsoup ==0.13.3, - tagstream-conduit ==0.5.5.3, - tar ==0.4.0.1, - tardis ==0.3.0.0, - tasty ==0.10.1, - tasty-ant-xml ==1.0.1, - tasty-golden ==2.2.2.4, - tasty-hunit ==0.9.0.1, - tasty-quickcheck ==0.8.3.2, - tasty-smallcheck ==0.8.0.1, - tasty-th ==0.1.3, - template-haskell installed, - temporary ==1.2.0.3, - temporary-rc ==1.2.0.3, - terminal-progress-bar ==0.0.1.4, - terminal-size ==0.3.0, - terminfo installed, - test-framework ==0.8.1.0, - test-framework-hunit ==0.3.0.1, - test-framework-quickcheck2 ==0.3.0.3, - test-framework-th ==0.2.4, - testing-feat ==0.4.0.2, - testpack ==2.1.3.0, - texmath ==0.8.0.1, - text ==1.1.1.3, - text-binary ==0.1.0, - text-format ==0.3.1.1, - text-icu ==0.7.0.0, - tf-random ==0.5, - th-desugar ==1.4.2, - th-expand-syns ==0.3.0.4, - th-extras ==0.0.0.2, - th-lift ==0.7, - th-orphans ==0.8.2, - threads ==0.5.1.2, - th-reify-many ==0.1.2, - thyme ==0.3.5.5, - time installed, - time-compat ==0.1.0.3, - time-lens ==0.4.0.1, - timezone-olson ==0.1.6, - timezone-series ==0.1.4, - tls ==1.2.13, - tls-debug ==0.3.4, - tostring ==0.2.1, - transformers installed, - transformers-base ==0.4.3, - transformers-compat ==0.3.3.3, - traverse-with-class ==0.2.0.3, - tree-view ==0.4, - tuple ==0.3.0.2, - type-eq ==0.4.2, - type-list ==0.0.0.0, - udbus ==0.2.1, - unbounded-delays ==0.1.0.8, - union-find ==0.2, - uniplate ==1.6.12, - unix installed, - unix-compat ==0.4.1.3, - unix-time ==0.3.4, - unordered-containers ==0.2.5.1, - uri-encode ==1.5.0.3, - url ==2.1.3, - utf8-light ==0.4.2, - utf8-string ==0.3.8, - uuid ==1.3.7, - vault ==0.3.0.4, - vector ==0.10.12.2, - vector-algorithms ==0.6.0.3, - vector-binary-instances ==0.2.1.0, - vector-instances ==3.3, - vector-space ==0.8.7, - vector-space-points ==0.2, - vector-th-unbox ==0.2.1.0, - vhd ==0.2.2, - void ==0.7, - wai ==3.0.2.1, - wai-app-static ==3.0.0.5, - wai-conduit ==3.0.0.2, - wai-eventsource ==3.0.0, - wai-extra ==3.0.3.1, - wai-logger ==2.2.3, - wai-middleware-static ==0.6.0.1, - wai-websockets ==3.0.0.3, - warp ==3.0.4.1, - warp-tls ==3.0.1.1, - webdriver ==0.6.0.3, - web-fpco ==0.1.1.0, - websockets ==0.9.2.1, - wizards ==1.0.1, - wl-pprint ==1.1, - wl-pprint-extras ==3.5.0.3, - wl-pprint-terminfo ==3.7.1.3, - wl-pprint-text ==1.1.0.2, - word8 ==0.1.1, - X11 ==1.6.1.2, - x509 ==1.5.0.1, - x509-store ==1.5.0, - x509-system ==1.5.0, - x509-validation ==1.5.1, - xenstore ==0.1.1, - xhtml installed, - xml ==1.3.13, - xml-conduit ==1.2.3.1, - xmlgen ==0.6.2.1, - xml-hamlet ==0.4.0.9, - xmlhtml ==0.2.3.3, - xml-types ==0.3.4, - xss-sanitize ==0.3.5.4, - yackage ==0.7.0.6, - yaml ==0.8.10.1, - Yampa ==0.9.6, - YampaSynth ==0.2, - yesod ==1.4.1.3, - yesod-auth ==1.4.1.1, - yesod-auth-deskcom ==1.4.0, - yesod-auth-fb ==1.6.6, - yesod-auth-hashdb ==1.4.1.1, - yesod-bin ==1.4.3.1, - yesod-core ==1.4.7.1, - yesod-eventsource ==1.4.0.1, - yesod-fay ==0.7.0, - yesod-fb ==0.3.4, - yesod-form ==1.4.3.1, - yesod-gitrepo ==0.1.1.0, - yesod-newsfeed ==1.4.0.1, - yesod-persistent ==1.4.0.2, - yesod-sitemap ==1.4.0.1, - yesod-static ==1.4.0.4, - yesod-test ==1.4.2.1, - yesod-text-markdown ==0.1.7, - yesod-websockets ==0.2.1.1, - zeromq4-haskell ==0.6.2, - zip-archive ==0.2.3.5, - zlib ==0.5.4.2, - zlib-bindings ==0.1.1.5, - zlib-enum ==0.2.3.1, - zlib-lens ==0.1 diff --git a/debian-bootstrap.sh b/debian-bootstrap.sh deleted file mode 100755 index 827e8460..00000000 --- a/debian-bootstrap.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -ex - -# Work in progress: create a list of commands necessary to get Stackage -# up-and-running on a freshly installed Debian-based system (includin Ubuntu). - -# Quick start: -# wget -O - https://raw.github.com/fpco/stackage/master/debian-bootstrap.sh | bash -ex - -# NOTE: Requires that GHC and Cabal are installed and on your PATH. For -# instructions, see: -# http://www.stackage.org/install - -add-apt-repository -y ppa:chris-lea/zeromq -add-apt-repository -y ppa:floe/libtisch -add-apt-repository -y ppa:zoogie/sdl2-snapshots -apt-get update -apt-get install -y \ - build-essential \ - libncurses-dev \ - git \ - wget \ - m4 \ - texlive-full \ - libgmp3c2 \ - libgmp3-dev \ - zlib1g-dev \ - libedit2 \ - libedit-dev \ - freeglut3-dev \ - libglu1-mesa-dev \ - libglib2.0-dev \ - libcairo2-dev \ - libpango1.0-dev \ - libgtk2.0-dev \ - zip \ - libdevil-dev \ - llvm \ - libbz2-dev \ - libjudy-dev \ - libsqlite3-dev \ - libmysqlclient-dev \ - libpq-dev \ - libicu-dev \ - libssl-dev \ - libgsl0-dev \ - libblas-dev \ - liblapack-dev \ - libcurl4-openssl-dev \ - libfreenect-dev \ - libnotify-dev \ - libgd2-xpm-dev \ - libyaml-dev \ - liblzma-dev \ - libsdl2-dev \ - libxss-dev \ - libzmq3-dev - -mkdir /tmp/nettle-build -( -cd /tmp/nettle-build -wget https://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz -tar zxf nettle-2.7.1.tar.gz -cd nettle-2.7.1 -./configure --prefix=/usr -make -make install - -mkdir -p /usr/lib/x86_64-linux-gnu/ -ln -sfv /usr/lib/libnettle.so.4.7 /usr/lib/x86_64-linux-gnu/libnettle.so.4 -) -rm -rf /tmp/nettle-build diff --git a/stackage.cabal b/stackage.cabal deleted file mode 100644 index d12c172b..00000000 --- a/stackage.cabal +++ /dev/null @@ -1,105 +0,0 @@ -name: stackage -version: 0.6.0.1 -synopsis: "Stable Hackage," tools for creating a vetted set of packages from Hackage. -description: Please see for a description and documentation. -homepage: https://github.com/fpco/stackage -license: MIT -license-file: LICENSE -author: Michael Snoyman -maintainer: michael@fpcomplete.com -category: Distribution -build-type: Simple -cabal-version: >=1.10 -extra-source-files: README.md - ChangeLog.md - test/test-build-constraints.yaml - -library - default-language: Haskell2010 - exposed-modules: Stackage.Prelude - Stackage.BuildConstraints - Stackage.CorePackages - Stackage.PackageIndex - Stackage.BuildPlan - Stackage.CheckBuildPlan - Stackage.UpdateBuildPlan - Stackage.GhcPkg - Stackage.GithubPings - Stackage.InstallBuild - Stackage.PackageDescription - Stackage.ServerBundle - Stackage.Upload - Stackage.PerformBuild - Stackage.CompleteBuild - build-depends: base >= 4 && < 5 - , containers - , Cabal >= 1.14 - , tar >= 0.3 - , zlib - , bytestring - , directory - , filepath - , transformers - , process - , old-locale - , time - , utf8-string - - , conduit-extra - , classy-prelude-conduit - , text - , system-fileio - , system-filepath - , mtl - , aeson - , yaml - , unix-compat - , http-client - , http-conduit - , http-client-tls - , temporary - , data-default-class - , stm - , mono-traversable - , async - , streaming-commons >= 0.1.7.1 - , semigroups - , xml-conduit - , conduit - -executable stackage - default-language: Haskell2010 - hs-source-dirs: app - main-is: stackage.hs - build-depends: base - , stackage - , optparse-applicative >= 0.11 - , system-filepath - , http-client - , http-client-tls - , text - ghc-options: -rtsopts -threaded -with-rtsopts=-N - -test-suite spec - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Spec.hs - other-modules: Stackage.CorePackagesSpec - Stackage.PackageIndexSpec - Stackage.BuildPlanSpec - build-depends: base - , stackage - , hspec - , QuickCheck - , text - , classy-prelude-conduit - , Cabal - , yaml - , containers - , http-client - , http-client-tls - -source-repository head - type: git - location: https://github.com/fpco/stackage diff --git a/test/Spec.hs b/test/Spec.hs deleted file mode 100644 index a824f8c3..00000000 --- a/test/Spec.hs +++ /dev/null @@ -1 +0,0 @@ -{-# OPTIONS_GHC -F -pgmF hspec-discover #-} diff --git a/test/Stackage/BuildPlanSpec.hs b/test/Stackage/BuildPlanSpec.hs deleted file mode 100644 index b87c74d2..00000000 --- a/test/Stackage/BuildPlanSpec.hs +++ /dev/null @@ -1,143 +0,0 @@ -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-} -module Stackage.BuildPlanSpec (spec) where - -import qualified Data.Map as Map -import qualified Data.Map.Strict as M -import qualified Data.Set as S -import Data.Yaml -import qualified Data.Yaml as Y -import Distribution.Version -import Network.HTTP.Client -import Network.HTTP.Client.TLS (tlsManagerSettings) -import Stackage.BuildConstraints -import Stackage.BuildPlan -import Stackage.CheckBuildPlan -import Stackage.PackageDescription -import Stackage.Prelude -import Stackage.UpdateBuildPlan -import Test.Hspec - -spec :: Spec -spec = do - it "simple package set" $ check testBuildConstraints $ makePackageSet - [("foo", [0, 0, 0], [("bar", thisV [0, 0, 0])]) - ,("bar", [0, 0, 0], [])] - it "bad version range on depdendency fails" $ badBuildPlan $ makePackageSet - [("foo", [0, 0, 0], [("bar", thisV [1, 1, 0])]) - ,("bar", [0, 0, 0], [])] - it "nonexistent package fails to check" $ badBuildPlan $ makePackageSet - [("foo", [0, 0, 0], [("nonexistent", thisV [0, 0, 0])]) - ,("bar", [0, 0, 0], [])] - it "mutual cycles fail to check" $ badBuildPlan $ makePackageSet - [("foo", [0, 0, 0], [("bar", thisV [0, 0, 0])]) - ,("bar", [0, 0, 0], [("foo", thisV [0, 0, 0])])] - it "nested cycles fail to check" $ badBuildPlan $ makePackageSet - [("foo", [0, 0, 0], [("bar", thisV [0, 0, 0])]) - ,("bar", [0, 0, 0], [("mu", thisV [0, 0, 0])]) - ,("mu", [0, 0, 0], [("foo", thisV [0, 0, 0])])] - {- Shouldn't be testing this actually - it "default package set checks ok" $ - check defaultBuildConstraints getLatestAllowedPlans - -} - --- | Checking should be considered a bad build plan. -badBuildPlan :: (BuildConstraints -> IO (Map PackageName PackagePlan)) - -> void - -> IO () -badBuildPlan m _ = do - mu <- try (check testBuildConstraints m) - case mu of - Left (_ :: BadBuildPlan) -> - return () - Right () -> - error "Expected bad build plan." - --- | Check build plan with the given package set getter. -check :: (Manager -> IO BuildConstraints) - -> (BuildConstraints -> IO (Map PackageName PackagePlan)) - -> IO () -check readPlanFile getPlans = withManager tlsManagerSettings $ \man -> do - bc <- readPlanFile man - plans <- getPlans bc - bp <- newBuildPlan plans bc - let bs = Y.encode bp - ebp' = Y.decodeEither bs - - bp' <- either error return ebp' - - let allPackages = Map.keysSet (bpPackages bp) ++ Map.keysSet (bpPackages bp') - forM_ allPackages $ \name -> - (name, lookup name (bpPackages bp')) `shouldBe` - (name, lookup name (bpPackages bp)) - bpGithubUsers bp' `shouldBe` bpGithubUsers bp - - when (bp' /= bp) $ error "bp' /= bp" - bp2 <- updateBuildPlan plans bp - when (dropVersionRanges bp2 /= dropVersionRanges bp) $ error "bp2 /= bp" - checkBuildPlan bp - where - dropVersionRanges bp = - bp { bpPackages = map go $ bpPackages bp } - where - go pb = pb { ppConstraints = go' $ ppConstraints pb } - go' pc = pc { pcVersionRange = anyVersion } - --- | Make a package set from a convenient data structure. -makePackageSet - :: [(String,[Int],[(String,VersionRange)])] - -> BuildConstraints - -> IO (Map PackageName PackagePlan) -makePackageSet ps _ = - return $ - M.fromList $ - map - (\(name,ver,deps) -> - ( PackageName name - , dummyPackage ver $ - M.fromList $ - map - (\(dname,dver) -> - ( PackageName dname - , DepInfo {diComponents = S.fromList - [CompLibrary] - ,diRange = dver})) - deps)) - ps - where - dummyPackage v deps = - PackagePlan - {ppVersion = Version v [] - ,ppGithubPings = mempty - ,ppUsers = mempty - ,ppConstraints = - PackageConstraints - {pcVersionRange = anyV - ,pcMaintainer = Nothing - ,pcTests = Don'tBuild - ,pcHaddocks = Don'tBuild - ,pcBuildBenchmarks = False - ,pcFlagOverrides = mempty - ,pcEnableLibProfile = False} - ,ppDesc = - SimpleDesc - {sdPackages = deps - ,sdTools = mempty - ,sdProvidedExes = mempty - ,sdModules = mempty}} - --- | This exact version is required. -thisV :: [Int] -> VersionRange -thisV ver = thisVersion (Version ver []) - --- | Accept any version. -anyV :: VersionRange -anyV = anyVersion - --- | Test plan. -testBuildConstraints :: void -> IO BuildConstraints -testBuildConstraints _ = - decodeFileEither - (fpToString fp) >>= - either throwIO toBC - where fp = "test/test-build-constraints.yaml" diff --git a/test/Stackage/CorePackagesSpec.hs b/test/Stackage/CorePackagesSpec.hs deleted file mode 100644 index ce0c5d10..00000000 --- a/test/Stackage/CorePackagesSpec.hs +++ /dev/null @@ -1,19 +0,0 @@ -{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-} -module Stackage.CorePackagesSpec (spec) where - -import Stackage.CorePackages -import Stackage.Prelude -import Test.Hspec - -spec :: Spec -spec = do - it "works" $ void getCorePackages - it "contains known core packages" $ do - m <- getCorePackages - forM_ (words "ghc containers base") $ \p -> - m `shouldSatisfy` (member (PackageName p)) - it "getCoreExecutables includes known executables" $ do - s <- getCoreExecutables - s `shouldSatisfy` member "ghc" - s `shouldSatisfy` member "hsc2hs" - s `shouldSatisfy` member "runghc" diff --git a/test/Stackage/PackageIndexSpec.hs b/test/Stackage/PackageIndexSpec.hs deleted file mode 100644 index e0ef97e6..00000000 --- a/test/Stackage/PackageIndexSpec.hs +++ /dev/null @@ -1,21 +0,0 @@ -{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-} -module Stackage.PackageIndexSpec (spec) where - -import Stackage.PackageIndex -import Stackage.Prelude -import Test.Hspec -import Distribution.Package (packageId) - -spec :: Spec -spec = do - it "works" $ (runResourceT $ sourcePackageIndex $$ sinkNull :: IO ()) - it "getLatestDescriptions gives reasonable results" $ do - let f x y = (display x, display y) `member` asSet (setFromList - [ (asText "base", asText "4.5.0.0") - , ("does-not-exist", "9999999999999999999") - ]) - m <- getLatestDescriptions f return - length m `shouldBe` 1 - p <- simpleParse $ asText "base" - v <- simpleParse $ asText "4.5.0.0" - (pkgVersion . packageId <$> m) `shouldBe` singletonMap p v diff --git a/test/test-build-constraints.yaml b/test/test-build-constraints.yaml deleted file mode 100644 index de831eaf..00000000 --- a/test/test-build-constraints.yaml +++ /dev/null @@ -1,20 +0,0 @@ -packages: - "Test": - - foo - - bar - -global-flags: [] - -skipped-tests: [] -expected-test-failures: [] -expected-haddock-failures: [] -skipped-benchmarks: [] -skipped-profiling: [] - -github-users: - bar: - - demo - -package-flags: - foo: - demo: true From 98075e03c7d7910eb816811dac89ef5f336f1151 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 14:27:00 +0200 Subject: [PATCH 161/208] Add stackage-types --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 206af9e8..f97471e6 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -94,6 +94,7 @@ packages: - smtLib - stackage - stackage-curator + - stackage-types - statistics-linreg - th-expand-syns - thyme From 827cc6e5be4d7206f698de2d5813ba0038cd4de2 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 14:50:21 +0200 Subject: [PATCH 162/208] Docker no longer available --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 848c9744..b4337f12 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ build by running: ### Docker -Note: This method is currently considered experimental. +Note: This method has been disabled for now, but may be enabled again in the future. If you'd like to check a build plan, or perform an entire build, without specially configuring your system, Docker may be a good approach. To check if From 5bdd6de1b0e84e06951a99c9f99dd8e68e82b305 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 15:23:40 +0200 Subject: [PATCH 163/208] Add some Travis badges --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b4337f12..bd036c15 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ The Stackage project consists of multiple repositories. This repository contains the metadata on packages to be included in future builds and some project information. In addition, we have the following repositories: -* [stackage-server](https://github.com/fpco/stackage-server) -* [stackage-curator](https://github.com/fpco/stackage-curator) -* [stackage-types](https://github.com/fpco/stackage-types) +* [stackage-server](https://github.com/fpco/stackage-server) [![Build Status](https://travis-ci.org/fpco/stackage-server.svg?branch=master)](https://travis-ci.org/fpco/stackage-server) +* [stackage-curator](https://github.com/fpco/stackage-curator) [![Build Status](https://travis-ci.org/fpco/stackage-curator.svg?branch=master)](https://travis-ci.org/fpco/stackage-curator) +* [stackage-types](https://github.com/fpco/stackage-types) [![Build Status](https://travis-ci.org/fpco/stackage-types.svg?branch=master)](https://travis-ci.org/fpco/stackage-types) * [lts-haskell](https://github.com/fpco/lts-haskell) Get your package included From f8856289195e1ac6d1f57c4a98c8f1c17e62ca6e Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 15:25:23 +0200 Subject: [PATCH 164/208] Add another badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bd036c15..47f46a1f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ stackage ======== +[![Build Status](https://travis-ci.org/fpco/stackage.svg?branch=master)](https://travis-ci.org/fpco/stackage) + "Stable Hackage," tools for creating a vetted set of packages from Hackage. __NOTE__ This repository is for package authors to get their code into From db6cc51b0683089f705215621f77d2faaee7f338 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 16:23:35 +0200 Subject: [PATCH 165/208] Use prebuilt stackage-curator executable --- .travis.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7cf659d4..c74fb9e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,6 @@ env: - CABALVER=1.20 GHCVER=7.8.4 -cache: - directories: - - $HOME/.ghc - - $HOME/.cabal - # Note: the distinction between `before_install` and `install` is not important. before_install: - travis_retry sudo add-apt-repository -y ppa:hvr/ghc @@ -17,8 +12,10 @@ install: - cabal --version - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" - travis_retry cabal update - - cabal install -j + - wget https://s3.amazonaws.com/stackage-travis/stackage-curator.bz2 + - bunzip2 stackage-curator.bz2 + - chmod +x stackage-curator # Here starts the actual work to be performed for the package under test; any command which exits with a non-zero exit code causes the build to fail. script: - - ./dist/build/stackage/stackage check + - ./stackage-curator check From 03c7e123042e61e17eba13f5620ea36aa2d5ede0 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 16:26:10 +0200 Subject: [PATCH 166/208] Add back Docker stuff --- Dockerfile | 25 ++++++++++++++++ debian-bootstrap.sh | 71 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 Dockerfile create mode 100755 debian-bootstrap.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..e3b09c3b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu:12.04 + +ENV HOME /home/stackage +ENV LANG en_US.UTF-8 + +RUN mkdir /home/stackage -p +RUN locale-gen en_US.UTF-8 + +RUN DEBIAN_FRONTEND=noninteractive apt-get update +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common python-software-properties +RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:hvr/ghc -y + +ADD debian-bootstrap.sh /tmp/debian-bootstrap.sh +RUN DEBIAN_FRONTEND=noninteractive bash /tmp/debian-bootstrap.sh +RUN rm /tmp/debian-bootstrap.sh + +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cabal-install-1.20 ghc-7.8.4 alex-3.1.3 happy-1.19.4 + +ENV PATH /home/stackage/.cabal/bin:/usr/local/sbin:/usr/local/bin:/opt/ghc/7.8.4/bin:/opt/cabal/1.20/bin:/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:/usr/sbin:/usr/bin:/sbin:/bin + +RUN cabal update +RUN cabal install hscolour cabal-install --constraint "Cabal < 1.22" && cp $HOME/.cabal/bin/* /usr/local/bin && rm -rf $HOME/.cabal $HOME/.ghc /tmp/stackage +RUN wget https://s3.amazonaws.com/stackage-travis/stackage-curator.bz2 && bunzip2 stackage-curator.bz2 && chmod +x stackage-curator && mv stackage-curator /usr/local/bin + +RUN cd /home/stackage && cabal update && stackage-curator check diff --git a/debian-bootstrap.sh b/debian-bootstrap.sh new file mode 100755 index 00000000..827e8460 --- /dev/null +++ b/debian-bootstrap.sh @@ -0,0 +1,71 @@ +#!/bin/bash -ex + +# Work in progress: create a list of commands necessary to get Stackage +# up-and-running on a freshly installed Debian-based system (includin Ubuntu). + +# Quick start: +# wget -O - https://raw.github.com/fpco/stackage/master/debian-bootstrap.sh | bash -ex + +# NOTE: Requires that GHC and Cabal are installed and on your PATH. For +# instructions, see: +# http://www.stackage.org/install + +add-apt-repository -y ppa:chris-lea/zeromq +add-apt-repository -y ppa:floe/libtisch +add-apt-repository -y ppa:zoogie/sdl2-snapshots +apt-get update +apt-get install -y \ + build-essential \ + libncurses-dev \ + git \ + wget \ + m4 \ + texlive-full \ + libgmp3c2 \ + libgmp3-dev \ + zlib1g-dev \ + libedit2 \ + libedit-dev \ + freeglut3-dev \ + libglu1-mesa-dev \ + libglib2.0-dev \ + libcairo2-dev \ + libpango1.0-dev \ + libgtk2.0-dev \ + zip \ + libdevil-dev \ + llvm \ + libbz2-dev \ + libjudy-dev \ + libsqlite3-dev \ + libmysqlclient-dev \ + libpq-dev \ + libicu-dev \ + libssl-dev \ + libgsl0-dev \ + libblas-dev \ + liblapack-dev \ + libcurl4-openssl-dev \ + libfreenect-dev \ + libnotify-dev \ + libgd2-xpm-dev \ + libyaml-dev \ + liblzma-dev \ + libsdl2-dev \ + libxss-dev \ + libzmq3-dev + +mkdir /tmp/nettle-build +( +cd /tmp/nettle-build +wget https://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz +tar zxf nettle-2.7.1.tar.gz +cd nettle-2.7.1 +./configure --prefix=/usr +make +make install + +mkdir -p /usr/lib/x86_64-linux-gnu/ +ln -sfv /usr/lib/libnettle.so.4.7 /usr/lib/x86_64-linux-gnu/libnettle.so.4 +) +rm -rf /tmp/nettle-build From e643ebb1866798d5b2ac5f52c1f84b625edc45a8 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 16:42:34 +0200 Subject: [PATCH 167/208] Fix download path --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c74fb9e8..cf90696a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ install: - cabal --version - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" - travis_retry cabal update - - wget https://s3.amazonaws.com/stackage-travis/stackage-curator.bz2 + - wget https://s3.amazonaws.com/stackage-travis/stackage-curator/stackage-curator.bz2 - bunzip2 stackage-curator.bz2 - chmod +x stackage-curator From 717c7bdfb4463b67930eb1b8822a0f8010e2f080 Mon Sep 17 00:00:00 2001 From: Omari Norman Date: Sun, 22 Mar 2015 11:56:04 -0400 Subject: [PATCH 168/208] Remove quickpull and barecheck It's not worth upgrading these to support QuickCheck 2.8, as I no longer use these packages. I have removed the dependencies on these packages from my packages; no other Stackage packages depended on them. These packages were intended to solve two evils that often arise during testing (orphan instances and Template Haskell); however, I have reluctantly concluded that those evils are the lesser of other evils so these packages are no longer needed. --- build-constraints.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index f97471e6..1dc9629c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -122,9 +122,7 @@ packages: - kure "Omari Norman ": - - barecheck - rainbow - - quickpull - multiarg - prednote - cartel From df792c52dff8713562bab0cda44938e56e03a55f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 19:21:24 +0200 Subject: [PATCH 169/208] Fix download URL --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e3b09c3b..095bdc4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,6 @@ ENV PATH /home/stackage/.cabal/bin:/usr/local/sbin:/usr/local/bin:/opt/ghc/7.8.4 RUN cabal update RUN cabal install hscolour cabal-install --constraint "Cabal < 1.22" && cp $HOME/.cabal/bin/* /usr/local/bin && rm -rf $HOME/.cabal $HOME/.ghc /tmp/stackage -RUN wget https://s3.amazonaws.com/stackage-travis/stackage-curator.bz2 && bunzip2 stackage-curator.bz2 && chmod +x stackage-curator && mv stackage-curator /usr/local/bin +RUN wget https://s3.amazonaws.com/stackage-travis/stackage-curator/stackage-curator.bz2 && bunzip2 stackage-curator.bz2 && chmod +x stackage-curator && mv stackage-curator /usr/local/bin RUN cd /home/stackage && cabal update && stackage-curator check From 1d7df2eb550502ad6060de5b9e6676882f3c2e1e Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 20:50:15 +0200 Subject: [PATCH 170/208] Remove upper bounds and close #407 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 1dc9629c..ebf05124 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -756,9 +756,6 @@ packages: # for language-ecmascript as well. - language-ecmascript < 0.17 - # https://github.com/fpco/stackage/issues/407 - - HStringTemplate < 0.8 - # https://github.com/fpco/stackage/issues/410 - elm-package < 0.4 From 38ddd93e99d37bd0e6c4f3f2368bf6446cc78b6b Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 20:56:08 +0200 Subject: [PATCH 171/208] Remove upper bounds and close #390 Required removing elm-compiler. There are unreleased changes to elm-compiler which will allow it to be added back in the future. Pinging @JoeyEremondi --- build-constraints.yaml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index ebf05124..dcaced38 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -627,10 +627,11 @@ packages: "Joey Eremondi ": - aeson-pretty - digest - - elm-build-lib - - elm-compiler + # See: https://github.com/elm-lang/elm-compiler/commit/e714001a928b3834b62555fc350909c95d380ef4 + #- elm-build-lib + #- elm-compiler - elm-core-sources - - elm-package + #- elm-package - language-glsl - prettyclass - QuasiText @@ -751,14 +752,6 @@ packages: # Force a specific version that's compatible with transformers 0.3 - transformers-compat == 0.4.0.3 - # https://github.com/fpco/stackage/issues/390 - # NOTE: When this issue is resolved, remove the expected test failure - # for language-ecmascript as well. - - language-ecmascript < 0.17 - - # https://github.com/fpco/stackage/issues/410 - - elm-package < 0.4 - # https://github.com/fpco/stackage/issues/415 - hackage-db < 1.12 @@ -1042,9 +1035,6 @@ expected-test-failures: # https://github.com/vincenthz/hs-crypto-pubkey/issues/17 - crypto-pubkey - # https://github.com/jswebtools/language-ecmascript/issues/60 - - language-ecmascript - # https://github.com/kazu-yamamoto/unix-time/issues/29 - unix-time From 15e4569766253371b342412d3f835e841b48f0b0 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 22:43:31 +0200 Subject: [PATCH 172/208] Remove upper bounds and close #426 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index dcaced38..876760a9 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -758,9 +758,6 @@ packages: # https://github.com/fpco/stackage/issues/424 - control-monad-free < 0.6 - # https://github.com/fpco/stackage/issues/426 - - utf8-string < 1 - # https://github.com/fpco/stackage/issues/440 - th-orphans < 0.9 - file-location < 0.4.7 From 380a29bb622eb74abca676669bedd0a50f71b1d6 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 22 Mar 2015 22:49:14 +0200 Subject: [PATCH 173/208] Temporarily disable diagrams-haddock and digrams-builder for #443 --- build-constraints.yaml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 876760a9..141526b5 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -320,10 +320,13 @@ packages: #- BlogLiterately #- BlogLiterately-diagrams - diagrams - - diagrams-builder + + # https://github.com/fpco/stackage/issues/443 + #- diagrams-builder + #- diagrams-haddock + - diagrams-contrib - diagrams-core - - diagrams-haddock - diagrams-lib - diagrams-postscript - diagrams-svg @@ -769,14 +772,6 @@ packages: - blaze-markup < 0.7 - blaze-html < 0.8 - # https://github.com/fpco/stackage/issues/443 - - exceptions < 0.7 - - rest-client < 0.5 - - rest-types < 1.13 - - rest-core < 0.35 - - rest-gen < 0.17 - - rest-wai < 0.1.0.7 - # https://github.com/fpco/stackage/issues/467 - lens < 4.8 From afbbf9252ebe847a68085ad536bb0c00a84cab07 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Mar 2015 08:34:43 +0200 Subject: [PATCH 174/208] Skip uuid-types benchmark #488 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 141526b5..acdd5a65 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1117,6 +1117,9 @@ skipped-benchmarks: # sometimes falls out-of-sync on hasql-postgres - hasql + # https://github.com/fpco/stackage/issues/488 + - uuid-types + skipped-profiling: # https://github.com/nomeata/ghc-heap-view/commit/8d198eb8fbbad2ce0c4527c781659f35b8909c04#diff-8288955e209cfbead5b318a8598be9c0R10 - ghc-heap-view From fdc0554a0df8bae29605ad77933f37768fa19c54 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Mar 2015 12:20:48 +0200 Subject: [PATCH 175/208] Call out issue #487 --- build-constraints.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index acdd5a65..648bf853 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -769,6 +769,8 @@ packages: # https://github.com/fpco/stackage/issues/442 - blaze-builder < 0.4 + + # https://github.com/fpco/stackage/issues/487 - blaze-markup < 0.7 - blaze-html < 0.8 From 83f8bf083f89ec11d197b4eed6f57de0fde4cda7 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Mar 2015 20:09:23 +0200 Subject: [PATCH 176/208] Remove code explanation --- README.md | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/README.md b/README.md index 47f46a1f..65a7dc66 100644 --- a/README.md +++ b/README.md @@ -96,45 +96,3 @@ The following describes at a high level the series of steps for processing 1. Load up most recent build plan 2. Convert build plan into constraints for next build 3. Continue from step (3) above - -## Code explanation - -We start off with *constraints*. Constraints state things like "package X has a -given version range," who the maintainer is for a package, the description of -the system/compiler being used, etc. `BuildConstraints` describes the build as -a whole, whereas `PackageConstraints` describes the constraints on an -individual package. - -There are two primary ways of getting a `BuildConstraints`. -`defaultBuildConstraints` inspects the first GHC in the PATH environment variable to -determine GHC version, core packages, core tools, etc. It then uses the -`Stackage.Config` module to extract information on additional packages to be -installed. The secondary approach is in `Stackage2.UpdateBuildPlan`, which will be -discussed later. - -`BuildConstraints` does not specify a build completely. That is given by a -`BuildPlan`, which is similarly broken down into `BuildPlan` and `PackagePlan`. -In order to get a `BuildPlan`, we need two pieces of information: the -`BuildConstraints`, and a package index. The package index (usually downloaded -from Hackage) is a collection of all of the cabal files available. - -By applying a `BuildConstraints` to a package index (via `newBuildPlan`), we -get a proposed `BuildPlan`. There is no guarantee that this `BuildPlan` is -valid. To validate it, we use `checkBuildPlan`. A `BuildPlan` is an instance of -both `ToJSON` and `FromJSON`, and therefore can be serialized to a file for -later use. - -When dealing with LTS Haskell, we want to be able to take a `BuildPlan`, and -update to a newer `BuildPlan` that keeps all packages at the same major -version. `updateBuildConstraints` turns a `BuildPlan` into a new -`BuildConstraints` with that restriction, and `updateBuildPlan` applies -`newBuildPlan` to that result. As mentioned previously: this is *not* a -validated result, and therefore `checkBuildPlan` must be used. - -A `BuildPlan` can be acted on. This is done to check that all packages compile -together, run relevant test suites, test Haddock documentation is correct, and -produce as artifacts both a self-contained GHC binary package database and a -set of Haddock documentation. (Not yet implemented.) - -A `BuildPlan` may be converted into a bundle to be uploaded to Stackage Server. -(Not yet implemented.) From 21d700f94ea35b8e70417d177af615b601987ea2 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 24 Mar 2015 08:45:39 +0200 Subject: [PATCH 177/208] Unblock hopenpgp-tools and close #463 --- build-constraints.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 648bf853..3e33051f 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -481,8 +481,7 @@ packages: - openpgp-asciiarmor - MusicBrainz - DAV - # https://github.com/fpco/stackage/issues/463 - #- hopenpgp-tools + - hopenpgp-tools # https://github.com/fpco/stackage/issues/160 "Ketil Malde": From c29d0b59c04ee842f4cca49e5b6d80d27910a8da Mon Sep 17 00:00:00 2001 From: Brendan Hay Date: Tue, 24 Mar 2015 08:54:26 +0100 Subject: [PATCH 178/208] Adding packages from @brendanhay --- build-constraints.yaml | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 3e33051f..7ac7fe45 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -749,6 +749,58 @@ packages: "Luke Taylor tekul.hs@gmail.com @tekul": - jose-jwt + "Brendan Hay brendan.g.hay@gmail.com @brendanhay": + - amazonka + - amazonka-core + - amazonka-autoscaling + - amazonka-cloudformation + - amazonka-cloudfront + - amazonka-cloudhsm + - amazonka-cloudsearch-domains + - amazonka-cloudsearch + - amazonka-cloudtrail + - amazonka-cloudwatch-logs + - amazonka-cloudwatch + - amazonka-codedeploy + - amazonka-cognito-identity + - amazonka-cognito-sync + - amazonka-config + - amazonka-datapipeline + - amazonka-directconnect + - amazonka-dynamodb + - amazonka-ec2 + - amazonka-ecs + - amazonka-elasticache + - amazonka-elasticbeanstalk + - amazonka-elastictranscoder + - amazonka-elb + - amazonka-emr + - amazonka-glacier + - amazonka-iam + - amazonka-importexport + - amazonka-kinesis + - amazonka-kms + - amazonka-lambda + - amazonka-opsworks + - amazonka-rds + - amazonka-redshift + - amazonka-route53-domains + - amazonka-route53 + - amazonka-s3 + - amazonka-sdb + - amazonka-ses + - amazonka-sns + - amazonka-sqs + - amazonka-ssm + - amazonka-storagegateway + - amazonka-sts + - amazonka-support + - amazonka-swf + - ede + - pagerduty + - semver + - text-manipulate + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From a7f952133d3cda4cf27bbfc1acafc9a9c831b67f Mon Sep 17 00:00:00 2001 From: Brendan Hay Date: Tue, 24 Mar 2015 14:06:40 +0100 Subject: [PATCH 179/208] Set old-locale=true flag for building amazonka-core --- build-constraints.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 7ac7fe45..9c44eb88 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -877,6 +877,8 @@ package-flags: old-locale: true tttool: old-locale: true + amazonka-core: + old-locale: true hxt: network-uri: true From 991780c6ccc562009a71c2566f6c7802812a17e5 Mon Sep 17 00:00:00 2001 From: Brendan Hay Date: Tue, 24 Mar 2015 16:26:41 +0100 Subject: [PATCH 180/208] Removing extraneous whitespace --- build-constraints.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 9c44eb88..d9d3d9fe 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -742,7 +742,7 @@ packages: "Oleg Grenrus oleg.grenrus@iki.fi @phadej": - waitra - + "Adam C. Foltzer acfoltzer@galois.com @acfoltzer": - gitrev From 296192f3fb55286a0775a4fc383f1fecc61f233b Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 24 Mar 2015 18:12:36 +0200 Subject: [PATCH 181/208] Remove upper bounds and close #485 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index d9d3d9fe..8c02d39c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -840,9 +840,6 @@ packages: # https://github.com/fpco/stackage/issues/483 - rethinkdb-client-driver < 0.0.15 - # https://github.com/fpco/stackage/issues/485 - - parsec < 3.1.9 - # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 1a66216447bfe1df09ab24f792c376eb8e302e98 Mon Sep 17 00:00:00 2001 From: "Adam C. Foltzer" Date: Tue, 24 Mar 2015 12:13:40 -0700 Subject: [PATCH 182/208] add cryptol It's finally on Hackage! --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 8c02d39c..e95fc500 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -744,6 +744,7 @@ packages: - waitra "Adam C. Foltzer acfoltzer@galois.com @acfoltzer": + - cryptol - gitrev "Luke Taylor tekul.hs@gmail.com @tekul": From 86645133647b9ec8320d70d4878ae6b6d5bec1a7 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 25 Mar 2015 08:28:06 +0200 Subject: [PATCH 183/208] Package author guidelines --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 65a7dc66..7c88a07e 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,21 @@ dependencies, you may send a pull request without testing first. You should also read the [maintainers agreement](https://github.com/fpco/stackage/wiki/Maintainers-Agreement). +Package Author Guidelines +------------------------- + +There are some basic rules to get your package to play nice with Stackage. Here +are some quick guidelines to hopefully make this easier: + +* Make sure that your code is buildability and testable from Hackage. Often + times, authors test their builds locally, but the tarball that gets uploaded + to Hackage is missing some necessary files. +* Make your code compatible with the newest versions of all dependencies. +* Make your code compatible with the versions of libraries that ship with GHC ([more information on lenient lower bounds](https://www.fpcomplete.com/blog/2014/05/lenient-lower-bounds)). + +There are certainly many other tips that could be added here. If you think of +any, please send a pull request! + Build the package set --------------------- From 32802f42cde8bb1bfa96adb343674c228216c495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=C3=ADaz?= Date: Wed, 25 Mar 2015 07:31:16 +0100 Subject: [PATCH 184/208] Two packages more for stackage. Also, added GitHub name. --- build-constraints.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index e95fc500..40e668b4 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -374,10 +374,12 @@ packages: - tardis - lens-family-th - "Daniel Díaz ": + "Daniel Díaz dhelta.diaz@gmail.com @Daniel-Diaz": - HaTeX - matrix - binary-list + - haskintex + - post-mess-age "Gabriel Gonzalez ": - pipes From c5204e0485e7f6b777c1d2f9c7b8100ddc235236 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 25 Mar 2015 08:44:50 +0200 Subject: [PATCH 185/208] Expected Haddock failure GaloisInc/cryptol#195 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index e95fc500..fa41725c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1144,6 +1144,9 @@ expected-haddock-failures: # builds. Could consider special-casing this requirement. - gtk + # https://github.com/GaloisInc/cryptol/issues/195 + - cryptol + # Benchmarks which should not be built. Note that Stackage does *not* generally # build benchmarks. The difference here will be whether dependencies for these # benchmarks are included or not. From 313fd69f06cdd3393f93ec04fcefd68b6c3a7ad7 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 25 Mar 2015 11:59:46 +0200 Subject: [PATCH 186/208] Remove upper bounds and close #440 --- build-constraints.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 0135e9ef..74c96a4c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -815,12 +815,6 @@ packages: # https://github.com/fpco/stackage/issues/424 - control-monad-free < 0.6 - # https://github.com/fpco/stackage/issues/440 - - th-orphans < 0.9 - - file-location < 0.4.7 - - th-desugar < 1.5.1 - - singletons < 1.1.1 - # https://github.com/fpco/stackage/issues/442 - blaze-builder < 0.4 From 7d207ebd08ffe7daa26c8abd17f940311a148bff Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 26 Mar 2015 07:57:14 +0200 Subject: [PATCH 187/208] Remove skipped Haddock and close #195 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 74c96a4c..6638c27b 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1140,9 +1140,6 @@ expected-haddock-failures: # builds. Could consider special-casing this requirement. - gtk - # https://github.com/GaloisInc/cryptol/issues/195 - - cryptol - # Benchmarks which should not be built. Note that Stackage does *not* generally # build benchmarks. The difference here will be whether dependencies for these # benchmarks are included or not. From 9fde0cf5f96336700c23b97d059ccb2e6a4e434a Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 26 Mar 2015 08:12:14 +0200 Subject: [PATCH 188/208] Link to multi-ghc-travis --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c88a07e..f7048506 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,9 @@ are some quick guidelines to hopefully make this easier: * Make sure that your code is buildability and testable from Hackage. Often times, authors test their builds locally, but the tarball that gets uploaded - to Hackage is missing some necessary files. + to Hackage is missing some necessary files. The best way to do this is to + set up a Travis job to do it for you. We recommend the + [multi-ghc-travis](https://github.com/hvr/multi-ghc-travis) approach. * Make your code compatible with the newest versions of all dependencies. * Make your code compatible with the versions of libraries that ship with GHC ([more information on lenient lower bounds](https://www.fpcomplete.com/blog/2014/05/lenient-lower-bounds)). From 4e01b4ed51e59203d56b7b4b2c8f258b6f26f7a3 Mon Sep 17 00:00:00 2001 From: gbaz Date: Thu, 26 Mar 2015 13:51:22 -0400 Subject: [PATCH 189/208] add my packages --- build-constraints.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 6638c27b..a156caeb 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -804,6 +804,18 @@ packages: - semver - text-manipulate + + "Gershom Bazerman @gbaz": + - jmacro + - jmacro-rpc + - jmacro-rpc-happstack + - jmacro-rpc-snap + - mbox + - kmeans + - boolsimplifier + - cubicspline + - maximal-cliques + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From 5efad4576f2c5438be249e2c87eb18dfa08f6619 Mon Sep 17 00:00:00 2001 From: Nick Partridge Date: Fri, 27 Mar 2015 08:22:28 +1000 Subject: [PATCH 190/208] Adds cabal-file-th to the package set --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 6638c27b..c723eb75 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -804,6 +804,9 @@ packages: - semver - text-manipulate + "Nick Partridge nkpart@gmail.com @nkpart": + - cabal-file-th + "Stackage upper bounds": # Force a specific version that's compatible with transformers 0.3 From 87b78a17c41566f651d20930303984f9ea37a0ba Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 27 Mar 2015 07:03:59 +0300 Subject: [PATCH 191/208] Upper bound for #494 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index c723eb75..e9ae08d6 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -840,6 +840,9 @@ packages: # https://github.com/fpco/stackage/issues/483 - rethinkdb-client-driver < 0.0.15 + # https://github.com/fpco/stackage/issues/494 + - criterion < 1.1 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From c9d72c4a17d46f83e326966c2fbc71f8145f0b1f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 27 Mar 2015 07:09:56 +0300 Subject: [PATCH 192/208] Upper bound for #495 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index e9ae08d6..2d2c7946 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -843,6 +843,9 @@ packages: # https://github.com/fpco/stackage/issues/494 - criterion < 1.1 + # https://github.com/fpco/stackage/issues/495 + - shake < 0.15 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 5b44174e89edab310d2f8e853416ec08b52d2d5b Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 27 Mar 2015 13:11:07 +0300 Subject: [PATCH 193/208] Remove upper bounds and close #495 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index e72d16c3..34ec41ca 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -854,9 +854,6 @@ packages: # https://github.com/fpco/stackage/issues/494 - criterion < 1.1 - # https://github.com/fpco/stackage/issues/495 - - shake < 0.15 - # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From b76b19a31e9edfcadb9738171d22661ff1b970ee Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 28 Mar 2015 20:48:55 +0300 Subject: [PATCH 194/208] Upper bound for #497 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 34ec41ca..84668fac 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -854,6 +854,9 @@ packages: # https://github.com/fpco/stackage/issues/494 - criterion < 1.1 + # https://github.com/fpco/stackage/issues/497 + - primitive < 0.6 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 5540c316ab6c9f7dae327f5f1b44864e904e324f Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 28 Mar 2015 20:52:40 +0300 Subject: [PATCH 195/208] GHC 7.8/Haddocks upper bounds --- build-constraints.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 84668fac..4550e18c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -819,6 +819,10 @@ packages: - maximal-cliques "Stackage upper bounds": + # GHC 7.8 uppdate bound + - haddock-api < 2.16 + - haddock-library < 1.2 + - hdocs < 0.4.2 # Force a specific version that's compatible with transformers 0.3 - transformers-compat == 0.4.0.3 From ba52b3776e31a09313ef71d0a922829987ffa744 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 28 Mar 2015 21:01:42 +0300 Subject: [PATCH 196/208] Upper bound for Daniel-Diaz/binary-list#2 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 4550e18c..49d6c9e6 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -861,6 +861,9 @@ packages: # https://github.com/fpco/stackage/issues/497 - primitive < 0.6 + # https://github.com/Daniel-Diaz/binary-list/issues/2 + - binary-list < 1.1 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 511b2366b0961626579de82ad1a0ba97601f7ebe Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 29 Mar 2015 00:34:21 +0300 Subject: [PATCH 197/208] Expected test failure for nsis --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 49d6c9e6..b45456a5 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -1152,6 +1152,9 @@ expected-test-failures: # Requires locally running services - network-anonymous-i2p + # Tests not reliable on non-Windows systems + - nsis + # Haddocks which are expected to fail. Same concept as expected test failures. expected-haddock-failures: # https://github.com/acw/bytestring-progress/issues/4 From 3dea63fd625939c349dc5b2854d363f1f25507df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=C3=ADaz?= Date: Sun, 29 Mar 2015 00:32:20 +0100 Subject: [PATCH 198/208] binary-list upper bound should no longer be necessary. --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index b45456a5..e08a4e40 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -861,9 +861,6 @@ packages: # https://github.com/fpco/stackage/issues/497 - primitive < 0.6 - # https://github.com/Daniel-Diaz/binary-list/issues/2 - - binary-list < 1.1 - # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From c49dfb95e6d9ff61ae1aaa81a1db923a6bf2dc55 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 29 Mar 2015 09:24:44 +0300 Subject: [PATCH 199/208] Upper bound for jgm/pandoc#2036 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index e08a4e40..5e39e88c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -861,6 +861,9 @@ packages: # https://github.com/fpco/stackage/issues/497 - primitive < 0.6 + # https://github.com/jgm/pandoc/issues/2036 + - highlighting-kate < 0.5.14 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: From 2a2c651c1a76f75b2ec86e8b35c0079223f363e3 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 29 Mar 2015 09:33:16 +0300 Subject: [PATCH 200/208] More restrictive upper bound @lierdakil --- build-constraints.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 5e39e88c..62f2b31c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -862,7 +862,7 @@ packages: - primitive < 0.6 # https://github.com/jgm/pandoc/issues/2036 - - highlighting-kate < 0.5.14 + - highlighting-kate < 0.5.13 # Package flags are applied to individual packages, and override the values of # global-flags From 1dd1e33b47042a69977f93d4d9735f49ea26cbc7 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 29 Mar 2015 12:49:00 +0300 Subject: [PATCH 201/208] Remove upper bounds and close #424 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 62f2b31c..d6fe2455 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -830,9 +830,6 @@ packages: # https://github.com/fpco/stackage/issues/415 - hackage-db < 1.12 - # https://github.com/fpco/stackage/issues/424 - - control-monad-free < 0.6 - # https://github.com/fpco/stackage/issues/442 - blaze-builder < 0.4 From 8276274632cd06b12524e6b245d311b55cd30e88 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 29 Mar 2015 12:50:19 +0300 Subject: [PATCH 202/208] Remove upper bounds and close ekmett/linear#70 --- build-constraints.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index d6fe2455..8cf32d6e 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -843,9 +843,6 @@ packages: # https://github.com/fpco/stackage/issues/476 - vector-space < 0.10 - # https://github.com/ekmett/linear/issues/70 - - linear < 1.18 - # https://github.com/fpco/stackage/issues/479 - QuickCheck < 2.8 From 858fa9e0fbb5ad32603a1e5bfca0be8339aa0186 Mon Sep 17 00:00:00 2001 From: Alexander Bondarenko Date: Sun, 29 Mar 2015 13:03:07 +0300 Subject: [PATCH 203/208] Register soap-* --- build-constraints.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 8cf32d6e..74854d56 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -818,6 +818,11 @@ packages: - cubicspline - maximal-cliques + "Alexander Bondarenko @wiz": + - soap + - soap-tls + - soap-openssl + "Stackage upper bounds": # GHC 7.8 uppdate bound - haddock-api < 2.16 From 165f8a8768faa79ad97ebb25165addde47682144 Mon Sep 17 00:00:00 2001 From: Gabriel Gonzalez Date: Sun, 29 Mar 2015 09:39:29 -0500 Subject: [PATCH 204/208] Add `turtle` to Stackage --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 74854d56..ea6fec5c 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -386,6 +386,7 @@ packages: - pipes-parse - pipes-concurrency - pipes-safe + - turtle "Chris Allen ": - bloodhound From f416811d4ac1ccdab51da679885a2e40ef011fd2 Mon Sep 17 00:00:00 2001 From: agocorona Date: Sun, 29 Mar 2015 20:42:24 +0200 Subject: [PATCH 205/208] Reintroduced Alberto G. Corona packages --- build-constraints.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index ea6fec5c..6d951c09 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -217,12 +217,11 @@ packages: # requires old haddock currently - haskell-docs # TODO: Add structured-haskell-mode once they've been ported to HSE 1.16. - # GHC 7.6 - # "Alberto G. Corona ": - # - RefSerialize - # - TCache - # - Workflow - # - MFlow + "Alberto G. Corona ": + - RefSerialize + - TCache + - Workflow + - MFlow "Edward Kmett ": - ad From ee4e58d3ef9486ccea50a129a976475eed1bafbb Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 29 Mar 2015 23:11:05 +0300 Subject: [PATCH 206/208] Remove upper bounds and close #341 --- build-constraints.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build-constraints.yaml b/build-constraints.yaml index 6d951c09..4f7a2a7a 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -435,10 +435,7 @@ packages: - amqp - curl - generics-sop - - # https://github.com/fpco/stackage/issues/341 - - haskell-names < 0.5 - + - haskell-names - haskell-packages - heredoc - hse-cpp From f31e09dc98c0dfc883748b98e8364d66269a9941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=C3=ADaz?= Date: Sun, 29 Mar 2015 22:19:17 +0200 Subject: [PATCH 207/208] Yet another package from Daniel Diaz. --- build-constraints.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 4f7a2a7a..f85bf874 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -379,6 +379,7 @@ packages: - binary-list - haskintex - post-mess-age + - include-file "Gabriel Gonzalez ": - pipes From c6be261fbc529fda7e240727c7640000e4bbf262 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 29 Mar 2015 23:22:43 +0300 Subject: [PATCH 208/208] Upper bound for bos/mwc-random#45 --- build-constraints.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-constraints.yaml b/build-constraints.yaml index 4f7a2a7a..abf13c51 100644 --- a/build-constraints.yaml +++ b/build-constraints.yaml @@ -860,6 +860,9 @@ packages: # https://github.com/jgm/pandoc/issues/2036 - highlighting-kate < 0.5.13 + # https://github.com/bos/mwc-random/issues/45 + - mwc-random < 0.13.3.1 + # Package flags are applied to individual packages, and override the values of # global-flags package-flags: