on master help sign in
Merge branch 'master' of https://github.com/fpco/stackage
commit8b8b3a87ec93e2d9e632753c5ff71ee2c760e920 authorMario Blažević <blamario@yahoo.com> dateSun 29 Mar 2015, 19:37 (12 years ago) parenteed98f002c9832
30 files changed+333−3751
.dockerignore+1 .gitignore−9 .travis.yml+4−7 ChangeLog.md−55 Dockerfile+5−7 README.md+28−47 Setup.hs−2 Stackage/BuildConstraints.hs−234 Stackage/BuildPlan.hs−214 Stackage/CheckBuildPlan.hs−162 Stackage/CompleteBuild.hs−293 Stackage/CorePackages.hs−53 Stackage/GithubPings.hs−36 Stackage/PackageDescription.hs−200 Stackage/PackageIndex.hs−127 Stackage/PerformBuild.hs−450 Stackage/Prelude.hs−103 Stackage/ServerBundle.hs−114 Stackage/UpdateBuildPlan.hs−54 Stackage/Upload.hs−279 app/stackage.hs−88 build-constraints.yaml+273−68 cabal.config−847 debian-bootstrap.sh+22−1 stackage.cabal−97 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
.dockerignore+1
@@ -5,3 +5,4 @@ logs
55cabal.sandbox.config
66tarballs
77*.yaml
8+.git
.gitignore−9
@@ -1,13 +1,4 @@
1−dist
2−*.o
3−*.hi
4−*.chi
5−*.chs.h
6−*.swp
71/builds/
82/logs/
9−/.cabal-sandbox/
10−cabal.sandbox.config
113nightly-*.yaml
124lts-*.yaml
13−/tarballs/
.travis.yml+4−7
@@ -1,11 +1,6 @@
11env:
22 - CABALVER=1.20 GHCVER=7.8.4
33
4−cache:
5− directories:
6− - $HOME/.ghc
7− - $HOME/.cabal
8−
94# Note: the distinction between `before_install` and `install` is not important.
105before_install:
116 - travis_retry sudo add-apt-repository -y ppa:hvr/ghc
@@ -17,8 +12,10 @@ install:
1712 - cabal --version
1813 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
1914 - travis_retry cabal update
20− - cabal install -j
15+ - wget https://s3.amazonaws.com/stackage-travis/stackage-curator/stackage-curator.bz2
16+ - bunzip2 stackage-curator.bz2
17+ - chmod +x stackage-curator
2118
2219# 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.
2320script:
24− - ./dist/build/stackage/stackage check
21+ - ./stackage-curator check
ChangeLog.mddeleted−55
@@ -1,55 +0,0 @@
1−## 0.5.2
2−
3−* Upload LTS to Hackage with the name LTSHaskell
4−
5−## 0.5.1
6−
7−* `loadBuildConstraints`
8−* More command line options
9−
10−## 0.5.0
11−
12−* Print "Still Alive" while checking, to avoid Travis timeouts
13−* Include `stackage upload-nightly` command
14−* Optional plan checking
15−
16−## 0.4.0
17−
18−* Command line uses optparse-applicative with additional options
19−* Library profiling support during build
20−* Remove cfGlobalFlags (just use package-specific flags)
21−
22−## 0.3.1
23−
24−* Added `justCheck` and `stackage check` command line.
25−
26−## 0.3.0.1
27−
28−Pre-fetch all packages from Hackage to catch Hackage downtime early.
29−
30−## 0.3.0.0
31−
32−* Return progress URL from uploadBundle
33−
34−## 0.2.1.4
35−
36−Generate a `core` file in bundles.
37−
38−## 0.2.1.1
39−
40−Run postBuild earlier to avoid problems from broken doc uploads.
41−
42−## 0.2.1.0
43−
44−* Use TLS manager (to download from Github)
45−
46−## 0.2.0.0
47−
48−* Minor fixes
49−* `pbGlobalInstall`
50−
51−## 0.1.0.0
52−
53−First version of Stackage which is made available as its own package. The
54−codebase has been completely rewritten at this point, to be ready for generated
55−both Stackage Nightly and LTS Haskell distributions.
Dockerfile+5−7
@@ -14,14 +14,12 @@ ADD debian-bootstrap.sh /tmp/debian-bootstrap.sh
1414RUN DEBIAN_FRONTEND=noninteractive bash /tmp/debian-bootstrap.sh
1515RUN rm /tmp/debian-bootstrap.sh
1616
17−RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cabal-install-1.20 ghc-7.8.4
17+RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cabal-install-1.20 ghc-7.8.4 alex-3.1.3 happy-1.19.4
1818
19−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
19+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
2020
2121RUN cabal update
22−ADD . /tmp/stackage
23−RUN cd /tmp/stackage && cabal install . hscolour
24−RUN cp $HOME/.cabal/bin/* /usr/local/bin
25−RUN rm -rf $HOME/.cabal $HOME/.ghc /tmp/stackage
22+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
23+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
2624
27−RUN cd /home/stackage && cabal update && stackage check
25+RUN cd /home/stackage && cabal update && stackage-curator check
README.md+28−47
@@ -1,16 +1,22 @@
11stackage
22========
33
4+[![Build Status](https://travis-ci.org/fpco/stackage.svg?branch=master)](https://travis-ci.org/fpco/stackage)
5+
46"Stable Hackage," tools for creating a vetted set of packages from Hackage.
57
68__NOTE__ This repository is for package authors to get their code into
79Stackage. If you simply want to use Stackage as an end user, please follow the
810instructions on [http://www.stackage.org/](http://www.stackage.org).
911
10−A note about the codebase: the goal is to minimize dependencies and have
11−the maximum range of supported compiler versions. Therefore, we avoid
12−anything "complicated." For example, instead of using the text package,
13−we use Strings everywhere.
12+The Stackage project consists of multiple repositories. This repository
13+contains the metadata on packages to be included in future builds and some
14+project information. In addition, we have the following repositories:
15+
16+* [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)
17+* [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)
18+* [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)
19+* [lts-haskell](https://github.com/fpco/lts-haskell)
1420
1521Get your package included
1622-------------------------
@@ -37,6 +43,23 @@ dependencies, you may send a pull request without testing first.
3743You should also read the [maintainers
3844agreement](https://github.com/fpco/stackage/wiki/Maintainers-Agreement).
3945
46+Package Author Guidelines
47+-------------------------
48+
49+There are some basic rules to get your package to play nice with Stackage. Here
50+are some quick guidelines to hopefully make this easier:
51+
52+* Make sure that your code is buildability and testable from Hackage. Often
53+ times, authors test their builds locally, but the tarball that gets uploaded
54+ to Hackage is missing some necessary files. The best way to do this is to
55+ set up a Travis job to do it for you. We recommend the
56+ [multi-ghc-travis](https://github.com/hvr/multi-ghc-travis) approach.
57+* Make your code compatible with the newest versions of all dependencies.
58+* 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)).
59+
60+There are certainly many other tips that could be added here. If you think of
61+any, please send a pull request!
62+
4063Build the package set
4164---------------------
4265
@@ -51,7 +74,7 @@ build by running:
5174
5275### Docker
5376
54−Note: This method is currently considered experimental.
77+Note: This method has been disabled for now, but may be enabled again in the future.
5578
5679If you'd like to check a build plan, or perform an entire build, without
5780specially configuring your system, Docker may be a good approach. To check if
@@ -90,45 +113,3 @@ The following describes at a high level the series of steps for processing
901131. Load up most recent build plan
911142. Convert build plan into constraints for next build
921153. Continue from step (3) above
93−
94−## Code explanation
95−
96−We start off with *constraints*. Constraints state things like "package X has a
97−given version range," who the maintainer is for a package, the description of
98−the system/compiler being used, etc. `BuildConstraints` describes the build as
99−a whole, whereas `PackageConstraints` describes the constraints on an
100−individual package.
101−
102−There are two primary ways of getting a `BuildConstraints`.
103−`defaultBuildConstraints` inspects the first GHC in the PATH environment variable to
104−determine GHC version, core packages, core tools, etc. It then uses the
105−`Stackage.Config` module to extract information on additional packages to be
106−installed. The secondary approach is in `Stackage2.UpdateBuildPlan`, which will be
107−discussed later.
108−
109−`BuildConstraints` does not specify a build completely. That is given by a
110−`BuildPlan`, which is similarly broken down into `BuildPlan` and `PackagePlan`.
111−In order to get a `BuildPlan`, we need two pieces of information: the
112−`BuildConstraints`, and a package index. The package index (usually downloaded
113−from Hackage) is a collection of all of the cabal files available.
114−
115−By applying a `BuildConstraints` to a package index (via `newBuildPlan`), we
116−get a proposed `BuildPlan`. There is no guarantee that this `BuildPlan` is
117−valid. To validate it, we use `checkBuildPlan`. A `BuildPlan` is an instance of
118−both `ToJSON` and `FromJSON`, and therefore can be serialized to a file for
119−later use.
120−
121−When dealing with LTS Haskell, we want to be able to take a `BuildPlan`, and
122−update to a newer `BuildPlan` that keeps all packages at the same major
123−version. `updateBuildConstraints` turns a `BuildPlan` into a new
124−`BuildConstraints` with that restriction, and `updateBuildPlan` applies
125−`newBuildPlan` to that result. As mentioned previously: this is *not* a
126−validated result, and therefore `checkBuildPlan` must be used.
127−
128−A `BuildPlan` can be acted on. This is done to check that all packages compile
129−together, run relevant test suites, test Haddock documentation is correct, and
130−produce as artifacts both a self-contained GHC binary package database and a
131−set of Haddock documentation. (Not yet implemented.)
132−
133−A `BuildPlan` may be converted into a bundle to be uploaded to Stackage Server.
134−(Not yet implemented.)
Setup.hsdeleted−2
@@ -1,2 +0,0 @@
1−import Distribution.Simple
2−main = defaultMain
Stackage/BuildConstraints.hsdeleted−234
@@ -1,234 +0,0 @@
1−{-# LANGUAGE NoImplicitPrelude #-}
2−{-# LANGUAGE OverloadedStrings #-}
3−{-# LANGUAGE RecordWildCards #-}
4−{-# LANGUAGE TupleSections #-}
5−-- | The constraints on package selection for a new build plan.
6−module Stackage.BuildConstraints
7− ( BuildConstraints (..)
8− , PackageConstraints (..)
9− , TestState (..)
10− , SystemInfo (..)
11− , getSystemInfo
12− , defaultBuildConstraints
13− , toBC
14− , BuildConstraintsSource (..)
15− , loadBuildConstraints
16− ) where
17−
18−import Control.Monad.Writer.Strict (execWriter, tell)
19−import Data.Aeson
20−import qualified Data.Map as Map
21−import Data.Yaml (decodeEither', decodeFileEither)
22−import Distribution.Package (Dependency (..))
23−import Distribution.System (Arch, OS)
24−import qualified Distribution.System
25−import Distribution.Version (anyVersion)
26−import Filesystem (isFile)
27−import Network.HTTP.Client (Manager, httpLbs, responseBody, Request)
28−import Stackage.CorePackages
29−import Stackage.Prelude
30−
31−data TestState = ExpectSuccess
32− | ExpectFailure
33− | Don'tBuild -- ^ when the test suite will pull in things we don't want
34− deriving (Show, Eq, Ord, Bounded, Enum)
35−
36−testStateToText :: TestState -> Text
37−testStateToText ExpectSuccess = "expect-success"
38−testStateToText ExpectFailure = "expect-failure"
39−testStateToText Don'tBuild = "do-not-build"
40−
41−instance ToJSON TestState where
42− toJSON = toJSON . testStateToText
43−instance FromJSON TestState where
44− parseJSON = withText "TestState" $ \t ->
45− case lookup t states of
46− Nothing -> fail $ "Invalid state: " ++ unpack t
47− Just v -> return v
48− where
49− states = asHashMap $ mapFromList
50− $ map (\x -> (testStateToText x, x)) [minBound..maxBound]
51−
52−data SystemInfo = SystemInfo
53− { siGhcVersion :: Version
54− , siOS :: OS
55− , siArch :: Arch
56− , siCorePackages :: Map PackageName Version
57− , siCoreExecutables :: Set ExeName
58− }
59− deriving (Show, Eq, Ord)
60−instance ToJSON SystemInfo where
61− toJSON SystemInfo {..} = object
62− [ "ghc-version" .= display siGhcVersion
63− , "os" .= display siOS
64− , "arch" .= display siArch
65− , "core-packages" .= Map.mapKeysWith const unPackageName (map display siCorePackages)
66− , "core-executables" .= siCoreExecutables
67− ]
68−instance FromJSON SystemInfo where
69− parseJSON = withObject "SystemInfo" $ \o -> do
70− let helper name = (o .: name) >>= either (fail . show) return . simpleParse
71− siGhcVersion <- helper "ghc-version"
72− siOS <- helper "os"
73− siArch <- helper "arch"
74− siCorePackages <- (o .: "core-packages") >>= goPackages
75− siCoreExecutables <- o .: "core-executables"
76− return SystemInfo {..}
77− where
78− goPackages = either (fail . show) return
79− . mapM simpleParse
80− . Map.mapKeysWith const mkPackageName
81−
82−data BuildConstraints = BuildConstraints
83− { bcPackages :: Set PackageName
84− -- ^ This does not include core packages.
85− , bcPackageConstraints :: PackageName -> PackageConstraints
86−
87− , bcSystemInfo :: SystemInfo
88−
89− , bcGithubUsers :: Map Text (Set Text)
90− -- ^ map an account to set of pingees
91− }
92−
93−data PackageConstraints = PackageConstraints
94− { pcVersionRange :: VersionRange
95− , pcMaintainer :: Maybe Maintainer
96− , pcTests :: TestState
97− , pcHaddocks :: TestState
98− , pcBuildBenchmarks :: Bool
99− , pcFlagOverrides :: Map FlagName Bool
100− , pcEnableLibProfile :: Bool
101− }
102− deriving (Show, Eq)
103−instance ToJSON PackageConstraints where
104− toJSON PackageConstraints {..} = object $ addMaintainer
105− [ "version-range" .= display pcVersionRange
106− , "tests" .= pcTests
107− , "haddocks" .= pcHaddocks
108− , "build-benchmarks" .= pcBuildBenchmarks
109− , "flags" .= Map.mapKeysWith const unFlagName pcFlagOverrides
110− , "library-profiling" .= pcEnableLibProfile
111− ]
112− where
113− addMaintainer = maybe id (\m -> (("maintainer" .= m):)) pcMaintainer
114−instance FromJSON PackageConstraints where
115− parseJSON = withObject "PackageConstraints" $ \o -> do
116− pcVersionRange <- (o .: "version-range")
117− >>= either (fail . show) return . simpleParse
118− pcTests <- o .: "tests"
119− pcHaddocks <- o .: "haddocks"
120− pcBuildBenchmarks <- o .: "build-benchmarks"
121− pcFlagOverrides <- Map.mapKeysWith const mkFlagName <$> o .: "flags"
122− pcMaintainer <- o .:? "maintainer"
123− pcEnableLibProfile <- fmap (fromMaybe False) (o .:? "library-profiling")
124− return PackageConstraints {..}
125−
126−-- | The proposed plan from the requirements provided by contributors.
127−--
128−-- Checks the current directory for a build-constraints.yaml file and uses it
129−-- if present. If not, downloads from Github.
130−defaultBuildConstraints :: Manager -> IO BuildConstraints
131−defaultBuildConstraints = loadBuildConstraints BCSDefault
132−
133−data BuildConstraintsSource
134− = BCSDefault
135− | BCSFile FilePath
136− | BCSWeb Request
137− deriving (Show)
138−
139−loadBuildConstraints :: BuildConstraintsSource -> Manager -> IO BuildConstraints
140−loadBuildConstraints bcs man = do
141− case bcs of
142− BCSDefault -> do
143− e <- isFile fp0
144− if e
145− then loadFile fp0
146− else loadReq req0
147− BCSFile fp -> loadFile fp
148− BCSWeb req -> loadReq req
149− where
150− fp0 = "build-constraints.yaml"
151− req0 = "https://raw.githubusercontent.com/fpco/stackage/master/build-constraints.yaml"
152−
153− loadFile fp = decodeFileEither (fpToString fp) >>= either throwIO toBC
154− loadReq req = httpLbs req man >>=
155− either throwIO toBC . decodeEither' . toStrict . responseBody
156−
157−
158−getSystemInfo :: IO SystemInfo
159−getSystemInfo = do
160− siCorePackages <- getCorePackages
161− siCoreExecutables <- getCoreExecutables
162− siGhcVersion <- getGhcVersion
163− return SystemInfo {..}
164− where
165− -- FIXME consider not hard-coding the next two values
166− siOS = Distribution.System.Linux
167− siArch = Distribution.System.X86_64
168−
169−data ConstraintFile = ConstraintFile
170− { cfPackageFlags :: Map PackageName (Map FlagName Bool)
171− , cfSkippedTests :: Set PackageName
172− , cfExpectedTestFailures :: Set PackageName
173− , cfExpectedHaddockFailures :: Set PackageName
174− , cfSkippedBenchmarks :: Set PackageName
175− , cfPackages :: Map Maintainer (Vector Dependency)
176− , cfGithubUsers :: Map Text (Set Text)
177− , cfSkippedLibProfiling :: Set PackageName
178− }
179−
180−instance FromJSON ConstraintFile where
181− parseJSON = withObject "ConstraintFile" $ \o -> do
182− cfPackageFlags <- (goPackageMap . fmap goFlagMap) <$> o .: "package-flags"
183− cfSkippedTests <- getPackages o "skipped-tests"
184− cfExpectedTestFailures <- getPackages o "expected-test-failures"
185− cfExpectedHaddockFailures <- getPackages o "expected-haddock-failures"
186− cfSkippedBenchmarks <- getPackages o "skipped-benchmarks"
187− cfSkippedLibProfiling <- getPackages o "skipped-profiling"
188− cfPackages <- o .: "packages"
189− >>= mapM (mapM toDep)
190− . Map.mapKeysWith const Maintainer
191− cfGithubUsers <- o .: "github-users"
192− return ConstraintFile {..}
193− where
194− goFlagMap = Map.mapKeysWith const FlagName
195− goPackageMap = Map.mapKeysWith const PackageName
196− getPackages o name = (setFromList . map PackageName) <$> o .: name
197−
198− toDep :: Monad m => Text -> m Dependency
199− toDep = either (fail . show) return . simpleParse
200−
201−toBC :: ConstraintFile -> IO BuildConstraints
202−toBC ConstraintFile {..} = do
203− bcSystemInfo <- getSystemInfo
204− return BuildConstraints {..}
205− where
206− combine (maintainer, range1) (_, range2) =
207− (maintainer, intersectVersionRanges range1 range2)
208− revmap = unionsWith combine $ ($ []) $ execWriter
209− $ forM_ (mapToList cfPackages)
210− $ \(maintainer, deps) -> forM_ deps
211− $ \(Dependency name range) ->
212− tell (singletonMap name (maintainer, range):)
213−
214− bcPackages = Map.keysSet revmap
215−
216− bcPackageConstraints name =
217− PackageConstraints {..}
218− where
219− mpair = lookup name revmap
220− pcMaintainer = fmap fst mpair
221− pcVersionRange = maybe anyVersion snd mpair
222− pcEnableLibProfile = not (name `member` cfSkippedLibProfiling)
223− pcTests
224− | name `member` cfSkippedTests = Don'tBuild
225− | name `member` cfExpectedTestFailures = ExpectFailure
226− | otherwise = ExpectSuccess
227− pcBuildBenchmarks = name `notMember` cfSkippedBenchmarks
228− pcHaddocks
229− | name `member` cfExpectedHaddockFailures = ExpectFailure
230−
231− | otherwise = ExpectSuccess
232− pcFlagOverrides = fromMaybe mempty $ lookup name cfPackageFlags
233−
234− bcGithubUsers = cfGithubUsers
Stackage/BuildPlan.hsdeleted−214
@@ -1,214 +0,0 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2−{-# LANGUAGE DeriveFoldable #-}
3−{-# LANGUAGE DeriveFunctor #-}
4−{-# LANGUAGE DeriveTraversable #-}
5−{-# LANGUAGE NoImplicitPrelude #-}
6−{-# LANGUAGE OverloadedStrings #-}
7−{-# LANGUAGE RecordWildCards #-}
8−{-# LANGUAGE TupleSections #-}
9−{-# LANGUAGE TypeFamilies #-}
10−-- | Representation of a concrete build plan, and how to generate a new one
11−-- based on constraints.
12−module Stackage.BuildPlan
13− ( BuildPlan (..)
14− , PackagePlan (..)
15− , newBuildPlan
16− , makeToolMap
17− , getLatestAllowedPlans
18− ) where
19−
20−import Control.Monad.State.Strict (execState, get, put)
21−import Data.Aeson
22−import qualified Data.Map as Map
23−import qualified Data.Set as Set
24−import qualified Distribution.Compiler
25−import Distribution.PackageDescription
26−import Stackage.BuildConstraints
27−import Stackage.GithubPings
28−import Stackage.PackageDescription
29−import Stackage.PackageIndex
30−import Stackage.Prelude
31−
32−data BuildPlan = BuildPlan
33− { bpSystemInfo :: SystemInfo
34− , bpTools :: Vector (PackageName, Version)
35− , bpPackages :: Map PackageName PackagePlan
36− , bpGithubUsers :: Map Text (Set Text)
37− }
38− deriving (Show, Eq)
39−
40−instance ToJSON BuildPlan where
41− toJSON BuildPlan {..} = object
42− [ "system-info" .= bpSystemInfo
43− , "tools" .= map goTool bpTools
44− , "packages" .= Map.mapKeysWith const unPackageName bpPackages
45− , "github-users" .= bpGithubUsers
46− ]
47− where
48− goTool (k, v) = object
49− [ "name" .= display k
50− , "version" .= display v
51− ]
52−instance FromJSON BuildPlan where
53− parseJSON = withObject "BuildPlan" $ \o -> do
54− bpSystemInfo <- o .: "system-info"
55− bpTools <- (o .: "tools") >>= mapM goTool
56− bpPackages <- Map.mapKeysWith const mkPackageName <$> (o .: "packages")
57− bpGithubUsers <- o .:? "github-users" .!= mempty
58− return BuildPlan {..}
59− where
60− goTool = withObject "Tool" $ \o -> (,)
61− <$> ((o .: "name") >>=
62− either (fail . show) return . simpleParse . asText)
63− <*> ((o .: "version") >>=
64− either (fail . show) return . simpleParse . asText)
65−
66−data PackagePlan = PackagePlan
67− { ppVersion :: Version
68− , ppGithubPings :: Set Text
69− , ppUsers :: Set PackageName
70− , ppConstraints :: PackageConstraints
71− , ppDesc :: SimpleDesc
72− }
73− deriving (Show, Eq)
74−
75−instance ToJSON PackagePlan where
76− toJSON PackagePlan {..} = object
77− [ "version" .= asText (display ppVersion)
78− , "github-pings" .= ppGithubPings
79− , "users" .= map unPackageName (unpack ppUsers)
80− , "constraints" .= ppConstraints
81− , "description" .= ppDesc
82− ]
83−instance FromJSON PackagePlan where
84− parseJSON = withObject "PackageBuild" $ \o -> do
85− ppVersion <- o .: "version"
86− >>= either (fail . show) return
87− . simpleParse . asText
88− ppGithubPings <- o .:? "github-pings" .!= mempty
89− ppUsers <- Set.map PackageName <$> (o .:? "users" .!= mempty)
90− ppConstraints <- o .: "constraints"
91− ppDesc <- o .: "description"
92− return PackagePlan {..}
93−
94−-- | Make a build plan given these package set and build constraints.
95−newBuildPlan :: MonadIO m => Map PackageName PackagePlan -> BuildConstraints -> m BuildPlan
96−newBuildPlan packagesOrig bc@BuildConstraints {..} = liftIO $ do
97− let toolMap = makeToolMap packagesOrig
98− packages = populateUsers $ removeUnincluded bc toolMap packagesOrig
99− toolNames :: [ExeName]
100− toolNames = concatMap (Map.keys . sdTools . ppDesc) packages
101− tools <- topologicalSortTools toolMap $ mapFromList $ do
102− exeName <- toolNames
103− guard $ exeName `notMember` siCoreExecutables
104− packageName <- maybe mempty setToList $ lookup exeName toolMap
105− packagePlan <- maybeToList $ lookup packageName packagesOrig
106− return (packageName, packagePlan)
107− -- FIXME topologically sort packages? maybe just leave that to the build phase
108− return BuildPlan
109− { bpSystemInfo = bcSystemInfo
110− , bpTools = tools
111− , bpPackages = packages
112− , bpGithubUsers = bcGithubUsers
113− }
114− where
115− SystemInfo {..} = bcSystemInfo
116−
117−makeToolMap :: Map PackageName PackagePlan
118− -> Map ExeName (Set PackageName)
119−makeToolMap =
120− unionsWith (++) . map go . mapToList
121− where
122− go (packageName, pp) =
123− foldMap go' $ sdProvidedExes $ ppDesc pp
124− where
125− go' exeName = singletonMap exeName (singletonSet packageName)
126−
127−topologicalSortTools :: MonadThrow m
128− => Map ExeName (Set PackageName)
129− -> Map PackageName PackagePlan
130− -> m (Vector (PackageName, Version))
131−topologicalSortTools toolMap = topologicalSort
132− ppVersion
133− (concatMap (fromMaybe mempty . flip lookup toolMap) . Map.keys . sdTools . ppDesc)
134−
135−-- | Include only packages which are dependencies of the required packages and
136−-- their build tools.
137−removeUnincluded :: BuildConstraints
138− -> Map ExeName (Set PackageName)
139− -> Map PackageName PackagePlan
140− -> Map PackageName PackagePlan
141−removeUnincluded BuildConstraints {..} toolMap orig =
142− mapFromList $ filter (\(x, _) -> x `member` included) $ mapToList orig
143− where
144− SystemInfo {..} = bcSystemInfo
145−
146− included :: Set PackageName
147− included = flip execState mempty $ mapM_ add bcPackages
148−
149− add name = do
150− inc <- get
151− when (name `notMember` inc) $ do
152− put $ insertSet name inc
153− case lookup name orig of
154− Nothing -> return ()
155− Just pb -> do
156− mapM_ add $ Map.keys $ sdPackages $ ppDesc pb
157− forM_ (Map.keys $ sdTools $ ppDesc pb) $
158− \exeName -> when (exeName `notMember` siCoreExecutables)
159− $ mapM_ add $ fromMaybe mempty $ lookup exeName toolMap
160−
161−populateUsers :: Map PackageName PackagePlan
162− -> Map PackageName PackagePlan
163−populateUsers orig =
164− mapWithKey go orig
165− where
166− go name pb = pb { ppUsers = foldMap (go2 name) (mapToList orig) }
167−
168− go2 dep (user, pb)
169− | dep `member` sdPackages (ppDesc pb) = singletonSet user
170− | otherwise = mempty
171−
172−-- | Check whether the given package/version combo meets the constraints
173−-- currently in place.
174−isAllowed :: BuildConstraints
175− -> PackageName -> Version -> Bool
176−isAllowed bc = \name version ->
177− case lookup name $ siCorePackages $ bcSystemInfo bc of
178− Just _ -> False -- never reinstall a core package
179− Nothing -> withinRange version $ pcVersionRange $ bcPackageConstraints bc name
180−
181−mkPackagePlan :: MonadThrow m
182− => BuildConstraints
183− -> GenericPackageDescription
184− -> m PackagePlan
185−mkPackagePlan bc gpd = do
186− ppDesc <- toSimpleDesc CheckCond {..} gpd
187− return PackagePlan {..}
188− where
189− PackageIdentifier name ppVersion = package $ packageDescription gpd
190− ppGithubPings = getGithubPings bc gpd
191− ppConstraints = bcPackageConstraints bc name
192− ppUsers = mempty -- must be filled in later
193−
194− ccPackageName = name
195− ccOS = siOS
196− ccArch = siArch
197− ccCompilerFlavor = Distribution.Compiler.GHC
198− ccCompilerVersion = siGhcVersion
199− ccFlags = flags
200− ccIncludeTests = pcTests ppConstraints /= Don'tBuild
201− ccIncludeBenchmarks = pcBuildBenchmarks ppConstraints
202−
203− SystemInfo {..} = bcSystemInfo bc
204−
205− overrides = pcFlagOverrides ppConstraints
206− getFlag MkFlag {..} =
207− (flagName, fromMaybe flagDefault $ lookup flagName overrides)
208− flags = mapFromList $ map getFlag $ genPackageFlags gpd
209−
210−getLatestAllowedPlans :: MonadIO m => BuildConstraints -> m (Map PackageName PackagePlan)
211−getLatestAllowedPlans bc =
212− getLatestDescriptions
213− (isAllowed bc)
214− (mkPackagePlan bc)
Stackage/CheckBuildPlan.hsdeleted−162
@@ -1,162 +0,0 @@
1−{-# LANGUAGE TupleSections #-}
2−{-# LANGUAGE DeriveDataTypeable #-}
3−{-# LANGUAGE GeneralizedNewtypeDeriving #-}
4−{-# LANGUAGE NoImplicitPrelude #-}
5−{-# LANGUAGE OverloadedStrings #-}
6−{-# LANGUAGE RecordWildCards #-}
7−{-# LANGUAGE ViewPatterns #-}
8−-- | Confirm that a build plan has a consistent set of dependencies.
9−module Stackage.CheckBuildPlan
10− ( checkBuildPlan
11− , BadBuildPlan
12− ) where
13−
14−import Control.Monad.Writer.Strict (Writer, execWriter, tell)
15−import qualified Data.Map.Strict as M
16−import qualified Data.Text as T
17−import Stackage.BuildConstraints
18−import Stackage.BuildPlan
19−import Stackage.PackageDescription
20−import Stackage.Prelude
21−
22−-- | Check the build plan for missing deps, wrong versions, etc.
23−checkBuildPlan :: (MonadThrow m) => BuildPlan -> m ()
24−checkBuildPlan BuildPlan {..}
25− | null errs' = return ()
26− | otherwise = throwM errs
27− where
28− allPackages = map (,mempty) (siCorePackages bpSystemInfo) ++
29− map (ppVersion &&& M.keys . M.filter libAndExe . sdPackages . ppDesc) bpPackages
30− errs@(BadBuildPlan errs') =
31− execWriter $ mapM_ (checkDeps allPackages) $ mapToList bpPackages
32− -- Only looking at libraries and executables, benchmarks and tests
33− -- are allowed to create cycles (e.g. test-framework depends on
34− -- text, which uses test-framework in its test-suite).
35− libAndExe (DepInfo cs _) = any (flip elem [CompLibrary,CompExecutable]) cs
36−
37−-- | For a given package name and plan, check that its dependencies are:
38−--
39−-- 1. Existent (existing in the provided package map)
40−-- 2. Within version range
41−-- 3. Check for dependency cycles.
42−checkDeps :: Map PackageName (Version,[PackageName])
43− -> (PackageName, PackagePlan)
44− -> Writer BadBuildPlan ()
45−checkDeps allPackages (user, pb) =
46− mapM_ go $ mapToList $ sdPackages $ ppDesc pb
47− where
48− go (dep, diRange -> range) =
49− case lookup dep allPackages of
50− Nothing -> tell $ BadBuildPlan $ singletonMap (dep, Nothing) errMap
51− Just (version,deps)
52− | version `withinRange` range ->
53− occursCheck allPackages
54− (\d v ->
55− tell $ BadBuildPlan $ singletonMap
56− (d,v)
57− errMap)
58− dep
59− deps
60− []
61− | otherwise -> tell $ BadBuildPlan $ singletonMap
62− (dep, Just version)
63− errMap
64− where
65− errMap = singletonMap pu range
66− pu = PkgUser
67− { puName = user
68− , puVersion = ppVersion pb
69− , puMaintainer = pcMaintainer $ ppConstraints pb
70− , puGithubPings = ppGithubPings pb
71− }
72−
73−-- | Check whether the package(s) occurs within its own dependency
74−-- tree.
75−occursCheck
76− :: Monad m
77− => Map PackageName (Version,[PackageName])
78− -- ^ All packages.
79− -> (PackageName -> Maybe Version -> m ())
80− -- ^ Report an erroneous package.
81− -> PackageName
82− -- ^ Starting package to check for cycles in.
83− -> [PackageName]
84− -- ^ Dependencies of the package.
85− -> [PackageName]
86− -- ^ Previously seen packages up the dependency tree.
87− -> m ()
88−occursCheck allPackages reportError =
89− go
90− where
91− go pkg deps seen =
92− case find (flip elem seen) deps of
93− Just cyclic ->
94− reportError cyclic $
95− fmap fst (lookup cyclic allPackages)
96− Nothing ->
97− forM_ deps $
98− \pkg' ->
99− case lookup pkg' allPackages of
100− Just (_v,deps')
101− | pkg' /= pkg -> go pkg' deps' seen'
102− _ -> return ()
103− where seen' = pkg : seen
104−
105−data PkgUser = PkgUser
106− { puName :: PackageName
107− , puVersion :: Version
108− , puMaintainer :: Maybe Maintainer
109− , puGithubPings :: Set Text
110− }
111− deriving (Eq, Ord)
112−
113−pkgUserShow1 :: PkgUser -> Text
114−pkgUserShow1 PkgUser {..} = concat
115− [ display puName
116− , "-"
117− , display puVersion
118− ]
119−
120−pkgUserShow2 :: PkgUser -> Text
121−pkgUserShow2 PkgUser {..} = unwords
122− $ (maybe "No maintainer" unMaintainer puMaintainer ++ ".")
123− : map (cons '@') (setToList puGithubPings)
124−
125−newtype BadBuildPlan =
126− BadBuildPlan (Map (PackageName, Maybe Version) (Map PkgUser VersionRange))
127− deriving Typeable
128−instance Exception BadBuildPlan
129−instance Show BadBuildPlan where
130− show (BadBuildPlan errs) =
131− unpack $ concatMap go $ mapToList errs
132− where
133− go ((dep, mdepVer), users) = unlines
134− $ ""
135− : showDepVer dep mdepVer
136− : map showUser (mapToList users)
137−
138− showDepVer :: PackageName -> Maybe Version -> Text
139− showDepVer dep Nothing = display dep ++ " (not present) depended on by:"
140− showDepVer dep (Just version) = concat
141− [ display dep
142− , "-"
143− , display version
144− , " depended on by:"
145− ]
146−
147− showUser :: (PkgUser, VersionRange) -> Text
148− showUser (pu, range) = concat
149− [ "- "
150− , pkgUserShow1 pu
151− , " ("
152− -- add a space after < to avoid confusing Markdown processors (like
153− -- Github's issue tracker)
154− , T.replace "<" "< " $ display range
155− , "). "
156− , pkgUserShow2 pu
157− ]
158−
159−instance Monoid BadBuildPlan where
160− mempty = BadBuildPlan mempty
161− mappend (BadBuildPlan x) (BadBuildPlan y) =
162− BadBuildPlan $ unionWith (unionWith intersectVersionRanges) x y
Stackage/CompleteBuild.hsdeleted−293
@@ -1,293 +0,0 @@
1−{-# LANGUAGE NoImplicitPrelude #-}
2−{-# LANGUAGE OverloadedStrings #-}
3−{-# LANGUAGE RecordWildCards #-}
4−module Stackage.CompleteBuild
5− ( BuildType (..)
6− , BumpType (..)
7− , BuildFlags (..)
8− , completeBuild
9− , justCheck
10− , justUploadNightly
11− ) where
12−
13−import Control.Concurrent (threadDelay)
14−import Control.Concurrent.Async (withAsync)
15−import Data.Default.Class (def)
16−import Data.Semigroup (Max (..), Option (..))
17−import Data.Text.Read (decimal)
18−import Data.Time
19−import Data.Yaml (decodeFileEither, encodeFile)
20−import Network.HTTP.Client
21−import Network.HTTP.Client.TLS (tlsManagerSettings)
22−import Stackage.BuildConstraints
23−import Stackage.BuildPlan
24−import Stackage.CheckBuildPlan
25−import Stackage.PerformBuild
26−import Stackage.Prelude
27−import Stackage.ServerBundle
28−import Stackage.UpdateBuildPlan
29−import Stackage.Upload
30−import System.Environment (lookupEnv)
31−import System.IO (BufferMode (LineBuffering), hSetBuffering)
32−
33−-- | Flags passed in from the command line.
34−data BuildFlags = BuildFlags
35− { bfEnableTests :: !Bool
36− , bfDoUpload :: !Bool
37− , bfEnableLibProfile :: !Bool
38− , bfVerbose :: !Bool
39− , bfSkipCheck :: !Bool
40− } deriving (Show)
41−
42−data BuildType = Nightly | LTS BumpType
43− deriving (Show, Read, Eq, Ord)
44−
45−data BumpType = Major | Minor
46− deriving (Show, Read, Eq, Ord)
47−
48−data Settings = Settings
49− { plan :: BuildPlan
50− , planFile :: FilePath
51− , buildDir :: FilePath
52− , logDir :: FilePath
53− , title :: Text -> Text -- ^ GHC version -> title
54− , slug :: Text
55− , setArgs :: Text -> UploadBundle -> UploadBundle
56− , postBuild :: IO ()
57− , distroName :: Text -- ^ distro name on Hackage
58− }
59−
60−nightlyPlanFile :: Text -- ^ day
61− -> FilePath
62−nightlyPlanFile day = fpFromText ("nightly-" ++ day) <.> "yaml"
63−
64−nightlySettings :: Text -- ^ day
65− -> BuildPlan
66− -> Settings
67−nightlySettings day plan' = Settings
68− { planFile = nightlyPlanFile day
69− , buildDir = fpFromText $ "builds/stackage-nightly-" ++ day
70− , logDir = fpFromText $ "logs/stackage-nightly-" ++ day
71− , title = \ghcVer -> concat
72− [ "Stackage Nightly "
73− , day
74− , ", GHC "
75− , ghcVer
76− ]
77− , slug = slug'
78− , setArgs = \ghcVer ub -> ub { ubNightly = Just ghcVer }
79− , plan = plan'
80− , postBuild = return ()
81− , distroName = "Stackage"
82− }
83− where
84− slug' = "nightly-" ++ day
85−
86−getSettings :: Manager -> BuildType -> IO Settings
87−getSettings man Nightly = do
88− day <- tshow . utctDay <$> getCurrentTime
89− bc <- defaultBuildConstraints man
90− pkgs <- getLatestAllowedPlans bc
91− plan' <- newBuildPlan pkgs bc
92− return $ nightlySettings day plan'
93−getSettings man (LTS bumpType) = do
94− Option mlts <- fmap (fmap getMax) $ runResourceT
95− $ sourceDirectory "."
96− $$ foldMapC (Option . fmap Max . parseLTSVer . filename)
97−
98− (new, plan') <- case bumpType of
99− Major -> do
100− let new =
101− case mlts of
102− Nothing -> LTSVer 0 0
103− Just (LTSVer x _) -> LTSVer (x + 1) 0
104− bc <- defaultBuildConstraints man
105− pkgs <- getLatestAllowedPlans bc
106− plan' <- newBuildPlan pkgs bc
107− return (new, plan')
108− Minor -> do
109− old <- maybe (error "No LTS plans found in current directory") return mlts
110− oldplan <- decodeFileEither (fpToString $ renderLTSVer old)
111− >>= either throwM return
112− let new = incrLTSVer old
113− let bc = updateBuildConstraints oldplan
114− pkgs <- getLatestAllowedPlans bc
115− plan' <- newBuildPlan pkgs bc
116− return (new, plan')
117−
118− let newfile = renderLTSVer new
119−
120− return Settings
121− { planFile = newfile
122− , buildDir = fpFromText $ "builds/stackage-lts-" ++ tshow new
123− , logDir = fpFromText $ "logs/stackage-lts-" ++ tshow new
124− , title = \ghcVer -> concat
125− [ "LTS Haskell "
126− , tshow new
127− , ", GHC "
128− , ghcVer
129− ]
130− , slug = "lts-" ++ tshow new
131− , setArgs = \_ ub -> ub { ubLTS = Just $ tshow new }
132− , plan = plan'
133− , postBuild = do
134− let git args = withCheckedProcess
135− (proc "git" args) $ \ClosedStream Inherited Inherited ->
136− return ()
137− putStrLn "Committing new LTS file to Git"
138− git ["add", fpToString newfile]
139− git ["commit", "-m", "Added new LTS release: " ++ show new]
140− putStrLn "Pushing to Git repository"
141− git ["push"]
142− , distroName = "LTSHaskell"
143− }
144−
145−data LTSVer = LTSVer !Int !Int
146− deriving (Eq, Ord)
147−instance Show LTSVer where
148− show (LTSVer x y) = concat [show x, ".", show y]
149−incrLTSVer :: LTSVer -> LTSVer
150−incrLTSVer (LTSVer x y) = LTSVer x (y + 1)
151−
152−parseLTSVer :: FilePath -> Maybe LTSVer
153−parseLTSVer fp = do
154− w <- stripPrefix "lts-" $ fpToText fp
155− x <- stripSuffix ".yaml" w
156− Right (major, y) <- Just $ decimal x
157− z <- stripPrefix "." y
158− Right (minor, "") <- Just $ decimal z
159− return $ LTSVer major minor
160−renderLTSVer :: LTSVer -> FilePath
161−renderLTSVer lts = fpFromText $ concat
162− [ "lts-"
163− , tshow lts
164− , ".yaml"
165− ]
166−
167−-- | Just print a message saying "still alive" every minute, to appease Travis.
168−stillAlive :: IO () -> IO ()
169−stillAlive inner =
170− withAsync (printer 1) $ const inner
171− where
172− printer i = forever $ do
173− threadDelay 60000000
174− putStrLn $ "Still alive: " ++ tshow i
175− printer $! i + 1
176−
177−-- | Generate and check a new build plan, but do not execute it.
178−--
179−-- Since 0.3.1
180−justCheck :: IO ()
181−justCheck = stillAlive $ withManager tlsManagerSettings $ \man -> do
182− putStrLn "Loading build constraints"
183− bc <- defaultBuildConstraints man
184−
185− putStrLn "Creating build plan"
186− plans <- getLatestAllowedPlans bc
187− plan <- newBuildPlan plans bc
188−
189− putStrLn $ "Writing build plan to check-plan.yaml"
190− encodeFile "check-plan.yaml" plan
191−
192− putStrLn "Checking plan"
193− checkBuildPlan plan
194−
195− putStrLn "Plan seems valid!"
196−
197−getPerformBuild :: BuildFlags -> Settings -> PerformBuild
198−getPerformBuild buildFlags Settings {..} = PerformBuild
199− { pbPlan = plan
200− , pbInstallDest = buildDir
201− , pbLogDir = logDir
202− , pbLog = hPut stdout
203− , pbJobs = 8
204− , pbGlobalInstall = False
205− , pbEnableTests = bfEnableTests buildFlags
206− , pbEnableLibProfiling = bfEnableLibProfile buildFlags
207− , pbVerbose = bfVerbose buildFlags
208− , pbAllowNewer = bfSkipCheck buildFlags
209− }
210−
211−-- | Make a complete plan, build, test and upload bundle, docs and
212−-- distro.
213−completeBuild :: BuildType -> BuildFlags -> IO ()
214−completeBuild buildType buildFlags = withManager tlsManagerSettings $ \man -> do
215− hSetBuffering stdout LineBuffering
216−
217− putStrLn $ "Loading settings for: " ++ tshow buildType
218− settings@Settings {..} <- getSettings man buildType
219−
220− putStrLn $ "Writing build plan to: " ++ fpToText planFile
221− encodeFile (fpToString planFile) plan
222−
223− if bfSkipCheck buildFlags
224− then putStrLn "Skipping build plan check"
225− else do
226− putStrLn "Checking build plan"
227− checkBuildPlan plan
228−
229− putStrLn "Performing build"
230− performBuild (getPerformBuild buildFlags settings) >>= mapM_ putStrLn
231−
232− when (bfDoUpload buildFlags) $
233− finallyUpload settings man
234−
235−justUploadNightly
236− :: Text -- ^ nightly date
237− -> IO ()
238−justUploadNightly day = do
239− plan <- decodeFileEither (fpToString $ nightlyPlanFile day)
240− >>= either throwM return
241− withManager tlsManagerSettings $ finallyUpload $ nightlySettings day plan
242−
243−-- | The final part of the complete build process: uploading a bundle,
244−-- docs and a distro to hackage.
245−finallyUpload :: Settings -> Manager -> IO ()
246−finallyUpload settings@Settings{..} man = do
247− putStrLn "Uploading bundle to Stackage Server"
248−
249− mtoken <- lookupEnv "STACKAGE_AUTH_TOKEN"
250− token <-
251− case mtoken of
252− Nothing -> decodeUtf8 <$> readFile "/auth-token"
253− Just token -> return $ pack token
254−
255− now <- epochTime
256− let ghcVer = display $ siGhcVersion $ bpSystemInfo plan
257− (ident, mloc) <- flip uploadBundle man $ setArgs ghcVer def
258− { ubContents = serverBundle now (title ghcVer) slug plan
259− , ubAuthToken = token
260− }
261− putStrLn $ "New ident: " ++ unSnapshotIdent ident
262− forM_ mloc $ \loc ->
263− putStrLn $ "Track progress at: " ++ loc
264−
265− postBuild `catchAny` print
266−
267− putStrLn "Uploading docs to Stackage Server"
268− res1 <- uploadDocs UploadDocs
269− { udServer = def
270− , udAuthToken = token
271− , udDocs = pbDocDir pb
272− , udSnapshot = ident
273− } man
274− putStrLn $ "Doc upload response: " ++ tshow res1
275−
276− ecreds <- tryIO $ readFile "/hackage-creds"
277− case map encodeUtf8 $ words $ decodeUtf8 $ either (const "") id ecreds of
278− [username, password] -> do
279− putStrLn "Uploading as Hackage distro"
280− res2 <- uploadHackageDistroNamed distroName plan username password man
281− putStrLn $ "Distro upload response: " ++ tshow res2
282− _ -> putStrLn "No creds found, skipping Hackage distro upload"
283−
284− putStrLn "Uploading doc map"
285− uploadDocMap UploadDocMap
286− { udmServer = def
287− , udmAuthToken = token
288− , udmSnapshot = ident
289− , udmDocDir = pbDocDir pb
290− , udmPlan = plan
291− } man >>= print
292− where
293− pb = getPerformBuild (error "finallyUpload.buildFlags") settings
Stackage/CorePackages.hsdeleted−53
@@ -1,53 +0,0 @@
1−{-# LANGUAGE NoImplicitPrelude #-}
2−{-# LANGUAGE OverloadedStrings #-}
3−module Stackage.CorePackages
4− ( getCorePackages
5− , getCoreExecutables
6− , getGhcVersion
7− ) where
8−
9−import qualified Data.Text as T
10−import Filesystem (listDirectory)
11−import Stackage.Prelude
12−import System.Directory (findExecutable)
13−
14−-- | Get a @Map@ of all of the core packages. Core packages are defined as
15−-- packages which ship with GHC itself.
16−--
17−-- Precondition: GHC global package database has only core packages, and GHC
18−-- ships with just a single version of each packages.
19−getCorePackages :: IO (Map PackageName Version)
20−getCorePackages =
21− withCheckedProcess cp $ \ClosedStream src Inherited ->
22− src $$ decodeUtf8C =$ linesUnboundedC =$ foldMapMC parsePackage
23− where
24− cp = proc "ghc-pkg" ["--no-user-package-conf", "list"]
25− parsePackage t
26− | ":" `isInfixOf` t = return mempty
27− | Just p <- stripSuffix "-" p' = singletonMap
28− <$> simpleParse p
29− <*> simpleParse v
30− | otherwise = return mempty
31− where
32− (p', v) = T.breakOnEnd "-" $ dropParens $ T.strip t
33−
34− dropParens s
35− | length s > 2 && headEx s == '(' && lastEx s == ')' =
36− initEx $ tailEx s
37− | otherwise = s
38−
39−-- | A list of executables that are shipped with GHC.
40−getCoreExecutables :: IO (Set ExeName)
41−getCoreExecutables = do
42− mfp <- findExecutable "ghc"
43− dir <-
44− case mfp of
45− Nothing -> error "No ghc executable found on PATH"
46− Just fp -> return $ directory $ fpFromString fp
47− (setFromList . map (ExeName . fpToText . filename)) <$> listDirectory dir
48−
49−getGhcVersion :: IO Version
50−getGhcVersion = do
51− withCheckedProcess (proc "ghc" ["--numeric-version"]) $
52− \ClosedStream src Inherited ->
53− (src $$ decodeUtf8C =$ foldC) >>= simpleParse
Stackage/GithubPings.hsdeleted−36
@@ -1,36 +0,0 @@
1−{-# LANGUAGE NoImplicitPrelude #-}
2−{-# LANGUAGE OverloadedStrings #-}
3−{-# LANGUAGE ViewPatterns #-}
4−module Stackage.GithubPings
5− ( getGithubPings
6− ) where
7−
8−import Distribution.PackageDescription
9−import Stackage.BuildConstraints
10−import Stackage.Prelude
11−
12−-- | Determine accounts to be pinged on Github based on various metadata in the
13−-- package description.
14−getGithubPings :: BuildConstraints -- ^ for mapping to pingees
15− -> GenericPackageDescription -> Set Text
16−getGithubPings bc gpd =
17− foldMap (\(pack -> name) -> fromMaybe (singletonSet name) (lookup name (bcGithubUsers bc))) $
18− goHomepage (homepage $ packageDescription gpd) ++
19− concatMap goRepo (sourceRepos $ packageDescription gpd)
20− where
21− goHomepage t = do
22− prefix <-
23− [ "http://github.com/"
24− , "https://github.com/"
25− , "git://github.com/"
26− , "git@github.com:"
27− ]
28− t' <- maybeToList $ stripPrefix prefix t
29− let t'' = takeWhile (/= '/') t'
30− guard $ not $ null t''
31− return t''
32−
33− goRepo sr =
34− case (repoType sr, repoLocation sr) of
35− (Just Git, Just s) -> goHomepage s
36− _ -> []
Stackage/PackageDescription.hsdeleted−200
@@ -1,200 +0,0 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2−{-# LANGUAGE DeriveFoldable #-}
3−{-# LANGUAGE DeriveFunctor #-}
4−{-# LANGUAGE DeriveTraversable #-}
5−{-# LANGUAGE FlexibleContexts #-}
6−{-# LANGUAGE NoImplicitPrelude #-}
7−{-# LANGUAGE OverloadedStrings #-}
8−{-# LANGUAGE RecordWildCards #-}
9−{-# LANGUAGE TypeFamilies #-}
10−-- | Manipulate @GenericPackageDescription@ from Cabal into something more
11−-- useful for us.
12−module Stackage.PackageDescription
13− ( SimpleDesc (..)
14− , toSimpleDesc
15− , CheckCond (..)
16− , Component (..)
17− , DepInfo (..)
18− ) where
19−
20−import Control.Monad.Writer.Strict (MonadWriter, execWriterT,
21− tell)
22−import Data.Aeson
23−import qualified Data.Map as Map
24−import Distribution.Compiler (CompilerFlavor)
25−import Distribution.Package (Dependency (..))
26−import Distribution.PackageDescription
27−import Distribution.System (Arch, OS)
28−import Stackage.Prelude
29−
30−data Component = CompLibrary
31− | CompExecutable
32− | CompTestSuite
33− | CompBenchmark
34− deriving (Show, Read, Eq, Ord, Enum, Bounded)
35−
36−compToText :: Component -> Text
37−compToText CompLibrary = "library"
38−compToText CompExecutable = "executable"
39−compToText CompTestSuite = "test-suite"
40−compToText CompBenchmark = "benchmark"
41−
42−instance ToJSON Component where
43− toJSON = toJSON . compToText
44−instance FromJSON Component where
45− parseJSON = withText "Component" $ \t -> maybe
46− (fail $ "Invalid component: " ++ unpack t)
47− return
48− (lookup t comps)
49− where
50− comps = asHashMap $ mapFromList $ map (compToText &&& id) [minBound..maxBound]
51−
52−data DepInfo = DepInfo
53− { diComponents :: Set Component
54− , diRange :: VersionRange
55− }
56− deriving (Show, Eq)
57−
58−instance Semigroup DepInfo where
59− DepInfo a x <> DepInfo b y = DepInfo
60− (a <> b)
61− (intersectVersionRanges x y)
62−instance ToJSON DepInfo where
63− toJSON DepInfo {..} = object
64− [ "components" .= diComponents
65− , "range" .= display diRange
66− ]
67−instance FromJSON DepInfo where
68− parseJSON = withObject "DepInfo" $ \o -> do
69− diComponents <- o .: "components"
70− diRange <- o .: "range" >>= either (fail . show) return . simpleParse
71− return DepInfo {..}
72−
73−-- | A simplified package description that tracks:
74−--
75−-- * Package dependencies
76−--
77−-- * Build tool dependencies
78−--
79−-- * Provided executables
80−--
81−-- It has fully resolved all conditionals
82−data SimpleDesc = SimpleDesc
83− { sdPackages :: Map PackageName DepInfo
84− , sdTools :: Map ExeName DepInfo
85− , sdProvidedExes :: Set ExeName
86− , sdModules :: Set Text
87− -- ^ modules exported by the library
88− }
89− deriving (Show, Eq)
90−instance Monoid SimpleDesc where
91− mempty = SimpleDesc mempty mempty mempty mempty
92− mappend (SimpleDesc a b c d) (SimpleDesc w x y z) = SimpleDesc
93− (unionWith (<>) a w)
94− (unionWith (<>) b x)
95− (c ++ y)
96− (d ++ z)
97−instance ToJSON SimpleDesc where
98− toJSON SimpleDesc {..} = object
99− [ "packages" .= Map.mapKeysWith const unPackageName sdPackages
100− , "tools" .= Map.mapKeysWith const unExeName sdTools
101− , "provided-exes" .= sdProvidedExes
102− , "modules" .= sdModules
103− ]
104−instance FromJSON SimpleDesc where
105− parseJSON = withObject "SimpleDesc" $ \o -> do
106− sdPackages <- Map.mapKeysWith const mkPackageName <$> (o .: "packages")
107− sdTools <- Map.mapKeysWith const ExeName <$> (o .: "tools")
108− sdProvidedExes <- o .: "provided-exes"
109− sdModules <- o .: "modules"
110− return SimpleDesc {..}
111−
112−-- | Convert a 'GenericPackageDescription' into a 'SimpleDesc' by following the
113−-- constraints in the provided 'CheckCond'.
114−toSimpleDesc :: MonadThrow m
115− => CheckCond
116− -> GenericPackageDescription
117− -> m SimpleDesc
118−toSimpleDesc cc gpd = execWriterT $ do
119− forM_ (condLibrary gpd) $ tellTree cc CompLibrary libBuildInfo getModules
120− forM_ (condExecutables gpd) $ tellTree cc CompExecutable buildInfo noModules . snd
121− tell mempty { sdProvidedExes = setFromList
122− $ map (fromString . fst)
123− $ condExecutables gpd
124− }
125− when (ccIncludeTests cc) $ forM_ (condTestSuites gpd)
126− $ tellTree cc CompTestSuite testBuildInfo noModules . snd
127− when (ccIncludeBenchmarks cc) $ forM_ (condBenchmarks gpd)
128− $ tellTree cc CompBenchmark benchmarkBuildInfo noModules . snd
129− where
130− noModules = const mempty
131− getModules = setFromList . map display . exposedModules
132−
133−-- | Convert a single CondTree to a 'SimpleDesc'.
134−tellTree :: (MonadWriter SimpleDesc m, MonadThrow m)
135− => CheckCond
136− -> Component
137− -> (a -> BuildInfo)
138− -> (a -> Set Text) -- ^ get module names
139− -> CondTree ConfVar [Dependency] a
140− -> m ()
141−tellTree cc component getBI getModules =
142− loop
143− where
144− loop (CondNode dat deps comps) = do
145− tell mempty
146− { sdPackages = unionsWith (<>) $ flip map deps
147− $ \(Dependency x y) -> singletonMap x DepInfo
148− { diComponents = singletonSet component
149− , diRange = simplifyVersionRange y
150− }
151− , sdTools = unionsWith (<>) $ flip map (buildTools $ getBI dat)
152− $ \(Dependency name range) -> singletonMap
153− -- In practice, cabal files refer to the exe name, not the
154− -- package name.
155− (ExeName $ unPackageName name)
156− DepInfo
157− { diComponents = singletonSet component
158− , diRange = simplifyVersionRange range
159− }
160− , sdModules = getModules dat
161− }
162− forM_ comps $ \(cond, ontrue, onfalse) -> do
163− b <- checkCond cc cond
164− if b
165− then loop ontrue
166− else maybe (return ()) loop onfalse
167−
168−-- | Resolve a condition to a boolean based on the provided 'CheckCond'.
169−checkCond :: MonadThrow m => CheckCond -> Condition ConfVar -> m Bool
170−checkCond CheckCond {..} cond0 =
171− go cond0
172− where
173− go (Var (OS os)) = return $ os == ccOS
174− go (Var (Arch arch)) = return $ arch == ccArch
175− go (Var (Flag flag)) =
176− case lookup flag ccFlags of
177− Nothing -> throwM $ FlagNotDefined ccPackageName flag cond0
178− Just b -> return b
179− go (Var (Impl flavor range)) = return
180− $ flavor == ccCompilerFlavor
181− && ccCompilerVersion `withinRange` range
182− go (Lit b) = return b
183− go (CNot c) = not `liftM` go c
184− go (CAnd x y) = (&&) `liftM` go x `ap` go y
185− go (COr x y) = (||) `liftM` go x `ap` go y
186−
187−data CheckCondException = FlagNotDefined PackageName FlagName (Condition ConfVar)
188− deriving (Show, Typeable)
189−instance Exception CheckCondException
190−
191−data CheckCond = CheckCond
192− { ccPackageName :: PackageName -- for debugging only
193− , ccOS :: OS
194− , ccArch :: Arch
195− , ccFlags :: Map FlagName Bool
196− , ccCompilerFlavor :: CompilerFlavor
197− , ccCompilerVersion :: Version
198− , ccIncludeTests :: Bool
199− , ccIncludeBenchmarks :: Bool
200− }
Stackage/PackageIndex.hsdeleted−127
@@ -1,127 +0,0 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2−{-# LANGUAGE FlexibleContexts #-}
3−{-# LANGUAGE NoImplicitPrelude #-}
4−{-# LANGUAGE OverloadedStrings #-}
5−{-# LANGUAGE RankNTypes #-}
6−{-# LANGUAGE ViewPatterns #-}
7−-- | Dealing with the 00-index file and all its cabal files.
8−module Stackage.PackageIndex
9− ( sourcePackageIndex
10− , UnparsedCabalFile (..)
11− , getLatestDescriptions
12− ) where
13−
14−import qualified Codec.Archive.Tar as Tar
15−import Data.Conduit.Lazy (MonadActive,
16− lazyConsume)
17−import qualified Data.Text as T
18−import Distribution.PackageDescription (package,
19− packageDescription)
20−import Distribution.PackageDescription.Parse (ParseResult (..),
21− parsePackageDescription)
22−import Distribution.ParseUtils (PError)
23−import Stackage.Prelude
24−import System.Directory (getAppUserDataDirectory)
25−
26−-- | Name of the 00-index.tar downloaded from Hackage.
27−getPackageIndexPath :: MonadIO m => m FilePath
28−getPackageIndexPath = liftIO $ do
29− c <- getCabalRoot
30− configLines <- runResourceT $ sourceFile (c </> "config")
31− $$ decodeUtf8C
32− =$ linesUnboundedC
33− =$ concatMapC getRemoteCache
34− =$ sinkList
35− case configLines of
36− [x] -> return $ x </> "hackage.haskell.org" </> "00-index.tar"
37− [] -> error $ "No remote-repo-cache found in Cabal config file"
38− _ -> error $ "Multiple remote-repo-cache entries found in Cabal config file"
39− where
40− getCabalRoot :: IO FilePath
41− getCabalRoot = fpFromString <$> getAppUserDataDirectory "cabal"
42−
43− getRemoteCache s = do
44− ("remote-repo-cache", stripPrefix ":" -> Just v) <- Just $ break (== ':') s
45− Just $ fpFromText $ T.strip v
46−
47−-- | A cabal file with name and version parsed from the filepath, and the
48−-- package description itself ready to be parsed. It's left in unparsed form
49−-- for efficiency.
50−data UnparsedCabalFile = UnparsedCabalFile
51− { ucfName :: PackageName
52− , ucfVersion :: Version
53− , ucfParse :: forall m. MonadThrow m => m GenericPackageDescription
54− }
55−
56−-- | Stream all of the cabal files from the 00-index tar file.
57−sourcePackageIndex :: (MonadThrow m, MonadResource m, MonadActive m, MonadBaseControl IO m)
58− => Producer m UnparsedCabalFile
59−sourcePackageIndex = do
60− fp <- getPackageIndexPath
61− -- yay for the tar package. Use lazyConsume instead of readFile to get some
62− -- kind of resource protection
63− lbs <- lift $ fromChunks <$> lazyConsume (sourceFile fp)
64− loop (Tar.read lbs)
65− where
66− loop (Tar.Next e es) = goE e >> loop es
67− loop Tar.Done = return ()
68− loop (Tar.Fail e) = throwM e
69−
70− goE e
71− | Just front <- stripSuffix ".cabal" $ pack $ Tar.entryPath e
72− , Tar.NormalFile lbs _size <- Tar.entryContent e = do
73− (name, version) <- parseNameVersion front
74− yield UnparsedCabalFile
75− { ucfName = name
76− , ucfVersion = version
77− , ucfParse = goContent (Tar.entryPath e) name version lbs
78− }
79− | otherwise = return ()
80−
81− goContent fp name version lbs =
82− case parsePackageDescription $ unpack $ decodeUtf8 lbs of
83− ParseFailed e -> throwM $ CabalParseException (fpFromString fp) e
84− ParseOk _warnings gpd -> do
85− let pd = packageDescription gpd
86− PackageIdentifier name' version' = package pd
87− when (name /= name' || version /= version') $
88− throwM $ MismatchedNameVersion (fpFromString fp)
89− name name' version version'
90− return gpd
91−
92− parseNameVersion t1 = do
93− let (p', t2) = break (== '/') $ T.replace "\\" "/" t1
94− p <- simpleParse p'
95− t3 <- maybe (throwM $ InvalidCabalPath t1 "no slash") return
96− $ stripPrefix "/" t2
97− let (v', t4) = break (== '/') t3
98− v <- simpleParse v'
99− when (t4 /= cons '/' p') $ throwM $ InvalidCabalPath t1 $ "Expected at end: " ++ p'
100− return (p, v)
101−
102−data InvalidCabalPath = InvalidCabalPath Text Text
103− deriving (Show, Typeable)
104−instance Exception InvalidCabalPath
105−
106−data CabalParseException = CabalParseException FilePath PError
107− | MismatchedNameVersion FilePath PackageName PackageName Version Version
108− deriving (Show, Typeable)
109−instance Exception CabalParseException
110−
111−-- | Get all of the latest descriptions for name/version pairs matching the
112−-- given criterion.
113−getLatestDescriptions :: MonadIO m
114− => (PackageName -> Version -> Bool)
115− -> (GenericPackageDescription -> IO desc)
116− -> m (Map PackageName desc)
117−getLatestDescriptions f parseDesc = liftIO $ do
118− m <- runResourceT $ sourcePackageIndex $$ filterC f' =$ foldlC add mempty
119− forM m $ \ucf -> liftIO $ ucfParse ucf >>= parseDesc
120− where
121− f' ucf = f (ucfName ucf) (ucfVersion ucf)
122− add m ucf =
123− case lookup name m of
124− Just ucf' | ucfVersion ucf < ucfVersion ucf' -> m
125− _ -> insertMap name ucf m
126− where
127− name = ucfName ucf
Stackage/PerformBuild.hsdeleted−450
@@ -1,450 +0,0 @@
1−-- | Perform an actual build, generate a binary package database and a
2−-- documentation directory in the process.
3−{-# LANGUAGE CPP #-}
4−{-# LANGUAGE DeriveDataTypeable #-}
5−{-# LANGUAGE NoImplicitPrelude #-}
6−{-# LANGUAGE OverloadedStrings #-}
7−{-# LANGUAGE RecordWildCards #-}
8−module Stackage.PerformBuild
9− ( performBuild
10− , PerformBuild (..)
11− , BuildException (..)
12− , pbDocDir
13− ) where
14−
15−import Control.Concurrent.Async (async)
16−import Control.Concurrent.STM.TSem
17−import Control.Monad.Writer.Strict (execWriter, tell)
18−import qualified Data.Map as Map
19−import Data.NonNull (fromNullable)
20−import Filesystem (canonicalizePath, createTree,
21− getWorkingDirectory, isDirectory,
22− removeTree, rename)
23−import Filesystem.Path (parent)
24−import qualified Filesystem.Path as F
25−import Stackage.BuildConstraints
26−import Stackage.BuildPlan
27−import Stackage.PackageDescription
28−import Stackage.Prelude hiding (pi)
29−import System.Directory (findExecutable)
30−import System.Environment (getEnvironment)
31−import System.IO (IOMode (WriteMode),
32− withBinaryFile)
33−import System.IO.Temp (withSystemTempDirectory)
34−
35−data BuildException = BuildException (Map PackageName BuildFailure) [Text]
36− deriving Typeable
37−instance Exception BuildException
38−instance Show BuildException where
39− show (BuildException m warnings) =
40− unlines $ map go (mapToList m) ++ map unpack warnings
41− where
42− go (PackageName name, bf) = concat
43− [ name
44− , ": "
45− , show bf
46− ]
47−
48−data BuildFailure = DependencyFailed PackageName
49− | DependencyMissing PackageName
50− | ToolMissing ExeName
51− | NotImplemented
52− | BuildFailureException SomeException
53− deriving (Show, Typeable)
54−instance Exception BuildFailure
55−
56−data PerformBuild = PerformBuild
57− { pbPlan :: BuildPlan
58− , pbInstallDest :: FilePath
59− , pbLog :: ByteString -> IO ()
60− , pbLogDir :: FilePath
61− , pbJobs :: Int
62− , pbGlobalInstall :: Bool
63− -- ^ Register packages in the global database
64− , pbEnableTests :: Bool
65− , pbEnableLibProfiling :: Bool
66− , pbVerbose :: Bool
67− , pbAllowNewer :: Bool
68− -- ^ Pass --allow-newer to cabal configure
69− }
70−
71−data PackageInfo = PackageInfo
72− { piPlan :: PackagePlan
73− , piName :: PackageName
74− , piResult :: TMVar Bool
75− }
76−
77−waitForDeps :: Map ExeName (Set PackageName)
78− -> Map PackageName PackageInfo
79− -> Set Component
80− -> BuildPlan
81− -> PackageInfo
82− -> IO a
83− -> IO a
84−waitForDeps toolMap packageMap activeComps bp pi action = do
85− atomically $ do
86− mapM_ checkPackage $ Map.keys $ filterUnused $ sdPackages $ ppDesc $ piPlan pi
87− forM_ (Map.keys $ filterUnused $ sdTools $ ppDesc $ piPlan pi) $ \exe -> do
88− case lookup exe toolMap >>= fromNullable . map checkPackage . setToList of
89− Nothing
90− | isCoreExe exe -> return ()
91− | otherwise -> throwSTM $ ToolMissing exe
92− Just packages -> ofoldl1' (<|>) packages
93− action
94− where
95− filterUnused :: Ord key => Map key DepInfo -> Map key DepInfo
96− filterUnused =
97− mapFromList . filter (go . snd) . mapToList
98− where
99− go = not . null . intersection activeComps . diComponents
100−
101− checkPackage package | package == piName pi = return ()
102− checkPackage package =
103− case lookup package packageMap of
104− Nothing
105− | isCore package -> return ()
106− | otherwise -> throwSTM $ DependencyMissing package
107− Just dep -> do
108− res <- readTMVar $ piResult dep
109− unless res $ throwSTM $ DependencyFailed package
110−
111− isCore = (`member` siCorePackages (bpSystemInfo bp))
112− isCoreExe = (`member` siCoreExecutables (bpSystemInfo bp))
113−
114−withCounter :: TVar Int -> IO a -> IO a
115−withCounter counter = bracket_
116− (atomically $ modifyTVar counter (+ 1))
117− (atomically $ modifyTVar counter (subtract 1))
118−
119−withTSem :: TSem -> IO a -> IO a
120−withTSem sem = bracket_ (atomically $ waitTSem sem) (atomically $ signalTSem sem)
121−
122−-- | Returns @Nothing@ if installing to a global database
123−pbDatabase :: PerformBuild -> Maybe FilePath
124−pbDatabase pb
125− | pbGlobalInstall pb = Nothing
126− | otherwise = Just $ pbInstallDest pb </> "pkgdb"
127−
128−pbBinDir, pbLibDir, pbDataDir, pbDocDir :: PerformBuild -> FilePath
129−pbBinDir pb = pbInstallDest pb </> "bin"
130−pbLibDir pb = pbInstallDest pb </> "lib"
131−pbDataDir pb = pbInstallDest pb </> "share"
132−pbDocDir pb = pbInstallDest pb </> "doc"
133−
134−performBuild :: PerformBuild -> IO [Text]
135−performBuild pb = do
136− cwd <- getWorkingDirectory
137− performBuild' pb
138− { pbInstallDest = cwd </> pbInstallDest pb
139− , pbLogDir = cwd </> pbLogDir pb
140− }
141−
142−performBuild' :: PerformBuild -> IO [Text]
143−performBuild' pb@PerformBuild {..} = withBuildDir $ \builddir -> do
144− -- First make sure to fetch all of the dependencies... just in case Hackage
145− -- has an outage. Don't feel like wasting hours of CPU time.
146− pbLog $ encodeUtf8 "Pre-fetching all packages\n"
147− let toDownload = flip map (mapToList $ bpPackages pbPlan)
148− $ \(name, plan) -> unpack $ concat
149− [ display name
150− , "-"
151− , display $ ppVersion plan
152− ]
153− withCheckedProcess
154− (proc "cabal"
155− $ "fetch"
156− : "--no-dependencies"
157− : toDownload)
158− $ \ClosedStream Inherited Inherited -> return ()
159−
160− let removeTree' fp = whenM (isDirectory fp) (removeTree fp)
161− mapM_ removeTree' [pbInstallDest, pbLogDir]
162−
163− forM_ (pbDatabase pb) $ \db -> do
164− createTree $ parent db
165− withCheckedProcess (proc "ghc-pkg" ["init", fpToString db])
166− $ \ClosedStream Inherited Inherited -> return ()
167− pbLog $ encodeUtf8 "Copying built-in Haddocks\n"
168− copyBuiltInHaddocks (pbDocDir pb)
169−
170− sem <- atomically $ newTSem pbJobs
171− active <- newTVarIO (0 :: Int)
172− let toolMap = makeToolMap $ bpPackages pbPlan
173− packageMap <- fmap fold $ forM (mapToList $ bpPackages pbPlan)
174− $ \(name, plan) -> do
175− let piPlan = plan
176− piName = name
177− piResult <- newEmptyTMVarIO
178− return $ singletonMap name PackageInfo {..}
179−
180− errsVar <- newTVarIO mempty
181− warningsVar <- newTVarIO id
182− mutex <- newMVar ()
183− env <- getEnvironment
184− haddockFiles <- newTVarIO mempty
185−
186− forM_ packageMap $ \pi -> void $ async $ singleBuild pb SingleBuild
187− { sbSem = sem
188− , sbErrsVar = errsVar
189− , sbWarningsVar = warningsVar
190− , sbActive = active
191− , sbToolMap = toolMap
192− , sbPackageMap = packageMap
193− , sbBuildDir = builddir
194− , sbPackageInfo = pi
195− , sbRegisterMutex = mutex
196− , sbModifiedEnv = maybe
197− id
198− (\db -> (("HASKELL_PACKAGE_SANDBOX", fpToString db):))
199− (pbDatabase pb)
200− (filter allowedEnv $ map fixEnv env)
201− , sbHaddockFiles = haddockFiles
202− }
203−
204− void $ tryAny $ atomically $ readTVar active >>= checkSTM . (== 0)
205−
206− warnings <- ($ []) <$> readTVarIO warningsVar
207− errs <- readTVarIO errsVar
208− when (not $ null errs) $ throwM $ BuildException errs warnings
209− return warnings
210− where
211− withBuildDir f = withSystemTempDirectory "stackage-build" (f . fpFromString)
212−
213− fixEnv (p, x)
214− -- Thank you Windows having case-insensitive environment variables...
215− | toUpper p == "PATH" = (p, fpToString (pbBinDir pb) ++ pathSep : x)
216− | otherwise = (p, x)
217−
218− allowedEnv (k, _) = k `notMember` bannedEnvs
219−
220− -- | Separate for the PATH environment variable
221− pathSep :: Char
222−#ifdef mingw32_HOST_OS
223− pathSep = ';'
224−#else
225− pathSep = ':'
226−#endif
227−
228−-- | Environment variables we don't allow to be passed on to child processes.
229−bannedEnvs :: Set String
230−bannedEnvs = setFromList
231− [ "STACKAGE_AUTH_TOKEN"
232− ]
233−
234−data SingleBuild = SingleBuild
235− { sbSem :: TSem
236− , sbErrsVar :: TVar (Map PackageName BuildFailure)
237− , sbWarningsVar :: TVar ([Text] -> [Text])
238− , sbActive :: TVar Int
239− , sbToolMap :: Map ExeName (Set PackageName)
240− , sbPackageMap :: Map PackageName PackageInfo
241− , sbBuildDir :: FilePath
242− , sbPackageInfo :: PackageInfo
243− , sbRegisterMutex :: MVar ()
244− , sbModifiedEnv :: [(String, String)]
245− , sbHaddockFiles :: TVar (Map Text FilePath) -- ^ package-version, .haddock file
246− }
247−
248−singleBuild :: PerformBuild -> SingleBuild -> IO ()
249−singleBuild pb@PerformBuild {..} SingleBuild {..} =
250− withCounter sbActive
251− $ handle updateErrs
252− $ (`finally` void (atomically $ tryPutTMVar (piResult sbPackageInfo) False))
253− $ inner
254− where
255− libComps = setFromList [CompLibrary, CompExecutable]
256− testComps = insertSet CompTestSuite libComps
257− inner = do
258− let wfd comps =
259− waitForDeps sbToolMap sbPackageMap comps pbPlan sbPackageInfo
260− . withTSem sbSem
261− wfd libComps buildLibrary
262−
263− wfd testComps runTests
264−
265− name = display $ piName sbPackageInfo
266− namever = concat
267− [ name
268− , "-"
269− , display $ ppVersion $ piPlan sbPackageInfo
270− ]
271−
272− runIn wdir outH cmd args =
273− withCheckedProcess cp $ \ClosedStream UseProvidedHandle UseProvidedHandle ->
274− (return () :: IO ())
275− where
276− cp = (proc (unpack $ asText cmd) (map (unpack . asText) args))
277− { cwd = Just $ fpToString wdir
278− , std_out = UseHandle outH
279− , std_err = UseHandle outH
280− , env = Just sbModifiedEnv
281− }
282− runParent = runIn sbBuildDir
283− runChild = runIn childDir
284− childDir = sbBuildDir </> fpFromText namever
285−
286− log' t = do
287− i <- readTVarIO sbActive
288− errs <- readTVarIO sbErrsVar
289− pbLog $ encodeUtf8 $ concat
290− [ t
291− , " (pending: "
292− , tshow i
293− , ", failures: "
294− , tshow $ length errs
295− , ")\n"
296− ]
297− libOut = pbLogDir </> fpFromText namever </> "build.out"
298− testOut = pbLogDir </> fpFromText namever </> "test.out"
299− testRunOut = pbLogDir </> fpFromText namever </> "test-run.out"
300−
301− wf fp inner' = do
302− createTree $ parent fp
303− withBinaryFile (fpToString fp) WriteMode inner'
304−
305− configArgs = ($ []) $ execWriter $ do
306− when pbAllowNewer $ tell' "--allow-newer"
307− tell' "--package-db=clear"
308− tell' "--package-db=global"
309− forM_ (pbDatabase pb) $ \db -> tell' $ "--package-db=" ++ fpToText db
310− tell' $ "--libdir=" ++ fpToText (pbLibDir pb)
311− tell' $ "--bindir=" ++ fpToText (pbBinDir pb)
312− tell' $ "--datadir=" ++ fpToText (pbDataDir pb)
313− tell' $ "--docdir=" ++ fpToText (pbDocDir pb)
314− tell' $ "--flags=" ++ flags
315− when (pbEnableLibProfiling && pcEnableLibProfile) $
316− tell' "--enable-library-profiling"
317− where
318− tell' x = tell (x:)
319−
320− flags :: Text
321− flags = unwords $ map go $ mapToList pcFlagOverrides
322− where
323− go (name', isOn) = concat
324− [ if isOn then "" else "-"
325− , unFlagName name'
326− ]
327−
328− PackageConstraints {..} = ppConstraints $ piPlan sbPackageInfo
329−
330− buildLibrary = wf libOut $ \outH -> do
331− let run a b = do when pbVerbose $ log' (unwords (a : b))
332− runChild outH a b
333− log' $ "Unpacking " ++ namever
334− runParent outH "cabal" ["unpack", namever]
335−
336− log' $ "Configuring " ++ namever
337− run "cabal" $ "configure" : configArgs
338−
339− log' $ "Building " ++ namever
340− run "cabal" ["build"]
341−
342− log' $ "Copying/registering " ++ namever
343− run "cabal" ["copy"]
344− withMVar sbRegisterMutex $ const $
345− run "cabal" ["register"]
346−
347− -- Even if the tests later fail, we can allow other libraries to build
348− -- on top of our successful results
349− --
350− -- FIXME do we need to wait to do this until after Haddocks build?
351− -- otherwise, we could have a race condition and try to build a
352− -- dependency's haddocks before this finishes
353− atomically $ putTMVar (piResult sbPackageInfo) True
354−
355− when (pcHaddocks /= Don'tBuild && not (null $ sdModules $ ppDesc $ piPlan sbPackageInfo)) $ do
356− log' $ "Haddocks " ++ namever
357− hfs <- readTVarIO sbHaddockFiles
358− let hfsOpts = flip map (mapToList hfs) $ \(pkgVer, hf) -> concat
359− [ "--haddock-options=--read-interface="
360− , "../"
361− , pkgVer
362− , "/,"
363− , fpToText hf
364− ]
365− args = "haddock"
366− : "--hyperlink-source"
367− : "--html"
368− : "--hoogle"
369− : "--html-location=../$pkg-$version/"
370− : hfsOpts
371−
372− eres <- tryAny $ run "cabal" args
373−
374− forM_ eres $ \() -> do
375− renameOrCopy
376− (childDir </> "dist" </> "doc" </> "html" </> fpFromText name)
377− (pbDocDir pb </> fpFromText namever)
378−
379− enewPath <- tryIO
380− $ canonicalizePath
381− $ pbDocDir pb
382− </> fpFromText namever
383− </> fpFromText name <.> "haddock"
384− case enewPath of
385− Left e -> warn $ tshow e
386− Right newPath -> atomically
387− $ modifyTVar sbHaddockFiles
388− $ insertMap namever newPath
389−
390− case (eres, pcHaddocks) of
391− (Left e, ExpectSuccess) -> throwM e
392− (Right (), ExpectFailure) -> warn $ namever ++ ": unexpected Haddock success"
393− _ -> return ()
394−
395− runTests = wf testOut $ \outH -> do
396− let run = runChild outH
397−
398− when (pbEnableTests && pcTests /= Don'tBuild) $ do
399− log' $ "Test configure " ++ namever
400− run "cabal" $ "configure" : "--enable-tests" : configArgs
401−
402− eres <- tryAny $ do
403− log' $ "Test build " ++ namever
404− run "cabal" ["build"]
405−
406− log' $ "Test run " ++ namever
407− run "cabal" ["test", "--log=" ++ fpToText testRunOut]
408−
409− case (eres, pcTests) of
410− (Left e, ExpectSuccess) -> throwM e
411− (Right (), ExpectFailure) -> warn $ namever ++ ": unexpected test success"
412− _ -> return ()
413−
414− warn t = atomically $ modifyTVar sbWarningsVar (. (t:))
415−
416− updateErrs exc = do
417− log' $ concat
418− [ display (piName sbPackageInfo)
419− , ": "
420− , tshow exc
421− ]
422− atomically $ modifyTVar sbErrsVar $ insertMap (piName sbPackageInfo) exc'
423− where
424− exc' =
425− case fromException exc of
426− Just bf -> bf
427− Nothing -> BuildFailureException exc
428−
429−renameOrCopy :: FilePath -> FilePath -> IO ()
430−renameOrCopy src dest = rename src dest `catchIO` \_ -> copyDir src dest
431−
432−copyDir :: FilePath -> FilePath -> IO ()
433−copyDir src dest =
434− runResourceT $ sourceDirectoryDeep False src $$ mapM_C go
435− where
436− src' = src </> ""
437− go fp = forM_ (F.stripPrefix src' fp) $ \suffix -> do
438− let dest' = dest </> suffix
439− liftIO $ createTree $ parent dest'
440− sourceFile fp $$ (sinkFile dest' :: Sink ByteString (ResourceT IO) ())
441−
442−copyBuiltInHaddocks :: FilePath -> IO ()
443−copyBuiltInHaddocks docdir = do
444− mghc <- findExecutable "ghc"
445− case mghc of
446− Nothing -> error "GHC not found on PATH"
447− Just ghc -> do
448− src <- canonicalizePath
449− (parent (fpFromString ghc) </> "../share/doc/ghc/html/libraries")
450− copyDir src docdir
Stackage/Prelude.hsdeleted−103
@@ -1,103 +0,0 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2−{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3−{-# LANGUAGE NoImplicitPrelude #-}
4−{-# LANGUAGE OverloadedStrings #-}
5−{-# LANGUAGE TypeFamilies #-}
6−module Stackage.Prelude
7− ( module X
8− , module Stackage.Prelude
9− ) where
10−
11−import ClassyPrelude.Conduit as X
12−import Data.Aeson (FromJSON, ToJSON)
13−import Data.Conduit.Process as X
14−import qualified Data.Map as Map
15−import Data.Typeable (TypeRep, typeOf)
16−import Distribution.Package as X (PackageIdentifier (..), PackageName (PackageName))
17−import Distribution.PackageDescription as X (FlagName (..), GenericPackageDescription)
18−import qualified Distribution.Text as DT
19−import Distribution.Version as X (Version (..),
20− VersionRange)
21−import Distribution.Version as X (withinRange)
22−import qualified Distribution.Version as C
23−
24−unPackageName :: PackageName -> Text
25−unPackageName (PackageName str) = pack str
26−
27−unFlagName :: FlagName -> Text
28−unFlagName (FlagName str) = pack str
29−
30−mkPackageName :: Text -> PackageName
31−mkPackageName = PackageName . unpack
32−
33−mkFlagName :: Text -> FlagName
34−mkFlagName = FlagName . unpack
35−
36−display :: DT.Text a => a -> Text
37−display = fromString . DT.display
38−
39−simpleParse :: (MonadThrow m, DT.Text a, Typeable a) => Text -> m a
40−simpleParse orig = withTypeRep $ \rep ->
41− case DT.simpleParse str of
42− Nothing -> throwM (ParseFailedException rep (pack str))
43− Just v -> return v
44− where
45− str = unpack orig
46−
47− withTypeRep :: Typeable a => (TypeRep -> m a) -> m a
48− withTypeRep f =
49− res
50− where
51− res = f (typeOf (unwrap res))
52−
53− unwrap :: m a -> a
54− unwrap _ = error "unwrap"
55−
56−data ParseFailedException = ParseFailedException TypeRep Text
57− deriving (Show, Typeable)
58−instance Exception ParseFailedException
59−
60−newtype Maintainer = Maintainer { unMaintainer :: Text }
61− deriving (Show, Eq, Ord, Hashable, ToJSON, FromJSON, IsString)
62−
63−-- | Name of an executable.
64−newtype ExeName = ExeName { unExeName :: Text }
65− deriving (Show, Eq, Ord, Hashable, ToJSON, FromJSON, IsString)
66−
67−intersectVersionRanges :: VersionRange -> VersionRange -> VersionRange
68−intersectVersionRanges x y = C.simplifyVersionRange $ C.intersectVersionRanges x y
69−
70−-- | There seems to be a bug in Cabal where serializing and deserializing
71−-- version ranges winds up with different representations. So we have a
72−-- super-simplifier to deal with that.
73−simplifyVersionRange :: VersionRange -> VersionRange
74−simplifyVersionRange vr =
75− fromMaybe (assert False vr') $ simpleParse $ display vr'
76− where
77− vr' = C.simplifyVersionRange vr
78−
79−-- | Topologically sort so that items with dependencies occur after those
80−-- dependencies.
81−topologicalSort :: (Ord key, Show key, MonadThrow m, Typeable key)
82− => (value -> finalValue)
83− -> (value -> Set key) -- ^ deps
84− -> Map key value
85− -> m (Vector (key, finalValue))
86−topologicalSort toFinal toDeps =
87− loop id . mapWithKey removeSelfDeps . fmap (toDeps &&& toFinal)
88− where
89− removeSelfDeps k (deps, final) = (deleteSet k deps, final)
90− loop front toProcess | null toProcess = return $ pack $ front []
91− loop front toProcess
92− | null noDeps = throwM $ NoEmptyDeps (map fst toProcess')
93− | otherwise = loop (front . noDeps') (mapFromList hasDeps)
94− where
95− toProcess' = fmap (first removeUnavailable) toProcess
96− allKeys = Map.keysSet toProcess
97− removeUnavailable = asSet . setFromList . filter (`member` allKeys) . setToList
98− (noDeps, hasDeps) = partition (null . fst . snd) $ mapToList toProcess'
99− noDeps' = (map (second snd) noDeps ++)
100−
101−data TopologicalSortException key = NoEmptyDeps (Map key (Set key))
102− deriving (Show, Typeable)
103−instance (Show key, Typeable key) => Exception (TopologicalSortException key)
Stackage/ServerBundle.hsdeleted−114
@@ -1,114 +0,0 @@
1−-- | Create a bundle to be uploaded to Stackage Server.
2−{-# LANGUAGE NoImplicitPrelude #-}
3−{-# LANGUAGE OverloadedStrings #-}
4−{-# LANGUAGE RecordWildCards #-}
5−module Stackage.ServerBundle
6− ( serverBundle
7− , epochTime
8− , bpAllPackages
9− , docsListing
10− ) where
11−
12−import qualified Codec.Archive.Tar as Tar
13−import qualified Codec.Archive.Tar.Entry as Tar
14−import qualified Codec.Compression.GZip as GZip
15−import qualified Data.Map as M
16−import qualified Data.Yaml as Y
17−import Filesystem (isFile)
18−import Foreign.C.Types (CTime (CTime))
19−import Stackage.BuildConstraints
20−import Stackage.BuildPlan
21−import Stackage.Prelude
22−import qualified System.PosixCompat.Time as PC
23−import qualified Text.XML as X
24−import Text.XML.Cursor
25−
26−-- | Get current time
27−epochTime :: IO Tar.EpochTime
28−epochTime = (\(CTime t) -> fromIntegral t) <$> PC.epochTime
29−
30−-- | All package/versions in a build plan, including core packages.
31−--
32−-- Note that this may include packages not available on Hackage.
33−bpAllPackages :: BuildPlan -> Map PackageName Version
34−bpAllPackages BuildPlan {..} =
35− siCorePackages bpSystemInfo ++ map ppVersion bpPackages
36−
37−serverBundle :: Tar.EpochTime
38− -> Text -- ^ title
39− -> Text -- ^ slug
40− -> BuildPlan
41− -> LByteString
42−serverBundle time title slug bp@BuildPlan {..} = GZip.compress $ Tar.write
43− [ fe "build-plan.yaml" (fromStrict $ Y.encode bp)
44− , fe "hackage" hackage
45− , fe "slug" (fromStrict $ encodeUtf8 slug)
46− , fe "desc" (fromStrict $ encodeUtf8 title)
47− , fe "core" corePackagesList
48− ]
49− where
50− fe name contents =
51− case Tar.toTarPath False name of
52− Left s -> error s
53− Right name' -> (Tar.fileEntry name' contents)
54− { Tar.entryTime = time
55− }
56− hackage = builderToLazy $ foldMap goPair $ mapToList packageMap
57−
58− -- need to remove some packages that don't exist on Hackage
59− packageMap = foldr deleteMap (bpAllPackages bp) $ map PackageName
60− [ "bin-package-db"
61− , "ghc"
62− , "rts"
63− ]
64−
65− goPair (name, version) =
66− toBuilder (display name) ++
67− toBuilder (asText "-") ++
68− toBuilder (display version) ++
69− toBuilder (asText "\n")
70−
71− corePackagesList =
72− builderToLazy $ toBuilder $ unlines $
73− map (\(PackageName name) -> name)
74− (M.keys $ siCorePackages bpSystemInfo)
75−
76−docsListing :: BuildPlan
77− -> FilePath -- ^ docs directory
78− -> IO ByteString
79−docsListing bp docsDir =
80− fmap (Y.encode . fold) $ mapM go $ mapToList $ bpAllPackages bp
81− where
82− go :: (PackageName, Version) -> IO (Map Text Y.Value)
83− go (package, version) = do -- handleAny (const $ return mempty) $ do
84− let dirname = fpFromText (concat
85− [ display package
86− , "-"
87− , display version
88− ])
89− indexFP = (docsDir </> dirname </> "index.html")
90− ie <- isFile indexFP
91− if ie
92− then do
93− doc <- flip X.readFile indexFP X.def
94− { X.psDecodeEntities = X.decodeHtmlEntities
95− }
96− let cursor = fromDocument doc
97− getPair x = take 1 $ do
98− href <- attribute "href" x
99− let name = concat $ x $// content
100− guard $ not $ null name
101− return (href, name)
102− pairs = cursor $// attributeIs "class" "module"
103− &/ laxElement "a" >=> getPair
104− m <- fmap fold $ forM pairs $ \(href, name) -> do
105− let suffix = dirname </> fpFromText href
106− e <- isFile $ docsDir </> suffix
107− return $ if e
108− then asMap $ singletonMap name [fpToText dirname, href]
109− else mempty
110− return $ singletonMap (display package) $ Y.object
111− [ "version" Y..= display version
112− , "modules" Y..= m
113− ]
114− else return mempty
Stackage/UpdateBuildPlan.hsdeleted−54
@@ -1,54 +0,0 @@
1−{-# LANGUAGE NoImplicitPrelude #-}
2−{-# LANGUAGE OverloadedStrings #-}
3−{-# LANGUAGE RecordWildCards #-}
4−-- | Take an existing build plan and bump all packages to the newest version in
5−-- the same major version number.
6−module Stackage.UpdateBuildPlan
7− ( updateBuildConstraints
8− , updateBuildPlan
9− ) where
10−
11−import qualified Data.Map as Map
12−import Distribution.Version (anyVersion, earlierVersion,
13− orLaterVersion)
14−import Stackage.BuildConstraints
15−import Stackage.BuildPlan
16−import Stackage.Prelude
17−
18−updateBuildPlan :: Map PackageName PackagePlan -> BuildPlan -> IO BuildPlan
19−updateBuildPlan packagesOrig
20− = newBuildPlan packagesOrig . updateBuildConstraints
21−
22−updateBuildConstraints :: BuildPlan -> BuildConstraints
23−updateBuildConstraints BuildPlan {..} =
24− BuildConstraints {..}
25− where
26− bcSystemInfo = bpSystemInfo
27− bcPackages = Map.keysSet bpPackages
28− bcGithubUsers = bpGithubUsers
29−
30− bcPackageConstraints name = PackageConstraints
31− { pcVersionRange = addBumpRange (maybe anyVersion pcVersionRange moldPC)
32− , pcMaintainer = moldPC >>= pcMaintainer
33− , pcTests = maybe ExpectSuccess pcTests moldPC
34− , pcHaddocks = maybe ExpectSuccess pcHaddocks moldPC
35− , pcBuildBenchmarks = maybe True pcBuildBenchmarks moldPC
36− , pcFlagOverrides = maybe mempty pcFlagOverrides moldPC
37− , pcEnableLibProfile = maybe False pcEnableLibProfile moldPC
38− }
39− where
40− moldBP = lookup name bpPackages
41− moldPC = ppConstraints <$> moldBP
42−
43− addBumpRange oldRange =
44− case moldBP of
45− Nothing -> oldRange
46− Just bp -> intersectVersionRanges oldRange
47− $ bumpRange $ ppVersion bp
48−
49− bumpRange version = intersectVersionRanges
50− (orLaterVersion version)
51− (earlierVersion $ bumpVersion version)
52− bumpVersion (Version (x:y:_) _) = Version [x, y + 1] []
53− bumpVersion (Version [x] _) = Version [x, 1] []
54− bumpVersion (Version [] _) = assert False $ Version [1, 0] []
Stackage/Upload.hsdeleted−279
@@ -1,279 +0,0 @@
1−-- | Upload to Stackage and Hackage
2−{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3−{-# LANGUAGE NoImplicitPrelude #-}
4−{-# LANGUAGE OverloadedStrings #-}
5−{-# LANGUAGE RecordWildCards #-}
6−{-# LANGUAGE TupleSections #-}
7−module Stackage.Upload
8− ( UploadBundle (..)
9− , SnapshotIdent (..)
10− , uploadBundle
11− , UploadDocs (..)
12− , uploadDocs
13− , uploadHackageDistro
14− , uploadHackageDistroNamed
15− , UploadDocMap (..)
16− , uploadDocMap
17− ) where
18−
19−import Control.Monad.Writer.Strict (execWriter, tell)
20−import Data.Default.Class (Default (..))
21−import Filesystem (isDirectory, isFile)
22−import Network.HTTP.Client
23−import Network.HTTP.Client.MultipartFormData
24−import Stackage.BuildPlan (BuildPlan)
25−import Stackage.Prelude
26−import Stackage.ServerBundle (bpAllPackages, docsListing)
27−import System.IO.Temp (withSystemTempFile)
28−
29−newtype StackageServer = StackageServer { unStackageServer :: Text }
30− deriving (Show, Eq, Ord, Hashable, IsString)
31−instance Default StackageServer where
32− def = "http://www.stackage.org"
33−
34−data UploadBundle = UploadBundle
35− { ubServer :: StackageServer
36− , ubContents :: LByteString
37− , ubAlias :: Maybe Text
38− , ubNightly :: Maybe Text -- ^ should be GHC version
39− , ubLTS :: Maybe Text -- ^ e.g. 2.3
40− , ubAuthToken :: Text
41− }
42−instance Default UploadBundle where
43− def = UploadBundle
44− { ubServer = def
45− , ubContents = mempty
46− , ubAlias = Nothing
47− , ubNightly = Nothing
48− , ubLTS = Nothing
49− , ubAuthToken = "no-auth-token-provided"
50− }
51−
52−newtype SnapshotIdent = SnapshotIdent { unSnapshotIdent :: Text }
53− deriving (Show, Eq, Ord, Hashable, IsString)
54−
55−uploadBundle :: UploadBundle -> Manager -> IO (SnapshotIdent, Maybe Text)
56−uploadBundle UploadBundle {..} man = do
57− req1 <- parseUrl $ unpack $ unStackageServer ubServer ++ "/upload"
58− req2 <- formDataBody formData req1
59− let req3 = req2
60− { method = "PUT"
61− , requestHeaders =
62− [ ("Authorization", encodeUtf8 ubAuthToken)
63− , ("Accept", "application/json")
64− ] ++ requestHeaders req2
65− , redirectCount = 0
66− , checkStatus = \_ _ _ -> Nothing
67− , responseTimeout = Just 300000000
68− }
69− res <- httpLbs req3 man
70− case lookup "x-stackage-ident" $ responseHeaders res of
71− Just snapid -> return
72− ( SnapshotIdent $ decodeUtf8 snapid
73− , decodeUtf8 <$> lookup "location" (responseHeaders res)
74− )
75− Nothing -> error $ "An error occurred: " ++ show res
76− where
77− params = mapMaybe (\(x, y) -> (x, ) <$> y)
78− [ ("alias", ubAlias)
79− , ("nightly", ubNightly)
80− , ("lts", ubLTS)
81− ]
82− formData = ($ []) $ execWriter $ do
83− forM_ params $ \(key, value) ->
84− tell' $ partBS key $ encodeUtf8 value
85− tell' $ partFileRequestBody "stackage" "stackage"
86− $ RequestBodyLBS ubContents
87−
88− tell' x = tell (x:)
89−
90−data UploadDocs = UploadDocs
91− { udServer :: StackageServer
92− , udDocs :: FilePath -- ^ may be a directory or a tarball
93− , udAuthToken :: Text
94− , udSnapshot :: SnapshotIdent
95− }
96−
97−uploadDocs :: UploadDocs -> Manager -> IO (Response LByteString)
98−uploadDocs (UploadDocs (StackageServer host) fp0 token ident) man = do
99− fe <- isFile fp0
100− if fe
101− then uploadDocsFile $ fpToString fp0
102− else do
103− de <- isDirectory fp0
104− if de
105− then uploadDocsDir
106− else error $ "Path not found: " ++ fpToString fp0
107− where
108− uploadDocsDir = withSystemTempFile "haddocks.tar.xz" $ \fp h -> do
109− hClose h
110− dirs <- fmap sort
111− $ runResourceT
112− $ sourceDirectory fp0
113− $$ filterMC (liftIO . isDirectory)
114− =$ mapC (fpToString . filename)
115− =$ sinkList
116− writeFile (fp0 </> "index.html") $ mkIndex
117− (unpack $ unSnapshotIdent ident)
118− dirs
119− writeFile (fp0 </> "style.css") styleCss
120− -- FIXME write index.html, style.css
121− let cp = (proc "tar" $ "cJf" : fp : "index.html" : "style.css" : dirs)
122− { cwd = Just $ fpToString fp0
123− }
124− withCheckedProcess cp $ \Inherited Inherited Inherited -> return ()
125− uploadDocsFile fp
126− uploadDocsFile fp = do
127− req1 <- parseUrl $ unpack $ concat
128− [ host
129− , "/upload-haddock/"
130− , unSnapshotIdent ident
131− ]
132− let formData =
133− [ partFileSource "tarball" fp
134− ]
135− req2 <- formDataBody formData req1
136− let req3 = req2
137− { method = "PUT"
138− , requestHeaders =
139− [ ("Authorization", encodeUtf8 token)
140− , ("Accept", "application/json")
141− ] ++ requestHeaders req2
142− , redirectCount = 0
143− , checkStatus = \_ _ _ -> Nothing
144− , responseTimeout = Just 300000000
145− }
146− httpLbs req3 man
147−
148−uploadHackageDistro :: BuildPlan
149− -> ByteString -- ^ Hackage username
150− -> ByteString -- ^ Hackage password
151− -> Manager
152− -> IO (Response LByteString)
153−uploadHackageDistro = uploadHackageDistroNamed "Stackage"
154−
155−uploadHackageDistroNamed
156− :: Text -- ^ distro name
157− -> BuildPlan
158− -> ByteString -- ^ Hackage username
159− -> ByteString -- ^ Hackage password
160− -> Manager
161− -> IO (Response LByteString)
162−uploadHackageDistroNamed name bp username password manager = do
163− req1 <- parseUrl $ concat
164− [ "http://hackage.haskell.org/distro/"
165− , unpack name
166− , "/packages.csv"
167− ]
168− let req2 = req1
169− { requestHeaders = [("Content-Type", "text/csv")]
170− , requestBody = RequestBodyLBS csv
171− , checkStatus = \_ _ _ -> Nothing
172− , method = "PUT"
173− }
174− httpLbs (applyBasicAuth username password req2) manager
175− where
176− csv = encodeUtf8
177− $ builderToLazy
178− $ mconcat
179− $ intersperse "\n"
180− $ map go
181− $ mapToList
182− $ bpAllPackages bp
183− go (name, version) =
184− "\"" ++
185− (toBuilder $ display name) ++
186− "\",\"" ++
187− (toBuilder $ display version) ++
188− "\",\"http://www.stackage.org/package/" ++
189− (toBuilder $ display name) ++
190− "\""
191−
192−data UploadDocMap = UploadDocMap
193− { udmServer :: StackageServer
194− , udmAuthToken :: Text
195− , udmSnapshot :: SnapshotIdent
196− , udmDocDir :: FilePath
197− , udmPlan :: BuildPlan
198− }
199−
200−uploadDocMap :: UploadDocMap -> Manager -> IO (Response LByteString)
201−uploadDocMap UploadDocMap {..} man = do
202− docmap <- docsListing udmPlan udmDocDir
203− req1 <- parseUrl $ unpack $ unStackageServer udmServer ++ "/upload-doc-map"
204− req2 <- formDataBody (formData docmap) req1
205− let req3 = req2
206− { method = "PUT"
207− , requestHeaders =
208− [ ("Authorization", encodeUtf8 udmAuthToken)
209− , ("Accept", "application/json")
210− ] ++ requestHeaders req2
211− , redirectCount = 0
212− , checkStatus = \_ _ _ -> Nothing
213− , responseTimeout = Just 300000000
214− }
215− httpLbs req3 man
216− where
217− formData docmap =
218− [ partBS "snapshot" (encodeUtf8 $ unSnapshotIdent udmSnapshot)
219− , partFileRequestBody "docmap" "docmap" $ RequestBodyBS docmap
220− ]
221−
222−mkIndex :: String -> [String] -> String
223−mkIndex snapid dirs = concat
224− [ "<!DOCTYPE html>\n<html lang='en'><head><title>Haddocks index</title>"
225− , "<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'>"
226− , "<link rel='stylesheet' href='style.css'>"
227− , "<link rel='shortcut icon' href='http://www.stackage.org/static/img/favicon.ico' />"
228− , "</head>"
229− , "<body><div class='container'>"
230− , "<div class='row'><div class='span12 col-md-12'>"
231− , "<h1>Haddock documentation index</h1>"
232− , "<p class='return'><a href=\"http://www.stackage.org/stackage/"
233− , snapid
234− , "\">Return to snapshot</a></p><ul>"
235− , concatMap toLI dirs
236− , "</ul></div></div></div></body></html>"
237− ]
238− where
239− toLI name = concat
240− [ "<li><a href='"
241− , name
242− , "/index.html'>"
243− , name
244− , "</a></li>"
245− ]
246−
247−styleCss :: String
248−styleCss = concat
249− [ "@media (min-width: 530px) {"
250− , "ul { -webkit-column-count: 2; -moz-column-count: 2; column-count: 2 }"
251− , "}"
252− , "@media (min-width: 760px) {"
253− , "ul { -webkit-column-count: 3; -moz-column-count: 3; column-count: 3 }"
254− , "}"
255− , "ul {"
256− , " margin-left: 0;"
257− , " padding-left: 0;"
258− , " list-style-type: none;"
259− , "}"
260− , "body {"
261− , " background: #f0f0f0;"
262− , " font-family: 'Lato', sans-serif;"
263− , " text-shadow: 1px 1px 1px #ffffff;"
264− , " font-size: 20px;"
265− , " line-height: 30px;"
266− , " padding-bottom: 5em;"
267− , "}"
268− , "h1 {"
269− , " font-weight: normal;"
270− , " color: #06537d;"
271− , " font-size: 45px;"
272− , "}"
273− , ".return a {"
274− , " color: #06537d;"
275− , " font-style: italic;"
276− , "}"
277− , ".return {"
278− , " margin-bottom: 1em;"
279− , "}"]
app/stackage.hsdeleted−88
@@ -1,88 +0,0 @@
1−{-# LANGUAGE TupleSections #-}
2−
3−module Main where
4−
5−import Control.Monad
6−import Data.Monoid
7−import Data.String (fromString)
8−import Data.Version
9−import Options.Applicative
10−import Paths_stackage (version)
11−import Stackage.CompleteBuild
12−
13−main :: IO ()
14−main =
15− join $
16− execParser $
17− info
18− (helpOption <*> versionOption <*> config)
19− (header "Stackage" <>
20− fullDesc)
21− where
22− helpOption =
23− abortOption ShowHelpText $
24− long "help" <>
25− help "Show this help text"
26− versionOption =
27− infoOption
28− ("fpbuild version " ++ showVersion version)
29− (long "version" <>
30− help "Show fpbuild version")
31− config =
32− subparser $
33− mconcat
34− [ cmnd
35− (uncurry completeBuild)
36− (fmap (Nightly, ) buildFlags)
37− "nightly"
38− "Build, test and upload the Nightly snapshot"
39− , cmnd
40− (uncurry completeBuild)
41− (fmap (LTS Major, ) buildFlags)
42− "lts-major"
43− "Build, test and upload the LTS (major) snapshot"
44− , cmnd
45− (uncurry completeBuild)
46− (fmap (LTS Minor, ) buildFlags)
47− "lts-minor"
48− "Build, test and upload the LTS (minor) snapshot"
49− , cmnd
50− justUploadNightly
51− nightlyUploadFlags
52− "upload-nightly"
53− "Upload an already-built nightly snapshot"
54− , cmnd
55− (const justCheck)
56− (pure ())
57− "check"
58− "Just check that the build plan is ok"]
59− cmnd exec parse name desc =
60− command name $
61− info
62− (fmap exec parse)
63− (progDesc desc)
64− buildFlags =
65− BuildFlags <$>
66− fmap
67− not
68− (switch
69− (long "skip-tests" <>
70− help "Skip build and running the test suites")) <*>
71− fmap
72− not
73− (switch
74− (long "skip-upload" <>
75− help "Skip uploading bundle, docs, etc.")) <*>
76− switch
77− (long "enable-library-profiling" <>
78− help "Enable profiling when building") <*>
79− switch
80− (long "verbose" <> short 'v' <>
81− help "Output verbose detail about the build steps") <*>
82− switch
83− (long "skip-check" <>
84− help "Skip the check phase, and pass --allow-newer to cabal configure")
85−
86− nightlyUploadFlags = fromString <$> strArgument
87− (metavar "DATE" <>
88− help "Date, in YYYY-MM-DD format")
build-constraints.yaml+273−68
@@ -67,12 +67,13 @@ packages:
6767 - csv-conduit
6868 - diagrams-cairo
6969 - dimensional
70+ - executable-hash
7071 - executable-path
7172 - fgl
7273 - fixed-list
7374 - foreign-store
7475 - formatting
75− - fpco-api
76+ #- fpco-api
7677 - gtk2hs-buildtools
7778 - happy
7879 - histogram-fill
@@ -92,6 +93,8 @@ packages:
9293 - shelly
9394 - smtLib
9495 - stackage
96+ - stackage-curator
97+ - stackage-types
9598 - statistics-linreg
9699 - th-expand-syns
97100 - thyme
@@ -119,10 +122,10 @@ packages:
119122 - kure
120123
121124 "Omari Norman <omari@smileystation.com>":
122− - barecheck
123125 - rainbow
124− - rainbow-tests
125− - quickpull
126+ - multiarg
127+ - prednote
128+ - cartel
126129
127130 "Neil Mitchell":
128131 - hlint
@@ -150,6 +153,7 @@ packages:
150153 "Jasper Van der Jeugt":
151154 - blaze-html
152155 - blaze-markup
156+ - hakyll
153157 - stylish-haskell
154158
155159 "Antoine Latter":
@@ -181,7 +185,6 @@ packages:
181185 - crypto-random-api
182186 - hit
183187 - language-java
184− - language-java
185188 - libgit
186189 - pem
187190 - siphash
@@ -208,15 +211,17 @@ packages:
208211 - scrobble
209212 - shell-conduit
210213 - sourcemap
214+ - hindent
215+ - descriptive
216+ - wrap
211217 # requires old haddock currently - haskell-docs
212− # TODO: Add hindent and structured-haskell-mode once they've been ported to HSE 1.16.
218+ # TODO: Add structured-haskell-mode once they've been ported to HSE 1.16.
213219
214− # GHC 7.6
215− # "Alberto G. Corona <agocorona@gmail.com>":
216− # - RefSerialize
217− # - TCache
218− # - Workflow
219− # - MFlow
220+ "Alberto G. Corona <agocorona@gmail.com>":
221+ - RefSerialize
222+ - TCache
223+ - Workflow
224+ - MFlow
220225
221226 "Edward Kmett <ekmett@gmail.com>":
222227 - ad
@@ -311,13 +316,17 @@ packages:
311316
312317 "Brent Yorgey <byorgey@gmail.com>":
313318 - active
314− - BlogLiterately
315− - BlogLiterately-diagrams
319+ # Temporarily disabled due to restrictive lens upper bound
320+ #- BlogLiterately
321+ #- BlogLiterately-diagrams
316322 - diagrams
317− - diagrams-builder
323+
324+ # https://github.com/fpco/stackage/issues/443
325+ #- diagrams-builder
326+ #- diagrams-haddock
327+
318328 - diagrams-contrib
319329 - diagrams-core
320− - diagrams-haddock
321330 - diagrams-lib
322331 - diagrams-postscript
323332 - diagrams-svg
@@ -332,6 +341,8 @@ packages:
332341 - JuicyPixels
333342 - FontyFruity
334343 - Rasterific
344+ - svg-tree
345+ - rasterific-svg
335346
336347 "Patrick Brisbin":
337348 - gravatar
@@ -363,15 +374,20 @@ packages:
363374 - tardis
364375 - lens-family-th
365376
366− "Daniel Díaz <dhelta.diaz@gmail.com>":
377+ "Daniel Díaz dhelta.diaz@gmail.com @Daniel-Diaz":
367378 - HaTeX
368379 - matrix
369380 - binary-list
381+ - haskintex
382+ - post-mess-age
383+ - include-file
370384
371385 "Gabriel Gonzalez <Gabriel439@gmail.com>":
372386 - pipes
373387 - pipes-parse
374388 - pipes-concurrency
389+ - pipes-safe
390+ - turtle
375391
376392 "Chris Allen <cma@bitemyapp.com>":
377393 - bloodhound
@@ -383,9 +399,12 @@ packages:
383399 - fay-jquery
384400 - fay-text
385401 - fay-uri
386− - fclabels
387402 - snaplet-fay
388403
404+ "Sebastiaan Visser <haskell@fvisser.nl>":
405+ - clay
406+ - fclabels
407+
389408 "Rodrigo Setti <rodrigosetti@gmail.com>":
390409 - messagepack
391410 - messagepack-rpc
@@ -418,10 +437,7 @@ packages:
418437 - amqp
419438 - curl
420439 - generics-sop
421−
422− # https://github.com/fpco/stackage/issues/341
423− - haskell-names < 0.5
424−
440+ - haskell-names
425441 - haskell-packages
426442 - heredoc
427443 - hse-cpp
@@ -455,6 +471,8 @@ packages:
455471 - circle-packing
456472 - arbtt
457473 - ghc-heap-view
474+ - tttool
475+ - gipeda
458476
459477 "Aditya Bhargava <adit@adit.io":
460478 - HandsomeSoup
@@ -494,9 +512,9 @@ packages:
494512 - code-builder
495513 - fay-builder
496514 - generic-aeson
515+ - generic-xmlpickler
497516 - hxt-pickle-utils
498517 - imagesize-conduit
499− - imagesize-conduit
500518 - json-schema
501519 - multipart
502520 - regular-xmlpickler
@@ -509,8 +527,6 @@ packages:
509527 - rest-types
510528 - rest-wai
511529 - tostring
512− - tostring
513− - uri-encode
514530 - uri-encode
515531
516532 "Simon Michael <simon@joyful.com>":
@@ -520,7 +536,10 @@ packages:
520536 - io-manager
521537
522538 "Dimitri Sabadie <dimitri.sabadie@gmail.com":
539+ # https://github.com/fpco/stackage/pull/461#issuecomment-76914158
540+ # - al
523541 - monad-journal
542+ - smoothie
524543
525544 "Thomas Schilling <nominolo@googlemail.com>":
526545 - ghc-syb-utils
@@ -565,6 +584,7 @@ packages:
565584 - haddock-api
566585 - here
567586 - hlibgit2
587+ - gitlib-libgit2
568588 - hostname-validate
569589 - interpolatedstring-perl6
570590 - iproute
@@ -603,14 +623,18 @@ packages:
603623 - Spock
604624 - Spock-digestive
605625 - Spock-worker
626+ - users
627+ - users-test
628+ - users-postgresql-simple
606629
607630 "Joey Eremondi <joey@eremondi.com>":
608631 - aeson-pretty
609632 - digest
610− - elm-build-lib
611− - elm-compiler
633+ # See: https://github.com/elm-lang/elm-compiler/commit/e714001a928b3834b62555fc350909c95d380ef4
634+ #- elm-build-lib
635+ #- elm-compiler
612636 - elm-core-sources
613− - elm-package
637+ #- elm-package
614638 - language-glsl
615639 - prettyclass
616640 - QuasiText
@@ -632,6 +656,11 @@ packages:
632656 "Samplecount stefan@samplecount.com @kaoskorobase":
633657 - shake-language-c
634658
659+ "Marcin Mrotek <marcin.jan.mrotek@gmail.com>":
660+ - diagrams-hsqml
661+ - type-list
662+ - vinyl-utils
663+
635664 "Marcin Mrotek <marcin.jan.mrotek@gmail.com>":
636665 - type-list
637666
@@ -672,48 +701,169 @@ packages:
672701 "Jens Petersen juhpetersen@gmail.com @juhp":
673702 - cabal-rpm
674703
704+ "Renzo Carbonara renzocarbonara@gmail.com @k0001":
705+ - network-simple
706+ - pipes-aeson
707+ - pipes-attoparsec
708+ - pipes-binary
709+ - pipes-network
710+
711+ "Tomas Carnecky":
712+ - rethinkdb-client-driver
713+
714+ "Alexandr Kurilin alex@kurilin.net @alex_kurilin":
715+ - bcrypt
716+
717+ "Jeffrey Rosenbluth jeffrey.rosenbluth@gmail.com":
718+ - palette
719+ - diagrams-canvas
720+ - diagrams-rasterific
721+ - lucid-svg
722+
723+ "Gabríel Arthúr Pétursson gabriel@system.is":
724+ - sdl2
725+
726+ "Leon Mergen leon@solatis.com @solatis":
727+ - network-attoparsec
728+ - network-anonymous-i2p
729+
730+ "Timothy Jones git@zmthy.io @zmthy":
731+ - cabal-test-quickcheck
732+ - http-media
733+
734+ "Greg V greg@unrelenting.technology @myfreeweb":
735+ - gitson
736+ - pcre-heavy
737+
738+ "Francesco Mazzoli f@mazzo.li @bitonic":
739+ - language-c-quote
740+
741+ "Sönke Hahn soenkehahn@gmail.com @soenkehahn":
742+ - string-conversions
743+
744+ "Oleg Grenrus oleg.grenrus@iki.fi @phadej":
745+ - waitra
746+
747+ "Adam C. Foltzer acfoltzer@galois.com @acfoltzer":
748+ - cryptol
749+ - gitrev
750+
751+ "Luke Taylor tekul.hs@gmail.com @tekul":
752+ - jose-jwt
753+
754+ "Brendan Hay brendan.g.hay@gmail.com @brendanhay":
755+ - amazonka
756+ - amazonka-core
757+ - amazonka-autoscaling
758+ - amazonka-cloudformation
759+ - amazonka-cloudfront
760+ - amazonka-cloudhsm
761+ - amazonka-cloudsearch-domains
762+ - amazonka-cloudsearch
763+ - amazonka-cloudtrail
764+ - amazonka-cloudwatch-logs
765+ - amazonka-cloudwatch
766+ - amazonka-codedeploy
767+ - amazonka-cognito-identity
768+ - amazonka-cognito-sync
769+ - amazonka-config
770+ - amazonka-datapipeline
771+ - amazonka-directconnect
772+ - amazonka-dynamodb
773+ - amazonka-ec2
774+ - amazonka-ecs
775+ - amazonka-elasticache
776+ - amazonka-elasticbeanstalk
777+ - amazonka-elastictranscoder
778+ - amazonka-elb
779+ - amazonka-emr
780+ - amazonka-glacier
781+ - amazonka-iam
782+ - amazonka-importexport
783+ - amazonka-kinesis
784+ - amazonka-kms
785+ - amazonka-lambda
786+ - amazonka-opsworks
787+ - amazonka-rds
788+ - amazonka-redshift
789+ - amazonka-route53-domains
790+ - amazonka-route53
791+ - amazonka-s3
792+ - amazonka-sdb
793+ - amazonka-ses
794+ - amazonka-sns
795+ - amazonka-sqs
796+ - amazonka-ssm
797+ - amazonka-storagegateway
798+ - amazonka-sts
799+ - amazonka-support
800+ - amazonka-swf
801+ - ede
802+ - pagerduty
803+ - semver
804+ - text-manipulate
805+
806+ "Nick Partridge nkpart@gmail.com @nkpart":
807+ - cabal-file-th
808+
809+ "Gershom Bazerman <gershomb@gmail.com> @gbaz":
810+ - jmacro
811+ - jmacro-rpc
812+ - jmacro-rpc-happstack
813+ - jmacro-rpc-snap
814+ - mbox
815+ - kmeans
816+ - boolsimplifier
817+ - cubicspline
818+ - maximal-cliques
819+
820+ "Alexander Bondarenko <aenor.realm@gmail.com> @wiz":
821+ - soap
822+ - soap-tls
823+ - soap-openssl
824+
675825 "Stackage upper bounds":
826+ # GHC 7.8 uppdate bound
827+ - haddock-api < 2.16
828+ - haddock-library < 1.2
829+ - hdocs < 0.4.2
676830
677831 # Force a specific version that's compatible with transformers 0.3
678− - transformers-compat == 0.3.3.3
832+ - transformers-compat == 0.4.0.3
679833
680− # https://github.com/fpco/stackage/issues/291
681− - random < 1.0.1.3
834+ # https://github.com/fpco/stackage/issues/415
835+ - hackage-db < 1.12
682836
683− # https://github.com/fpco/stackage/issues/370
684− - monad-control < 1
685− - lifted-async < 0.3
686− - scotty < 0.9.1
687− - hoauth2 < 0.4.4
837+ # https://github.com/fpco/stackage/issues/442
838+ - blaze-builder < 0.4
688839
689− # https://github.com/fpco/stackage/issues/389
690− - lens < 4.7
840+ # https://github.com/fpco/stackage/issues/487
841+ - blaze-markup < 0.7
842+ - blaze-html < 0.8
691843
692− # https://github.com/fpco/stackage/issues/390
693− # NOTE: When this issue is resolved, remove the expected test failure
694− # for language-ecmascript as well.
695− - language-ecmascript < 0.17
844+ # https://github.com/fpco/stackage/issues/467
845+ - lens < 4.8
696846
697− # https://github.com/fpco/stackage/issues/398
698− - monoid-subclasses < 0.4
847+ # https://github.com/fpco/stackage/issues/476
848+ - vector-space < 0.10
699849
700− # https://github.com/fpco/stackage/issues/401
701− - happstack-server < 7.4
850+ # https://github.com/fpco/stackage/issues/479
851+ - QuickCheck < 2.8
702852
703− # https://github.com/fpco/stackage/issues/402
704− - vector-space < 0.9
853+ # https://github.com/fpco/stackage/issues/483
854+ - rethinkdb-client-driver < 0.0.15
705855
706− # https://github.com/fpco/stackage/issues/407
707− - HStringTemplate < 0.8
856+ # https://github.com/fpco/stackage/issues/494
857+ - criterion < 1.1
708858
709− # https://github.com/fpco/stackage/issues/410
710− - elm-package < 0.4
859+ # https://github.com/fpco/stackage/issues/497
860+ - primitive < 0.6
711861
712− # https://github.com/fpco/lts-haskell/issues/5
713− - ChasingBottoms < 1.3.0.10 || > 1.3.0.10
862+ # https://github.com/jgm/pandoc/issues/2036
863+ - highlighting-kate < 0.5.13
714864
715− # https://github.com/fpco/stackage/issues/415
716− - hackage-db < 1.12
865+ # https://github.com/bos/mwc-random/issues/45
866+ - mwc-random < 0.13.3.1
717867
718868# Package flags are applied to individual packages, and override the values of
719869# global-flags
@@ -747,6 +897,10 @@ package-flags:
747897 # GHC 7.10 remove
748898 aeson:
749899 old-locale: true
900+ tttool:
901+ old-locale: true
902+ amazonka-core:
903+ old-locale: true
750904
751905 hxt:
752906 network-uri: true
@@ -761,6 +915,17 @@ package-flags:
761915 text:
762916 integer-simple: false
763917
918+ tar:
919+ old-time: false
920+
921+ mtl-compat:
922+ two-point-one: true
923+ two-point-two: false
924+
925+ # https://github.com/fpco/stackage/pull/482#issuecomment-83635207
926+ jose-jwt:
927+ doctest: false
928+
764929# By skipping a test suite, we do not pull in the build dependencies
765930skipped-tests:
766931 - ReadArgs # old version of hspec
@@ -888,9 +1053,6 @@ expected-test-failures:
8881053 # https://github.com/BioHaskell/octree/issues/4
8891054 - Octree
8901055
891− # https://github.com/goldfirere/th-desugar/issues/12
892− - th-desugar
893−
8941056 # https://github.com/jmillikin/haskell-filesystem/issues/3
8951057 - system-filepath
8961058
@@ -942,9 +1104,6 @@ expected-test-failures:
9421104 # https://github.com/vincenthz/hs-crypto-pubkey/issues/17
9431105 - crypto-pubkey
9441106
945− # https://github.com/jswebtools/language-ecmascript/issues/60
946− - language-ecmascript
947−
9481107 # https://github.com/kazu-yamamoto/unix-time/issues/29
9491108 - unix-time
9501109
@@ -957,20 +1116,61 @@ expected-test-failures:
9571116 # https://github.com/bos/wreq/issues/53
9581117 - wreq
9591118
960− # https://github.com/vincenthz/tasty-kat/issues/1
961− - tasty-kat
1119+ # Requires local database running
1120+ - rethinkdb-client-driver
1121+
1122+ # https://github.com/haskell-distributed/distributed-process-execution/issues/2
1123+ - distributed-process-execution
1124+
1125+ # Seems to depend on mtl being installed in user package database, which
1126+ # isn't always the case (e.g., build server)
1127+ - happy
1128+
1129+ # https://github.com/jberryman/directory-tree/issues/4
1130+ - directory-tree
1131+
1132+ # https://github.com/zmthy/http-media/issues/11
1133+ - http-media
1134+
1135+ # https://github.com/ekmett/semigroupoids/issues/18
1136+ - semigroupoids
1137+
1138+ # https://github.com/ndmitchell/hoogle/issues/101
1139+ - hoogle
1140+
1141+ # https://github.com/myfreeweb/gitson/issues/1
1142+ - gitson
1143+
1144+ # https://github.com/jcristovao/enclosed-exceptions/issues/6
1145+ - enclosed-exceptions
1146+
1147+ # Expects a running PostgreSQL server
1148+ - users-postgresql-simple
1149+
1150+ # Problems with linking with system libraries on Ubuntu 12.04
1151+ - nettle
1152+
1153+ # Requires locally running services
1154+ - network-anonymous-i2p
1155+
1156+ # Tests not reliable on non-Windows systems
1157+ - nsis
9621158
9631159# Haddocks which are expected to fail. Same concept as expected test failures.
9641160expected-haddock-failures:
9651161 # https://github.com/acw/bytestring-progress/issues/4
9661162 - bytestring-progress
9671163
968− # https://github.com/ekmett/gl/issues/4
969− - gl
970−
9711164 # https://github.com/leventov/yarr/issues/5
9721165 - yarr
9731166
1167+ # https://github.com/wereHamster/rethinkdb-client-driver/issues/1
1168+ - rethinkdb-client-driver
1169+
1170+ # Requires build before haddock, which doesn't always happen in incremental
1171+ # builds. Could consider special-casing this requirement.
1172+ - gtk
1173+
9741174# Benchmarks which should not be built. Note that Stackage does *not* generally
9751175# build benchmarks. The difference here will be whether dependencies for these
9761176# benchmarks are included or not.
@@ -997,7 +1197,12 @@ skipped-benchmarks:
9971197 # sometimes falls out-of-sync on hasql-postgres
9981198 - hasql
9991199
1000−skipped-profiling: []
1200+ # https://github.com/fpco/stackage/issues/488
1201+ - uuid-types
1202+
1203+skipped-profiling:
1204+ # https://github.com/nomeata/ghc-heap-view/commit/8d198eb8fbbad2ce0c4527c781659f35b8909c04#diff-8288955e209cfbead5b318a8598be9c0R10
1205+ - ghc-heap-view
10011206
10021207# Mapping from Github account holding a package to the Github users who should
10031208# be pinged on failure. If no value is specified here, then the owning account
cabal.configdeleted−847
@@ -1,847 +0,0 @@
1−-- Stackage snapshot from: http://www.stackage.org/snapshot/nightly-2014-12-24
2−-- Please place this file next to your .cabal file as cabal.config
3−-- To only use tested packages, uncomment the following line:
4−-- remote-repo: stackage-nightly-2014-12-24:http://www.stackage.org/snapshot/nightly-2014-12-24
5−constraints: abstract-deque ==0.3,
6− abstract-par ==0.3.3,
7− accelerate ==0.15.0.0,
8− ace ==0.6,
9− action-permutations ==0.0.0.1,
10− active ==0.1.0.17,
11− AC-Vector ==2.3.2,
12− ad ==4.2.1.1,
13− adjunctions ==4.2,
14− aeson ==0.8.0.2,
15− aeson-pretty ==0.7.2,
16− aeson-qq ==0.7.4,
17− aeson-utils ==0.2.2.1,
18− alarmclock ==0.2.0.5,
19− alex ==3.1.3,
20− amqp ==0.10.1,
21− ansi-terminal ==0.6.2.1,
22− ansi-wl-pprint ==0.6.7.1,
23− appar ==0.1.4,
24− approximate ==0.2.1.1,
25− arbtt ==0.8.1.4,
26− arithmoi ==0.4.1.1,
27− array installed,
28− arrow-list ==0.6.1.5,
29− asn1-data ==0.7.1,
30− asn1-encoding ==0.9.0,
31− asn1-parse ==0.9.0,
32− asn1-types ==0.3.0,
33− async ==2.0.2,
34− atto-lisp ==0.2.2,
35− attoparsec ==0.12.1.2,
36− attoparsec-conduit ==1.1.0,
37− attoparsec-enumerator ==0.3.3,
38− attoparsec-expr ==0.1.1.1,
39− authenticate ==1.3.2.11,
40− auto-update ==0.1.2.1,
41− aws ==0.11,
42− bake ==0.2,
43− bank-holidays-england ==0.1.0.1,
44− barecheck ==0.2.0.6,
45− base16-bytestring ==0.1.1.6,
46− base64-bytestring ==1.0.0.1,
47− base-compat ==0.5.0,
48− base-prelude ==0.1.8,
49− base-unicode-symbols ==0.2.2.4,
50− basic-prelude ==0.3.10,
51− bifunctors ==4.2,
52− binary installed,
53− binary-list ==1.0.1.0,
54− bindings-DSL ==1.0.21,
55− bioace ==0.0.1,
56− bioalign ==0.0.5,
57− biocore ==0.3.1,
58− biofasta ==0.0.3,
59− biofastq ==0.1,
60− biophd ==0.0.5,
61− biopsl ==0.4,
62− biosff ==0.3.7.1,
63− bits ==0.4,
64− BlastHTTP ==1.0.1,
65− blastxml ==0.3.2,
66− blaze-builder ==0.3.3.4,
67− blaze-builder-enumerator ==0.2.0.6,
68− blaze-html ==0.7.0.3,
69− blaze-markup ==0.6.1.1,
70− blaze-svg ==0.3.4,
71− blaze-textual ==0.2.0.9,
72− BlogLiterately ==0.7.1.7,
73− BlogLiterately-diagrams ==0.1.4.3,
74− bloodhound ==0.5.0.1,
75− bmp ==1.2.5.2,
76− Boolean ==0.2.3,
77− bool-extras ==0.4.0,
78− bound ==1.0.4,
79− BoundedChan ==1.0.3.0,
80− bson ==0.3.1,
81− bumper ==0.6.0.2,
82− byteable ==0.1.1,
83− bytedump ==1.0,
84− byteorder ==1.0.4,
85− bytes ==0.14.1.2,
86− bytestring installed,
87− bytestring-builder ==0.10.4.0.1,
88− bytestring-lexing ==0.4.3.2,
89− bytestring-mmap ==0.2.2,
90− bytestring-progress ==1.0.3,
91− bytestring-trie ==0.2.4,
92− bzlib ==0.5.0.4,
93− bzlib-conduit ==0.2.1.3,
94− c2hs ==0.20.1,
95− Cabal installed,
96− cabal-install ==1.18.0.6,
97− cabal-src ==0.2.5,
98− cairo ==0.13.0.5,
99− case-insensitive ==1.2.0.3,
100− cases ==0.1.2,
101− cassava ==0.4.2.1,
102− cautious-file ==1.0.2,
103− cereal ==0.4.1.0,
104− cereal-conduit ==0.7.2.3,
105− certificate ==1.3.9,
106− charset ==0.3.7,
107− Chart ==1.3.2,
108− Chart-diagrams ==1.3.2,
109− ChasingBottoms ==1.3.0.8,
110− check-email ==1.0,
111− checkers ==0.4.1,
112− chell ==0.4,
113− chell-quickcheck ==0.2.4,
114− chunked-data ==0.1.0.1,
115− cipher-aes ==0.2.9,
116− cipher-blowfish ==0.0.3,
117− cipher-camellia ==0.0.2,
118− cipher-des ==0.0.6,
119− cipher-rc4 ==0.1.4,
120− circle-packing ==0.1.0.3,
121− classy-prelude ==0.10.2,
122− classy-prelude-conduit ==0.10.2,
123− classy-prelude-yesod ==0.10.2,
124− clientsession ==0.9.1.1,
125− clock ==0.4.1.3,
126− cmdargs ==0.10.12,
127− code-builder ==0.1.3,
128− colour ==2.3.3,
129− comonad ==4.2.2,
130− comonads-fd ==4.0,
131− comonad-transformers ==4.0,
132− compdata ==0.9,
133− compensated ==0.6.1,
134− composition ==1.0.1.0,
135− compressed ==3.10,
136− concatenative ==1.0.1,
137− concurrent-extra ==0.7.0.9,
138− concurrent-supply ==0.1.7,
139− cond ==0.4.1.1,
140− conduit ==1.2.3.1,
141− conduit-combinators ==0.3.0.5,
142− conduit-extra ==1.1.5.1,
143− configurator ==0.3.0.0,
144− connection ==0.2.3,
145− constraints ==0.4.1.1,
146− containers installed,
147− containers-unicode-symbols ==0.3.1.1,
148− contravariant ==1.2,
149− control-monad-free ==0.5.3,
150− control-monad-loop ==0.1,
151− convertible ==1.1.0.0,
152− cookie ==0.4.1.4,
153− courier ==0.1.0.15,
154− cpphs ==1.18.6,
155− cprng-aes ==0.6.1,
156− cpu ==0.1.2,
157− criterion ==1.0.2.0,
158− crypto-api ==0.13.2,
159− cryptocipher ==0.6.2,
160− crypto-cipher-tests ==0.0.11,
161− crypto-cipher-types ==0.0.9,
162− cryptohash ==0.11.6,
163− cryptohash-conduit ==0.1.1,
164− cryptohash-cryptoapi ==0.1.3,
165− crypto-numbers ==0.2.3,
166− crypto-pubkey ==0.2.6,
167− crypto-pubkey-types ==0.4.2.3,
168− crypto-random ==0.0.8,
169− crypto-random-api ==0.2.0,
170− css-text ==0.1.2.1,
171− csv ==0.1.2,
172− csv-conduit ==0.6.3,
173− curl ==1.3.8,
174− data-accessor ==0.2.2.6,
175− data-accessor-mtl ==0.2.0.4,
176− data-binary-ieee754 ==0.4.4,
177− data-default ==0.5.3,
178− data-default-class ==0.0.1,
179− data-default-instances-base ==0.0.1,
180− data-default-instances-containers ==0.0.1,
181− data-default-instances-dlist ==0.0.1,
182− data-default-instances-old-locale ==0.0.1,
183− data-inttrie ==0.1.0,
184− data-lens-light ==0.1.2.1,
185− data-memocombinators ==0.5.1,
186− data-reify ==0.6,
187− DAV ==1.0.3,
188− deepseq installed,
189− deepseq-generics ==0.1.1.2,
190− derive ==2.5.18,
191− diagrams ==1.2,
192− diagrams-builder ==0.6.0.2,
193− diagrams-cairo ==1.2.0.4,
194− diagrams-contrib ==1.1.2.4,
195− diagrams-core ==1.2.0.4,
196− diagrams-haddock ==0.2.2.12,
197− diagrams-lib ==1.2.0.7,
198− diagrams-postscript ==1.1.0.3,
199− diagrams-svg ==1.1.0.3,
200− Diff ==0.3.0,
201− digest ==0.0.1.2,
202− digestive-functors ==0.7.1.3,
203− dimensional ==0.13.0.1,
204− directory installed,
205− directory-tree ==0.12.0,
206− direct-sqlite ==2.3.14,
207− distributed-process ==0.5.3,
208− distributed-process-async ==0.2.0,
209− distributed-process-client-server ==0.1.1,
210− distributed-process-execution ==0.1.0,
211− distributed-process-extras ==0.1.1,
212− distributed-process-simplelocalnet ==0.2.2.0,
213− distributed-process-supervisor ==0.1.1,
214− distributed-process-task ==0.1.0,
215− distributed-static ==0.3.1.0,
216− distributive ==0.4.4,
217− djinn-ghc ==0.0.2.2,
218− djinn-lib ==0.0.1.2,
219− dlist ==0.7.1,
220− dlist-instances ==0.1,
221− doctest ==0.9.11.1,
222− double-conversion ==2.0.1.0,
223− dual-tree ==0.2.0.5,
224− easy-file ==0.2.0,
225− either ==4.3.2.1,
226− elm-build-lib ==0.14.0.0,
227− elm-compiler ==0.14,
228− elm-core-sources ==1.0.0,
229− elm-package ==0.2.2,
230− email-validate ==2.0.1,
231− enclosed-exceptions ==1.0.1,
232− entropy ==0.3.4.1,
233− enumerator ==0.4.20,
234− eq ==4.0.3,
235− erf ==2.0.0.0,
236− errorcall-eq-instance ==0.1.0,
237− errors ==1.4.7,
238− ersatz ==0.2.6.1,
239− esqueleto ==2.1.2.1,
240− exceptions ==0.6.1,
241− exception-transformers ==0.3.0.4,
242− executable-path ==0.0.3,
243− ex-pool ==0.2,
244− extensible-exceptions ==0.1.1.4,
245− extra ==1.0,
246− failure ==0.2.0.3,
247− fast-logger ==2.2.3,
248− fay ==0.21.2.1,
249− fay-base ==0.19.4.1,
250− fay-builder ==0.2.0.1,
251− fay-dom ==0.5,
252− fay-jquery ==0.6.0.2,
253− fay-text ==0.3.2,
254− fay-uri ==0.2.0.0,
255− fb ==1.0.7,
256− fb-persistent ==0.3.4,
257− fclabels ==2.0.2,
258− FenwickTree ==0.1.1,
259− fgl ==5.5.0.1,
260− file-embed ==0.0.7,
261− file-location ==0.4.5.3,
262− filemanip ==0.3.6.2,
263− filepath installed,
264− fingertree ==0.1.0.0,
265− fixed ==0.2.1,
266− fixed-list ==0.1.5,
267− flexible-defaults ==0.0.1.1,
268− focus ==0.1.3,
269− foldl ==1.0.7,
270− force-layout ==0.3.0.8,
271− foreign-store ==0.1,
272− formatting ==6.0.0,
273− fpco-api ==1.2.0.4,
274− free ==4.10.0.1,
275− freenect ==1.2,
276− frisby ==0.2,
277− fsnotify ==0.1.0.3,
278− fuzzcheck ==0.1.1,
279− gd ==3000.7.3,
280− generic-aeson ==0.2.0.2,
281− generic-deriving ==1.6.3,
282− generics-sop ==0.1.0.4,
283− ghc-heap-view ==0.5.3,
284− ghcid ==0.3.3,
285− ghc-mod ==5.2.1.1,
286− ghc-mtl ==1.2.1.0,
287− ghc-paths ==0.1.0.9,
288− ghc-prim installed,
289− ghc-syb-utils ==0.2.2,
290− gio ==0.13.0.3,
291− git-embed ==0.1.0,
292− gl ==0.6.2,
293− glib ==0.13.0.6,
294− Glob ==0.7.5,
295− GLURaw ==1.4.0.1,
296− GLUT ==2.5.1.1,
297− graph-core ==0.2.1.0,
298− graphs ==0.5.0.1,
299− graphviz ==2999.17.0.1,
300− gravatar ==0.6,
301− groundhog ==0.7.0.1,
302− groundhog-mysql ==0.7.0.1,
303− groundhog-postgresql ==0.7.0.1,
304− groundhog-sqlite ==0.7.0.1,
305− groundhog-th ==0.7.0,
306− groupoids ==4.0,
307− groups ==0.4.0.0,
308− gtk ==0.13.3,
309− gtk2hs-buildtools ==0.13.0.3,
310− haddock-api ==2.15.0.1,
311− haddock-library ==1.1.1,
312− half ==0.2.0.1,
313− HandsomeSoup ==0.3.5,
314− happstack-server ==7.3.9,
315− happy ==1.19.4,
316− hashable ==1.2.3.1,
317− hashable-extras ==0.2.0.1,
318− hashmap ==1.3.0.1,
319− hashtables ==1.2.0.1,
320− haskeline installed,
321− haskell2010 installed,
322− haskell98 installed,
323− haskell-lexer ==1.0,
324− haskell-names ==0.4.1,
325− haskell-packages ==0.2.4.3,
326− haskell-src ==1.0.1.6,
327− haskell-src-exts ==1.16.0.1,
328− haskell-src-meta ==0.6.0.8,
329− hasql ==0.4.1,
330− hasql-backend ==0.2.2,
331− hasql-postgres ==0.9.1,
332− hastache ==0.6.1,
333− HaTeX ==3.16.0.0,
334− HaXml ==1.24.1,
335− haxr ==3000.10.3.1,
336− HCodecs ==0.5,
337− hdaemonize ==0.5.0.0,
338− hdevtools ==0.1.0.6,
339− heaps ==0.3.1,
340− hebrew-time ==0.1.1,
341− heist ==0.14.0.1,
342− here ==1.2.6,
343− heredoc ==0.2.0.0,
344− highlighting-kate ==0.5.11.1,
345− hinotify ==0.3.7,
346− hint ==0.4.2.1,
347− histogram-fill ==0.8.3.0,
348− hit ==0.6.2,
349− hjsmin ==0.1.4.7,
350− hledger ==0.23.3,
351− hledger-lib ==0.23.3,
352− hlibgit2 ==0.18.0.13,
353− hlint ==1.9.13,
354− hmatrix ==0.16.1.2,
355− hmatrix-gsl ==0.16.0.2,
356− holy-project ==0.1.1.1,
357− hoogle ==4.2.36,
358− hoopl installed,
359− hOpenPGP ==1.11,
360− hopenpgp-tools ==0.13,
361− hostname ==1.0,
362− hostname-validate ==1.0.0,
363− hourglass ==0.2.6,
364− hpc installed,
365− hPDB ==1.2.0,
366− hPDB-examples ==1.1.2,
367− hs-bibutils ==5.5,
368− hscolour ==1.20.3,
369− hse-cpp ==0.1,
370− hslogger ==1.2.6,
371− hslua ==0.3.13,
372− hspec ==2.1.2,
373− hspec2 ==0.6.1,
374− hspec-core ==2.1.2,
375− hspec-discover ==2.1.2,
376− hspec-expectations ==0.6.1,
377− hspec-meta ==2.0.0,
378− hspec-wai ==0.6.2,
379− hspec-wai-json ==0.6.0,
380− HStringTemplate ==0.7.3,
381− hsyslog ==2.0,
382− HTF ==0.12.2.3,
383− html ==1.0.1.2,
384− html-conduit ==1.1.1.1,
385− HTTP ==4000.2.19,
386− http-client ==0.4.6.1,
387− http-client-tls ==0.2.2,
388− http-conduit ==2.1.5,
389− http-date ==0.0.4,
390− http-reverse-proxy ==0.4.1.2,
391− http-types ==0.8.5,
392− HUnit ==1.2.5.2,
393− hweblib ==0.6.3,
394− hxt ==9.3.1.10,
395− hxt-charproperties ==9.2.0.0,
396− hxt-http ==9.1.5,
397− hxt-pickle-utils ==0.1.0.2,
398− hxt-regex-xmlschema ==9.2.0,
399− hxt-relaxng ==9.1.5.1,
400− hxt-unicode ==9.0.2.2,
401− hybrid-vectors ==0.1.2,
402− hyphenation ==0.4,
403− idna ==0.3.0,
404− ieee754 ==0.7.4,
405− imagesize-conduit ==1.0.0.4,
406− immortal ==0.2,
407− incremental-parser ==0.2.3.3,
408− indents ==0.3.3,
409− ini ==0.2.2,
410− integer-gmp installed,
411− integration ==0.2.0.1,
412− interpolate ==0.1.0,
413− interpolatedstring-perl6 ==0.9.0,
414− intervals ==0.7.0.1,
415− io-choice ==0.0.5,
416− io-manager ==0.1.0.2,
417− io-memoize ==1.1.1.0,
418− iproute ==1.3.1,
419− iterable ==3.0,
420− ixset ==1.0.6,
421− js-flot ==0.8.3,
422− js-jquery ==1.11.1,
423− json-schema ==0.7.3.0,
424− JuicyPixels ==3.1.7.1,
425− JuicyPixels-repa ==0.7,
426− kan-extensions ==4.1.1,
427− kdt ==0.2.2,
428− keter ==1.3.7.1,
429− keys ==3.10.1,
430− kure ==2.4.10,
431− language-c ==0.4.7,
432− language-ecmascript ==0.16.2,
433− language-glsl ==0.1.1,
434− language-haskell-extract ==0.2.4,
435− language-java ==0.2.7,
436− language-javascript ==0.5.13,
437− lazy-csv ==0.5,
438− lca ==0.2.4,
439− lens ==4.6.0.1,
440− lens-aeson ==1.0.0.3,
441− lens-family-th ==0.4.0.0,
442− lhs2tex ==1.18.1,
443− libgit ==0.3.0,
444− libnotify ==0.1.1.0,
445− lifted-async ==0.2.0.2,
446− lifted-base ==0.2.3.3,
447− linear ==1.15.5,
448− linear-accelerate ==0.2,
449− list-t ==0.3.1,
450− loch-th ==0.2.1,
451− log-domain ==0.9.3,
452− logfloat ==0.12.1,
453− logict ==0.6.0.2,
454− loop ==0.2.0,
455− lucid ==2.5,
456− machines ==0.4.1,
457− mandrill ==0.1.1.0,
458− map-syntax ==0.2,
459− markdown ==0.1.13,
460− markdown-unlit ==0.2.0.1,
461− math-functions ==0.1.5.2,
462− matrix ==0.3.4.0,
463− MaybeT ==0.1.2,
464− MemoTrie ==0.6.2,
465− mersenne-random-pure64 ==0.2.0.4,
466− messagepack ==0.3.0,
467− messagepack-rpc ==0.1.0.3,
468− mime-mail ==0.4.6.2,
469− mime-mail-ses ==0.3.2.1,
470− mime-types ==0.1.0.5,
471− missing-foreign ==0.1.1,
472− MissingH ==1.3.0.1,
473− mmap ==0.5.9,
474− mmorph ==1.0.4,
475− MonadCatchIO-transformers ==0.3.1.3,
476− monad-control ==0.3.3.0,
477− monad-coroutine ==0.8.0.1,
478− monadcryptorandom ==0.6.1,
479− monad-extras ==0.5.9,
480− monadic-arrays ==0.2.1.3,
481− monad-journal ==0.6.0.2,
482− monad-logger ==0.3.11.1,
483− monad-loops ==0.4.2.1,
484− monad-par ==0.3.4.7,
485− monad-parallel ==0.7.1.3,
486− monad-par-extras ==0.3.3,
487− monad-primitive ==0.1,
488− monad-products ==4.0.0.1,
489− MonadPrompt ==1.0.0.5,
490− MonadRandom ==0.3.0.1,
491− monad-st ==0.2.4,
492− monads-tf ==0.1.0.2,
493− mongoDB ==2.0.3,
494− monoid-extras ==0.3.3.5,
495− monoid-subclasses ==0.3.6.2,
496− mono-traversable ==0.7.0,
497− mtl ==2.1.3.1,
498− mtlparse ==0.1.2,
499− mtl-prelude ==1.0.1,
500− multimap ==1.2.1,
501− multipart ==0.1.2,
502− MusicBrainz ==0.2.2,
503− mwc-random ==0.13.2.2,
504− mysql ==0.1.1.7,
505− mysql-simple ==0.2.2.4,
506− nanospec ==0.2.0,
507− nats ==1,
508− neat-interpolation ==0.2.2,
509− nettle ==0.1.0,
510− network ==2.6.0.2,
511− network-conduit-tls ==1.1.0.2,
512− network-info ==0.2.0.5,
513− network-multicast ==0.0.11,
514− network-simple ==0.4.0.2,
515− network-transport ==0.4.1.0,
516− network-transport-tcp ==0.4.1,
517− network-transport-tests ==0.2.1.0,
518− network-uri ==2.6.0.1,
519− newtype ==0.2,
520− nsis ==0.2.4,
521− numbers ==3000.2.0.1,
522− numeric-extras ==0.0.3,
523− NumInstances ==1.4,
524− numtype ==1.1,
525− Octree ==0.5.3,
526− old-locale installed,
527− old-time installed,
528− OneTuple ==0.2.1,
529− opaleye ==0.3,
530− OpenGL ==2.9.2.0,
531− OpenGLRaw ==1.5.0.0,
532− openpgp-asciiarmor ==0.1,
533− operational ==0.2.3.2,
534− options ==1.2.1,
535− optparse-applicative ==0.11.0.1,
536− osdkeys ==0.0,
537− pandoc ==1.13.2,
538− pandoc-citeproc ==0.6,
539− pandoc-types ==1.12.4.1,
540− pango ==0.13.0.4,
541− parallel ==3.2.0.5,
542− parallel-io ==0.3.3,
543− parseargs ==0.1.5.2,
544− parsec ==3.1.7,
545− parsers ==0.12.1.1,
546− partial-handler ==0.1.0,
547− path-pieces ==0.1.5,
548− patience ==0.1.1,
549− pcre-light ==0.4.0.3,
550− pdfinfo ==1.5.1,
551− pem ==0.2.2,
552− persistent ==2.1.1.3,
553− persistent-mongoDB ==2.1.2,
554− persistent-mysql ==2.1.2,
555− persistent-postgresql ==2.1.2,
556− persistent-sqlite ==2.1.1.2,
557− persistent-template ==2.1.0.1,
558− phantom-state ==0.2.0.2,
559− pipes ==4.1.4,
560− pipes-concurrency ==2.0.2,
561− pipes-parse ==3.0.2,
562− placeholders ==0.1,
563− pointed ==4.1.1,
564− polyparse ==1.9,
565− pool-conduit ==0.1.2.3,
566− postgresql-binary ==0.5.0,
567− postgresql-libpq ==0.9.0.1,
568− postgresql-simple ==0.4.8.0,
569− pqueue ==1.2.1,
570− prefix-units ==0.1.0.2,
571− prelude-extras ==0.4,
572− present ==2.2,
573− pretty installed,
574− prettyclass ==1.0.0.0,
575− pretty-class ==1.0.1.1,
576− pretty-show ==1.6.8,
577− primes ==0.2.1.0,
578− primitive ==0.5.4.0,
579− process installed,
580− process-conduit ==1.2.0.1,
581− process-extras ==0.2.0,
582− product-profunctors ==0.6,
583− profunctor-extras ==4.0,
584− profunctors ==4.3.2,
585− project-template ==0.1.4.2,
586− publicsuffixlist ==0.1,
587− punycode ==2.0,
588− pure-io ==0.2.1,
589− pureMD5 ==2.1.2.1,
590− pwstore-fast ==2.4.4,
591− quandl-api ==0.2.0.0,
592− QuasiText ==0.1.2.5,
593− QuickCheck ==2.7.6,
594− quickcheck-assertions ==0.1.1,
595− quickcheck-instances ==0.3.9,
596− quickcheck-io ==0.1.1,
597− quickpull ==0.4.0.0,
598− rainbow ==0.20.0.4,
599− rainbow-tests ==0.20.0.4,
600− random ==1.0.1.1,
601− random-fu ==0.2.6.1,
602− random-shuffle ==0.0.4,
603− random-source ==0.3.0.6,
604− rank1dynamic ==0.2.0.1,
605− raw-strings-qq ==1.0.2,
606− ReadArgs ==1.2.2,
607− reducers ==3.10.3,
608− reflection ==1.5.1,
609− regex-applicative ==0.3.0.3,
610− regex-base ==0.93.2,
611− regex-compat ==0.95.1,
612− regex-pcre-builtin ==0.94.4.8.8.35,
613− regex-posix ==0.95.2,
614− regexpr ==0.5.4,
615− regex-tdfa ==1.2.0,
616− regex-tdfa-rc ==1.1.8.3,
617− regular ==0.3.4.3,
618− regular-xmlpickler ==0.2,
619− rematch ==0.2.0.0,
620− repa ==3.3.1.2,
621− repa-algorithms ==3.3.1.2,
622− repa-devil ==0.3.2.2,
623− repa-io ==3.3.1.2,
624− reroute ==0.2.2.1,
625− resource-pool ==0.2.3.2,
626− resourcet ==1.1.3.3,
627− rest-client ==0.4.0.2,
628− rest-core ==0.33.1.2,
629− rest-gen ==0.16.1.3,
630− rest-happstack ==0.2.10.3,
631− rest-snap ==0.1.17.14,
632− rest-stringmap ==0.2.0.2,
633− rest-types ==1.11.1.1,
634− rest-wai ==0.1.0.4,
635− rev-state ==0.1,
636− rfc5051 ==0.1.0.3,
637− runmemo ==1.0.0.1,
638− rvar ==0.2.0.2,
639− safe ==0.3.8,
640− safecopy ==0.8.3,
641− scientific ==0.3.3.3,
642− scotty ==0.9.0,
643− scrobble ==0.2.1.1,
644− securemem ==0.1.4,
645− semigroupoid-extras ==4.0,
646− semigroupoids ==4.2,
647− semigroups ==0.16.0.1,
648− sendfile ==0.7.9,
649− seqloc ==0.6,
650− setenv ==0.1.1.2,
651− SHA ==1.6.4.1,
652− shake ==0.14.2,
653− shake-language-c ==0.6.3,
654− shakespeare ==2.0.2.1,
655− shakespeare-i18n ==1.1.0,
656− shakespeare-text ==1.1.0,
657− shell-conduit ==4.5,
658− shelly ==1.5.6,
659− silently ==1.2.4.1,
660− simple-reflect ==0.3.2,
661− simple-sendfile ==0.2.18,
662− singletons ==1.0,
663− siphash ==1.0.3,
664− skein ==1.0.9.2,
665− slave-thread ==0.1.5,
666− smallcheck ==1.1.1,
667− smtLib ==1.0.7,
668− snap ==0.13.3.2,
669− snap-core ==0.9.6.4,
670− snaplet-fay ==0.3.3.8,
671− snap-server ==0.9.4.6,
672− socks ==0.5.4,
673− sodium ==0.11.0.2,
674− sourcemap ==0.1.3.0,
675− speculation ==1.5.0.1,
676− sphinx ==0.6.0.1,
677− split ==0.2.2,
678− Spock ==0.7.5.1,
679− spoon ==0.3.1,
680− sqlite-simple ==0.4.8.0,
681− stateref ==0.3,
682− statestack ==0.2.0.3,
683− statistics ==0.13.2.1,
684− statistics-linreg ==0.3,
685− stm ==2.4.4,
686− stm-chans ==3.0.0.2,
687− stm-conduit ==2.5.2,
688− stm-containers ==0.2.7,
689− stm-stats ==0.2.0.0,
690− storable-complex ==0.2.1,
691− storable-endian ==0.2.5,
692− streaming-commons ==0.1.8,
693− streams ==3.2,
694− strict ==0.3.2,
695− stringable ==0.1.3,
696− stringbuilder ==0.5.0,
697− stringprep ==1.0.0,
698− stringsearch ==0.3.6.5,
699− stylish-haskell ==0.5.11.0,
700− SVGFonts ==1.4.0.3,
701− syb ==0.4.2,
702− syb-with-class ==0.6.1.5,
703− system-canonicalpath ==0.2.0.0,
704− system-fileio ==0.3.16,
705− system-filepath ==0.4.13,
706− system-posix-redirect ==1.1.0.1,
707− tabular ==0.2.2.5,
708− tagged ==0.7.3,
709− tagshare ==0.0,
710− tagsoup ==0.13.3,
711− tagstream-conduit ==0.5.5.3,
712− tar ==0.4.0.1,
713− tardis ==0.3.0.0,
714− tasty ==0.10.1,
715− tasty-ant-xml ==1.0.1,
716− tasty-golden ==2.2.2.4,
717− tasty-hunit ==0.9.0.1,
718− tasty-quickcheck ==0.8.3.2,
719− tasty-smallcheck ==0.8.0.1,
720− tasty-th ==0.1.3,
721− template-haskell installed,
722− temporary ==1.2.0.3,
723− temporary-rc ==1.2.0.3,
724− terminal-progress-bar ==0.0.1.4,
725− terminal-size ==0.3.0,
726− terminfo installed,
727− test-framework ==0.8.1.0,
728− test-framework-hunit ==0.3.0.1,
729− test-framework-quickcheck2 ==0.3.0.3,
730− test-framework-th ==0.2.4,
731− testing-feat ==0.4.0.2,
732− testpack ==2.1.3.0,
733− texmath ==0.8.0.1,
734− text ==1.1.1.3,
735− text-binary ==0.1.0,
736− text-format ==0.3.1.1,
737− text-icu ==0.7.0.0,
738− tf-random ==0.5,
739− th-desugar ==1.4.2,
740− th-expand-syns ==0.3.0.4,
741− th-extras ==0.0.0.2,
742− th-lift ==0.7,
743− th-orphans ==0.8.2,
744− threads ==0.5.1.2,
745− th-reify-many ==0.1.2,
746− thyme ==0.3.5.5,
747− time installed,
748− time-compat ==0.1.0.3,
749− time-lens ==0.4.0.1,
750− timezone-olson ==0.1.6,
751− timezone-series ==0.1.4,
752− tls ==1.2.13,
753− tls-debug ==0.3.4,
754− tostring ==0.2.1,
755− transformers installed,
756− transformers-base ==0.4.3,
757− transformers-compat ==0.3.3.3,
758− traverse-with-class ==0.2.0.3,
759− tree-view ==0.4,
760− tuple ==0.3.0.2,
761− type-eq ==0.4.2,
762− type-list ==0.0.0.0,
763− udbus ==0.2.1,
764− unbounded-delays ==0.1.0.8,
765− union-find ==0.2,
766− uniplate ==1.6.12,
767− unix installed,
768− unix-compat ==0.4.1.3,
769− unix-time ==0.3.4,
770− unordered-containers ==0.2.5.1,
771− uri-encode ==1.5.0.3,
772− url ==2.1.3,
773− utf8-light ==0.4.2,
774− utf8-string ==0.3.8,
775− uuid ==1.3.7,
776− vault ==0.3.0.4,
777− vector ==0.10.12.2,
778− vector-algorithms ==0.6.0.3,
779− vector-binary-instances ==0.2.1.0,
780− vector-instances ==3.3,
781− vector-space ==0.8.7,
782− vector-space-points ==0.2,
783− vector-th-unbox ==0.2.1.0,
784− vhd ==0.2.2,
785− void ==0.7,
786− wai ==3.0.2.1,
787− wai-app-static ==3.0.0.5,
788− wai-conduit ==3.0.0.2,
789− wai-eventsource ==3.0.0,
790− wai-extra ==3.0.3.1,
791− wai-logger ==2.2.3,
792− wai-middleware-static ==0.6.0.1,
793− wai-websockets ==3.0.0.3,
794− warp ==3.0.4.1,
795− warp-tls ==3.0.1.1,
796− webdriver ==0.6.0.3,
797− web-fpco ==0.1.1.0,
798− websockets ==0.9.2.1,
799− wizards ==1.0.1,
800− wl-pprint ==1.1,
801− wl-pprint-extras ==3.5.0.3,
802− wl-pprint-terminfo ==3.7.1.3,
803− wl-pprint-text ==1.1.0.2,
804− word8 ==0.1.1,
805− X11 ==1.6.1.2,
806− x509 ==1.5.0.1,
807− x509-store ==1.5.0,
808− x509-system ==1.5.0,
809− x509-validation ==1.5.1,
810− xenstore ==0.1.1,
811− xhtml installed,
812− xml ==1.3.13,
813− xml-conduit ==1.2.3.1,
814− xmlgen ==0.6.2.1,
815− xml-hamlet ==0.4.0.9,
816− xmlhtml ==0.2.3.3,
817− xml-types ==0.3.4,
818− xss-sanitize ==0.3.5.4,
819− yackage ==0.7.0.6,
820− yaml ==0.8.10.1,
821− Yampa ==0.9.6,
822− YampaSynth ==0.2,
823− yesod ==1.4.1.3,
824− yesod-auth ==1.4.1.1,
825− yesod-auth-deskcom ==1.4.0,
826− yesod-auth-fb ==1.6.6,
827− yesod-auth-hashdb ==1.4.1.1,
828− yesod-bin ==1.4.3.1,
829− yesod-core ==1.4.7.1,
830− yesod-eventsource ==1.4.0.1,
831− yesod-fay ==0.7.0,
832− yesod-fb ==0.3.4,
833− yesod-form ==1.4.3.1,
834− yesod-gitrepo ==0.1.1.0,
835− yesod-newsfeed ==1.4.0.1,
836− yesod-persistent ==1.4.0.2,
837− yesod-sitemap ==1.4.0.1,
838− yesod-static ==1.4.0.4,
839− yesod-test ==1.4.2.1,
840− yesod-text-markdown ==0.1.7,
841− yesod-websockets ==0.2.1.1,
842− zeromq4-haskell ==0.6.2,
843− zip-archive ==0.2.3.5,
844− zlib ==0.5.4.2,
845− zlib-bindings ==0.1.1.5,
846− zlib-enum ==0.2.3.1,
847− zlib-lens ==0.1
debian-bootstrap.sh+22−1
@@ -12,11 +12,15 @@
1212
1313add-apt-repository -y ppa:chris-lea/zeromq
1414add-apt-repository -y ppa:floe/libtisch
15+add-apt-repository -y ppa:zoogie/sdl2-snapshots
1516apt-get update
1617apt-get install -y \
1718 build-essential \
1819 libncurses-dev \
1920 git \
21+ wget \
22+ m4 \
23+ texlive-full \
2024 libgmp3c2 \
2125 libgmp3-dev \
2226 zlib1g-dev \
@@ -33,11 +37,11 @@ apt-get install -y \
3337 llvm \
3438 libbz2-dev \
3539 libjudy-dev \
40+ libsqlite3-dev \
3641 libmysqlclient-dev \
3742 libpq-dev \
3843 libicu-dev \
3944 libssl-dev \
40− nettle-dev \
4145 libgsl0-dev \
4246 libblas-dev \
4347 liblapack-dev \
@@ -47,4 +51,21 @@ apt-get install -y \
4751 libgd2-xpm-dev \
4852 libyaml-dev \
4953 liblzma-dev \
54+ libsdl2-dev \
55+ libxss-dev \
5056 libzmq3-dev
57+
58+mkdir /tmp/nettle-build
59+(
60+cd /tmp/nettle-build
61+wget https://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz
62+tar zxf nettle-2.7.1.tar.gz
63+cd nettle-2.7.1
64+./configure --prefix=/usr
65+make
66+make install
67+
68+mkdir -p /usr/lib/x86_64-linux-gnu/
69+ln -sfv /usr/lib/libnettle.so.4.7 /usr/lib/x86_64-linux-gnu/libnettle.so.4
70+)
71+rm -rf /tmp/nettle-build
stackage.cabaldeleted−97
@@ -1,97 +0,0 @@
1−name: stackage
2−version: 0.5.2
3−synopsis: "Stable Hackage," tools for creating a vetted set of packages from Hackage.
4−description: Please see <http://www.stackage.org/package/stackage> for a description and documentation.
5−homepage: https://github.com/fpco/stackage
6−license: MIT
7−license-file: LICENSE
8−author: Michael Snoyman
9−maintainer: michael@fpcomplete.com
10−category: Distribution
11−build-type: Simple
12−cabal-version: >=1.10
13−extra-source-files: README.md
14− ChangeLog.md
15− test/test-build-constraints.yaml
16−
17−library
18− default-language: Haskell2010
19− exposed-modules: Stackage.Prelude
20− Stackage.BuildConstraints
21− Stackage.CorePackages
22− Stackage.PackageIndex
23− Stackage.BuildPlan
24− Stackage.CheckBuildPlan
25− Stackage.UpdateBuildPlan
26− Stackage.GithubPings
27− Stackage.PackageDescription
28− Stackage.ServerBundle
29− Stackage.Upload
30− Stackage.PerformBuild
31− Stackage.CompleteBuild
32− build-depends: base >= 4 && < 5
33− , containers
34− , Cabal >= 1.14
35− , tar >= 0.3
36− , zlib
37− , bytestring
38− , directory
39− , filepath
40− , transformers
41− , process
42− , old-locale
43− , time
44− , utf8-string
45−
46− , conduit-extra
47− , classy-prelude-conduit
48− , text
49− , system-fileio
50− , system-filepath
51− , mtl
52− , aeson
53− , yaml
54− , unix-compat
55− , http-client
56− , http-client-tls
57− , temporary
58− , data-default-class
59− , stm
60− , mono-traversable
61− , async
62− , streaming-commons >= 0.1.7.1
63− , semigroups
64− , xml-conduit
65−
66−executable stackage
67− default-language: Haskell2010
68− hs-source-dirs: app
69− main-is: stackage.hs
70− build-depends: base
71− , stackage
72− , optparse-applicative >= 0.11
73− ghc-options: -rtsopts -threaded -with-rtsopts=-N
74−
75−test-suite spec
76− type: exitcode-stdio-1.0
77− default-language: Haskell2010
78− hs-source-dirs: test
79− main-is: Spec.hs
80− other-modules: Stackage.CorePackagesSpec
81− Stackage.PackageIndexSpec
82− Stackage.BuildPlanSpec
83− build-depends: base
84− , stackage
85− , hspec
86− , QuickCheck
87− , text
88− , classy-prelude-conduit
89− , Cabal
90− , yaml
91− , containers
92− , http-client
93− , http-client-tls
94−
95−source-repository head
96− type: git
97− location: https://github.com/fpco/stackage
test/Spec.hsdeleted−1
@@ -1 +0,0 @@
1−{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
test/Stackage/BuildPlanSpec.hsdeleted−143
@@ -1,143 +0,0 @@
1−{-# LANGUAGE ScopedTypeVariables #-}
2−{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-}
3−module Stackage.BuildPlanSpec (spec) where
4−
5−import qualified Data.Map as Map
6−import qualified Data.Map.Strict as M
7−import qualified Data.Set as S
8−import Data.Yaml
9−import qualified Data.Yaml as Y
10−import Distribution.Version
11−import Network.HTTP.Client
12−import Network.HTTP.Client.TLS (tlsManagerSettings)
13−import Stackage.BuildConstraints
14−import Stackage.BuildPlan
15−import Stackage.CheckBuildPlan
16−import Stackage.PackageDescription
17−import Stackage.Prelude
18−import Stackage.UpdateBuildPlan
19−import Test.Hspec
20−
21−spec :: Spec
22−spec = do
23− it "simple package set" $ check testBuildConstraints $ makePackageSet
24− [("foo", [0, 0, 0], [("bar", thisV [0, 0, 0])])
25− ,("bar", [0, 0, 0], [])]
26− it "bad version range on depdendency fails" $ badBuildPlan $ makePackageSet
27− [("foo", [0, 0, 0], [("bar", thisV [1, 1, 0])])
28− ,("bar", [0, 0, 0], [])]
29− it "nonexistent package fails to check" $ badBuildPlan $ makePackageSet
30− [("foo", [0, 0, 0], [("nonexistent", thisV [0, 0, 0])])
31− ,("bar", [0, 0, 0], [])]
32− it "mutual cycles fail to check" $ badBuildPlan $ makePackageSet
33− [("foo", [0, 0, 0], [("bar", thisV [0, 0, 0])])
34− ,("bar", [0, 0, 0], [("foo", thisV [0, 0, 0])])]
35− it "nested cycles fail to check" $ badBuildPlan $ makePackageSet
36− [("foo", [0, 0, 0], [("bar", thisV [0, 0, 0])])
37− ,("bar", [0, 0, 0], [("mu", thisV [0, 0, 0])])
38− ,("mu", [0, 0, 0], [("foo", thisV [0, 0, 0])])]
39− {- Shouldn't be testing this actually
40− it "default package set checks ok" $
41− check defaultBuildConstraints getLatestAllowedPlans
42− -}
43−
44−-- | Checking should be considered a bad build plan.
45−badBuildPlan :: (BuildConstraints -> IO (Map PackageName PackagePlan))
46− -> void
47− -> IO ()
48−badBuildPlan m _ = do
49− mu <- try (check testBuildConstraints m)
50− case mu of
51− Left (_ :: BadBuildPlan) ->
52− return ()
53− Right () ->
54− error "Expected bad build plan."
55−
56−-- | Check build plan with the given package set getter.
57−check :: (Manager -> IO BuildConstraints)
58− -> (BuildConstraints -> IO (Map PackageName PackagePlan))
59− -> IO ()
60−check readPlanFile getPlans = withManager tlsManagerSettings $ \man -> do
61− bc <- readPlanFile man
62− plans <- getPlans bc
63− bp <- newBuildPlan plans bc
64− let bs = Y.encode bp
65− ebp' = Y.decodeEither bs
66−
67− bp' <- either error return ebp'
68−
69− let allPackages = Map.keysSet (bpPackages bp) ++ Map.keysSet (bpPackages bp')
70− forM_ allPackages $ \name ->
71− (name, lookup name (bpPackages bp')) `shouldBe`
72− (name, lookup name (bpPackages bp))
73− bpGithubUsers bp' `shouldBe` bpGithubUsers bp
74−
75− when (bp' /= bp) $ error "bp' /= bp"
76− bp2 <- updateBuildPlan plans bp
77− when (dropVersionRanges bp2 /= dropVersionRanges bp) $ error "bp2 /= bp"
78− checkBuildPlan bp
79− where
80− dropVersionRanges bp =
81− bp { bpPackages = map go $ bpPackages bp }
82− where
83− go pb = pb { ppConstraints = go' $ ppConstraints pb }
84− go' pc = pc { pcVersionRange = anyVersion }
85−
86−-- | Make a package set from a convenient data structure.
87−makePackageSet
88− :: [(String,[Int],[(String,VersionRange)])]
89− -> BuildConstraints
90− -> IO (Map PackageName PackagePlan)
91−makePackageSet ps _ =
92− return $
93− M.fromList $
94− map
95− (\(name,ver,deps) ->
96− ( PackageName name
97− , dummyPackage ver $
98− M.fromList $
99− map
100− (\(dname,dver) ->
101− ( PackageName dname
102− , DepInfo {diComponents = S.fromList
103− [CompLibrary]
104− ,diRange = dver}))
105− deps))
106− ps
107− where
108− dummyPackage v deps =
109− PackagePlan
110− {ppVersion = Version v []
111− ,ppGithubPings = mempty
112− ,ppUsers = mempty
113− ,ppConstraints =
114− PackageConstraints
115− {pcVersionRange = anyV
116− ,pcMaintainer = Nothing
117− ,pcTests = Don'tBuild
118− ,pcHaddocks = Don'tBuild
119− ,pcBuildBenchmarks = False
120− ,pcFlagOverrides = mempty
121− ,pcEnableLibProfile = False}
122− ,ppDesc =
123− SimpleDesc
124− {sdPackages = deps
125− ,sdTools = mempty
126− ,sdProvidedExes = mempty
127− ,sdModules = mempty}}
128−
129−-- | This exact version is required.
130−thisV :: [Int] -> VersionRange
131−thisV ver = thisVersion (Version ver [])
132−
133−-- | Accept any version.
134−anyV :: VersionRange
135−anyV = anyVersion
136−
137−-- | Test plan.
138−testBuildConstraints :: void -> IO BuildConstraints
139−testBuildConstraints _ =
140− decodeFileEither
141− (fpToString fp) >>=
142− either throwIO toBC
143− where fp = "test/test-build-constraints.yaml"
test/Stackage/CorePackagesSpec.hsdeleted−19
@@ -1,19 +0,0 @@
1−{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-}
2−module Stackage.CorePackagesSpec (spec) where
3−
4−import Stackage.CorePackages
5−import Stackage.Prelude
6−import Test.Hspec
7−
8−spec :: Spec
9−spec = do
10− it "works" $ void getCorePackages
11− it "contains known core packages" $ do
12− m <- getCorePackages
13− forM_ (words "ghc containers base") $ \p ->
14− m `shouldSatisfy` (member (PackageName p))
15− it "getCoreExecutables includes known executables" $ do
16− s <- getCoreExecutables
17− s `shouldSatisfy` member "ghc"
18− s `shouldSatisfy` member "hsc2hs"
19− s `shouldSatisfy` member "runghc"
test/Stackage/PackageIndexSpec.hsdeleted−21
@@ -1,21 +0,0 @@
1−{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-}
2−module Stackage.PackageIndexSpec (spec) where
3−
4−import Stackage.PackageIndex
5−import Stackage.Prelude
6−import Test.Hspec
7−import Distribution.Package (packageId)
8−
9−spec :: Spec
10−spec = do
11− it "works" $ (runResourceT $ sourcePackageIndex $$ sinkNull :: IO ())
12− it "getLatestDescriptions gives reasonable results" $ do
13− let f x y = (display x, display y) `member` asSet (setFromList
14− [ (asText "base", asText "4.5.0.0")
15− , ("does-not-exist", "9999999999999999999")
16− ])
17− m <- getLatestDescriptions f return
18− length m `shouldBe` 1
19− p <- simpleParse $ asText "base"
20− v <- simpleParse $ asText "4.5.0.0"
21− (pkgVersion . packageId <$> m) `shouldBe` singletonMap p v
test/test-build-constraints.yamldeleted−20
@@ -1,20 +0,0 @@
1−packages:
2− "Test":
3− - foo
4− - bar
5−
6−global-flags: []
7−
8−skipped-tests: []
9−expected-test-failures: []
10−expected-haddock-failures: []
11−skipped-benchmarks: []
12−skipped-profiling: []
13−
14−github-users:
15− bar:
16− - demo
17−
18−package-flags:
19− foo:
20− demo: true