Skip to content

Commit

Permalink
Build with ghc-8.6.1 using Stackage nightly. (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
judah authored and blackgnezdo committed Oct 3, 2018
1 parent c480b8e commit 7cdf119
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ matrix:
addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack STACK='stack' # Use the resolver in stack.yaml
addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack STACK='stack --stack-yaml=stack-ghc-8.6.yaml'
addons: {apt: {packages: [libgmp-dev]}}

before_install:
- mkdir -p $HOME/.local/bin
Expand Down
2 changes: 1 addition & 1 deletion discrimination-ieee754/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license: BSD3
github: google/proto-lens/discrimination-ieee754

dependencies:
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- data-binary-ieee754 >= 0.4 && < 0.5
- contravariant >= 1.3 && < 1.5
- discrimination >= 0.3 && < 0.4
Expand Down
2 changes: 1 addition & 1 deletion lens-labels/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ library:
- Lens.Labels.Unwrapped
- Lens.Labels.Prism
dependencies:
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- ghc-prim >= 0.4 && < 0.6
- profunctors >= 5.2
- tagged >= 0.8
4 changes: 2 additions & 2 deletions proto-lens-arbitrary/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ extra-source-files:

dependencies:
- proto-lens == 0.4.*
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- bytestring == 0.10.*
- containers == 0.5.*
- containers >= 0.5 && < 0.7
- text == 1.2.*
- lens-family == 1.2.*
- QuickCheck >= 2.8 && < 2.12
Expand Down
4 changes: 2 additions & 2 deletions proto-lens-combinators/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ extra-source-files:

custom-setup:
dependencies:
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- Cabal
- proto-lens-setup == 0.4.*

dependencies:
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- lens-family == 1.2.*

library:
Expand Down
4 changes: 2 additions & 2 deletions proto-lens-discrimination/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ extra-source-files:

custom-setup:
dependencies:
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- Cabal
- proto-lens-setup >= 0.4 && < 0.5

dependencies:
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- bytestring == 0.10.*
- contravariant >= 1.3 && < 1.5
- containers >= 0.5 && < 0.6
Expand Down
2 changes: 1 addition & 1 deletion proto-lens-optparse/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extra-source-files:

dependencies:
- proto-lens >= 0.1 && < 0.5
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- optparse-applicative >= 0.12 && < 0.15
- text == 1.2.*

Expand Down
4 changes: 2 additions & 2 deletions proto-lens-protobuf-types/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ extra-source-files:

custom-setup:
dependencies:
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- Cabal
- proto-lens-setup == 0.4.*

dependencies:
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- lens-labels == 0.3.*
- proto-lens == 0.4.*
- proto-lens-runtime == 0.4.*
Expand Down
4 changes: 2 additions & 2 deletions proto-lens-protoc/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ extra-source-files:
- Changelog.md

dependencies:
- base >= 4.9 && < 4.12
- containers == 0.5.*
- base >= 4.9 && < 4.13
- containers >= 0.5 && < 0.7
- lens-family == 1.2.*
- proto-lens == 0.4.*
- text == 1.2.*
Expand Down
4 changes: 2 additions & 2 deletions proto-lens-runtime/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ extra-source-files:

library:
dependencies:
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- bytestring == 0.10.*
- containers == 0.5.*
- containers >= 0.5 && < 0.7
- deepseq == 1.4.*
- filepath >= 1.4 && < 1.6
- lens-family == 1.2.*
Expand Down
6 changes: 3 additions & 3 deletions proto-lens-setup/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ extra-source-files:
library:
source-dirs: src
dependencies:
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- bytestring == 0.10.*
- containers == 0.5.*
- Cabal >= 1.22 && < 2.3
- containers >= 0.5 && < 0.7
- Cabal >= 1.22 && < 2.5
- deepseq == 1.4.*
- directory >= 1.2 && < 1.4
- filepath >= 1.4 && < 1.6
Expand Down
25 changes: 23 additions & 2 deletions proto-lens-setup/src/Data/ProtoLens/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ import Distribution.PackageDescription
, extraSrcFiles
#if !MIN_VERSION_Cabal(2,0,0)
, hsSourceDirs
#endif
#if MIN_VERSION_Cabal(2,4,0)
, specVersion
#endif
, libBuildInfo
, otherModules
Expand All @@ -68,14 +71,25 @@ import Distribution.Simple.Setup (fromFlag, copyDest, copyVerbosity)
import Distribution.Simple.Utils
( createDirectoryIfMissingVerbose
, installOrdinaryFile
#if MIN_VERSION_Cabal(2,4,0)
#else
, matchFileGlob
#endif
)
#if MIN_VERSION_Cabal(2,4,0)
import Distribution.Simple.Glob (matchDirFileGlob)
#endif
import Distribution.Simple
( defaultMainWithHooks
, simpleUserHooks
, UserHooks(..)
)
import Distribution.Verbosity (Verbosity)
import Distribution.Verbosity
( Verbosity
#if MIN_VERSION_Cabal(2,4,0)
, normal
#endif
)
import System.FilePath
( (</>)
, equalFilePath
Expand Down Expand Up @@ -158,13 +172,20 @@ generatingProtos root = generatingSpecificProtos root getProtos
where
getProtos l = do
-- Replicate Cabal's own logic for parsing file globs.
files <- concat <$> mapM matchFileGlob (extraSrcFiles $ localPkgDescr l)
files <- concat <$> mapM (match $ localPkgDescr l)
(extraSrcFiles $ localPkgDescr l)
pure
. filter (\f -> takeExtension f == ".proto")
. map (makeRelative root)
. filter (isSubdirectoryOf root)
$ files

match :: PackageDescription -> FilePath -> IO [FilePath]
#if MIN_VERSION_Cabal(2,4,0)
match desc f = matchDirFileGlob normal (specVersion desc) "." f
#else
match _ f = matchFileGlob f
#endif

-- | Augment the given 'UserHooks' to auto-generate Haskell files from the
-- .proto files returned by a function @getProtos@.
Expand Down
7 changes: 5 additions & 2 deletions proto-lens-tests/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ author: Judah Jacobson
maintainer: [email protected]
copyright: Google Inc.
license: BSD3
extra-source-files:
- tests/*.proto
# Use extra-source-files verbatim since hpack otherwise expands the glob
# to an explicit list in the Cabal file.
# We want to test that globs within Cabal files are supported.
verbatim:
extra-source-files: tests/*.proto

custom-setup:
dependencies:
Expand Down
1 change: 1 addition & 0 deletions proto-lens-tutorial/stack-ghc-8.6.yaml
4 changes: 2 additions & 2 deletions proto-lens/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ library:
- Data.ProtoLens.TextFormat.Parser
dependencies:
- attoparsec == 0.13.*
- base >= 4.9 && < 4.12
- base >= 4.9 && < 4.13
- bytestring == 0.10.*
- containers == 0.5.*
- containers >= 0.5 && < 0.7
- deepseq == 1.4.*
- lens-family == 1.2.*
- lens-labels == 0.3.*
Expand Down
21 changes: 21 additions & 0 deletions stack-ghc-8.6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resolver: nightly-2018-09-29
packages:
# - discrimination-ieee754
- lens-labels
- proto-lens
- proto-lens-arbitrary
# Criterion doesn't build with nightly yet:
# - proto-lens-benchmarks
- proto-lens-combinators
# - proto-lens-discrimination
- proto-lens-optparse
- proto-lens-protobuf-types
- proto-lens-protoc
- proto-lens-runtime
- proto-lens-setup
- proto-lens-tests
- proto-lens-tests-dep
extra-deps:
# These don't build with nightly yet:
# - discrimination-0.3
# - promises-0.3

0 comments on commit 7cdf119

Please sign in to comment.