diff --git a/.travis.yml b/.travis.yml index a5fe27cf..461daaf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ # This Travis job script has been generated by a script via # -# runghc make_travis_yml_2.hs '--config=cabal.make-travis-yml' '--output=.travis.yml' '--max-backjumps=10000' 'cabal.project' +# runghc make_travis_yml_2.hs '--config=cabal.make-travis-yml' '--output=.travis.yml' 'cabal.project' # # For more information, see https://github.com/hvr/multi-ghc-travis # @@ -33,18 +33,21 @@ before_cache: matrix: include: - - compiler: "ghc-7.8.4" + - compiler: "ghc-8.4.2" # env: TEST=--disable-tests BENCH=--disable-benchmarks - addons: {apt: {packages: [ghc-ppa-tools,ghc-7.8.4,xz-utils], sources: [hvr-ghc]}} - - compiler: "ghc-7.10.3" - # env: TEST=--disable-tests BENCH=--disable-benchmarks - addons: {apt: {packages: [ghc-ppa-tools,ghc-7.10.3,xz-utils], sources: [hvr-ghc]}} - - compiler: "ghc-8.0.2" - # env: TEST=--disable-tests BENCH=--disable-benchmarks - addons: {apt: {packages: [ghc-ppa-tools,ghc-8.0.2,xz-utils], sources: [hvr-ghc]}} + addons: {apt: {packages: [ghc-ppa-tools,ghc-8.4.2], sources: [hvr-ghc]}} - compiler: "ghc-8.2.2" # env: TEST=--disable-tests BENCH=--disable-benchmarks - addons: {apt: {packages: [ghc-ppa-tools,ghc-8.2.2,xz-utils], sources: [hvr-ghc]}} + addons: {apt: {packages: [ghc-ppa-tools,ghc-8.2.2], sources: [hvr-ghc]}} + - compiler: "ghc-8.0.2" + # env: TEST=--disable-tests BENCH=--disable-benchmarks + addons: {apt: {packages: [ghc-ppa-tools,ghc-8.0.2], sources: [hvr-ghc]}} + - compiler: "ghc-7.10.3" + # env: TEST=--disable-tests BENCH=--disable-benchmarks + addons: {apt: {packages: [ghc-ppa-tools,ghc-7.10.3], sources: [hvr-ghc]}} + - compiler: "ghc-7.8.4" + # env: TEST=--disable-tests BENCH=--disable-benchmarks + addons: {apt: {packages: [ghc-ppa-tools,ghc-7.8.4], sources: [hvr-ghc]}} before_install: - HC=${CC} @@ -75,15 +78,14 @@ install: - HADDOCK=${HADDOCK-true} - INSTALLED=${INSTALLED-true} - GHCHEAD=${GHCHEAD-false} - - CABALNEWBUILDOPTS=--max-backjumps=10000 - travis_retry cabal update -v - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config" - rm -fv cabal.project cabal.project.local - "if [ $HCNUMVER -ge 70800 ]; then sed -i.bak 's/-- ghc-options:.*/ghc-options: -j2/' ${HOME}/.cabal/config; fi" - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$' - - "printf 'packages: \"servant\" \"servant-client\" \"servant-client-core\" \"servant-docs\" \"servant-foreign\" \"servant-server\" \"doc/tutorial\" \"doc/cookbook/db-postgres-pool\" \"doc/cookbook/jwt-and-basic-auth\" \"doc/cookbook/db-sqlite-simple\" \"doc/cookbook/basic-auth\" \"doc/cookbook/https\" \"doc/cookbook/structuring-apis\" \"doc/cookbook/using-custom-monad\" \"doc/cookbook/file-upload\"\\n' > cabal.project" + - "printf 'packages: \"servant\" \"servant-client\" \"servant-client-core\" \"servant-docs\" \"servant-foreign\" \"servant-server\" \"doc/tutorial\" \"doc/cookbook/basic-auth\" \"doc/cookbook/db-postgres-pool\" \"doc/cookbook/db-sqlite-simple\" \"doc/cookbook/file-upload\" \"doc/cookbook/https\" \"doc/cookbook/pagination\" \"doc/cookbook/structuring-apis\" \"doc/cookbook/using-custom-monad\"\\n' > cabal.project" - "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project" - - "echo 'allow-newer: servant-js:servant,servant-js:servant-foreign,servant-auth-server:http-types,servant-multipart:lens,servant-multipart:resourcet,servant-multipart:servant,servant-multipart:servant-server,servant-auth-server:servant-server' >> cabal.project" + - "echo 'allow-newer: servant-js:servant,servant-js:servant-foreign,servant-auth-server:http-types,servant-multipart:lens,servant-multipart:resourcet,servant-multipart:servant,servant-multipart:servant-server,servant-auth-server:servant-server, http-media:base' >> cabal.project" - cat cabal.project - if [ -f "servant/configure.ac" ]; then (cd "servant" && autoreconf -i); @@ -106,32 +108,32 @@ install: - if [ -f "doc/tutorial/configure.ac" ]; then (cd "doc/tutorial" && autoreconf -i); fi + - if [ -f "doc/cookbook/basic-auth/configure.ac" ]; then + (cd "doc/cookbook/basic-auth" && autoreconf -i); + fi - if [ -f "doc/cookbook/db-postgres-pool/configure.ac" ]; then (cd "doc/cookbook/db-postgres-pool" && autoreconf -i); fi - - if [ -f "doc/cookbook/jwt-and-basic-auth/configure.ac" ]; then - (cd "doc/cookbook/jwt-and-basic-auth" && autoreconf -i); - fi - if [ -f "doc/cookbook/db-sqlite-simple/configure.ac" ]; then (cd "doc/cookbook/db-sqlite-simple" && autoreconf -i); fi - - if [ -f "doc/cookbook/basic-auth/configure.ac" ]; then - (cd "doc/cookbook/basic-auth" && autoreconf -i); + - if [ -f "doc/cookbook/file-upload/configure.ac" ]; then + (cd "doc/cookbook/file-upload" && autoreconf -i); fi - if [ -f "doc/cookbook/https/configure.ac" ]; then (cd "doc/cookbook/https" && autoreconf -i); fi + - if [ -f "doc/cookbook/pagination/configure.ac" ]; then + (cd "doc/cookbook/pagination" && autoreconf -i); + fi - if [ -f "doc/cookbook/structuring-apis/configure.ac" ]; then (cd "doc/cookbook/structuring-apis" && autoreconf -i); fi - if [ -f "doc/cookbook/using-custom-monad/configure.ac" ]; then (cd "doc/cookbook/using-custom-monad" && autoreconf -i); fi - - if [ -f "doc/cookbook/file-upload/configure.ac" ]; then - (cd "doc/cookbook/file-upload" && autoreconf -i); - fi - rm -f cabal.project.freeze - - rm -rf .ghc.environment.* "servant"/dist "servant-client"/dist "servant-client-core"/dist "servant-docs"/dist "servant-foreign"/dist "servant-server"/dist "doc/tutorial"/dist "doc/cookbook/db-postgres-pool"/dist "doc/cookbook/jwt-and-basic-auth"/dist "doc/cookbook/db-sqlite-simple"/dist "doc/cookbook/basic-auth"/dist "doc/cookbook/https"/dist "doc/cookbook/structuring-apis"/dist "doc/cookbook/using-custom-monad"/dist "doc/cookbook/file-upload"/dist + - rm -rf .ghc.environment.* "servant"/dist "servant-client"/dist "servant-client-core"/dist "servant-docs"/dist "servant-foreign"/dist "servant-server"/dist "doc/tutorial"/dist "doc/cookbook/basic-auth"/dist "doc/cookbook/db-postgres-pool"/dist "doc/cookbook/db-sqlite-simple"/dist "doc/cookbook/file-upload"/dist "doc/cookbook/https"/dist "doc/cookbook/pagination"/dist "doc/cookbook/structuring-apis"/dist "doc/cookbook/using-custom-monad"/dist - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) # Here starts the actual work to be performed for the package under test; @@ -146,38 +148,37 @@ script: - (cd "servant-foreign" && cabal sdist) - (cd "servant-server" && cabal sdist) - (cd "doc/tutorial" && cabal sdist) - - (cd "doc/cookbook/db-postgres-pool" && cabal sdist) - - (cd "doc/cookbook/jwt-and-basic-auth" && cabal sdist) - - (cd "doc/cookbook/db-sqlite-simple" && cabal sdist) - (cd "doc/cookbook/basic-auth" && cabal sdist) + - (cd "doc/cookbook/db-postgres-pool" && cabal sdist) + - (cd "doc/cookbook/db-sqlite-simple" && cabal sdist) + - (cd "doc/cookbook/file-upload" && cabal sdist) - (cd "doc/cookbook/https" && cabal sdist) + - (cd "doc/cookbook/pagination" && cabal sdist) - (cd "doc/cookbook/structuring-apis" && cabal sdist) - (cd "doc/cookbook/using-custom-monad" && cabal sdist) - - (cd "doc/cookbook/file-upload" && cabal sdist) - echo -en 'travis_fold:end:sdist\\r' - echo Unpacking... && echo -en 'travis_fold:start:unpack\\r' - - mv "servant"/dist/servant-*.tar.gz "servant-client"/dist/servant-client-*.tar.gz "servant-client-core"/dist/servant-client-core-*.tar.gz "servant-docs"/dist/servant-docs-*.tar.gz "servant-foreign"/dist/servant-foreign-*.tar.gz "servant-server"/dist/servant-server-*.tar.gz "doc/tutorial"/dist/tutorial-*.tar.gz "doc/cookbook/db-postgres-pool"/dist/cookbook-db-postgres-pool-*.tar.gz "doc/cookbook/jwt-and-basic-auth"/dist/cookbook-jwt-and-basic-auth-*.tar.gz "doc/cookbook/db-sqlite-simple"/dist/cookbook-db-sqlite-simple-*.tar.gz "doc/cookbook/basic-auth"/dist/cookbook-basic-auth-*.tar.gz "doc/cookbook/https"/dist/cookbook-https-*.tar.gz "doc/cookbook/structuring-apis"/dist/cookbook-structuring-apis-*.tar.gz "doc/cookbook/using-custom-monad"/dist/cookbook-using-custom-monad-*.tar.gz "doc/cookbook/file-upload"/dist/cookbook-file-upload-*.tar.gz ${DISTDIR}/ + - mv "servant"/dist/servant-*.tar.gz "servant-client"/dist/servant-client-*.tar.gz "servant-client-core"/dist/servant-client-core-*.tar.gz "servant-docs"/dist/servant-docs-*.tar.gz "servant-foreign"/dist/servant-foreign-*.tar.gz "servant-server"/dist/servant-server-*.tar.gz "doc/tutorial"/dist/tutorial-*.tar.gz "doc/cookbook/basic-auth"/dist/cookbook-basic-auth-*.tar.gz "doc/cookbook/db-postgres-pool"/dist/cookbook-db-postgres-pool-*.tar.gz "doc/cookbook/db-sqlite-simple"/dist/cookbook-db-sqlite-simple-*.tar.gz "doc/cookbook/file-upload"/dist/cookbook-file-upload-*.tar.gz "doc/cookbook/https"/dist/cookbook-https-*.tar.gz "doc/cookbook/pagination"/dist/cookbook-pagination-*.tar.gz "doc/cookbook/structuring-apis"/dist/cookbook-structuring-apis-*.tar.gz "doc/cookbook/using-custom-monad"/dist/cookbook-using-custom-monad-*.tar.gz ${DISTDIR}/ - cd ${DISTDIR} || false - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \; - - "printf 'packages: servant-*/*.cabal servant-client-*/*.cabal servant-client-core-*/*.cabal servant-docs-*/*.cabal servant-foreign-*/*.cabal servant-server-*/*.cabal tutorial-*/*.cabal cookbook-db-postgres-pool-*/*.cabal cookbook-jwt-and-basic-auth-*/*.cabal cookbook-db-sqlite-simple-*/*.cabal cookbook-basic-auth-*/*.cabal cookbook-https-*/*.cabal cookbook-structuring-apis-*/*.cabal cookbook-using-custom-monad-*/*.cabal cookbook-file-upload-*/*.cabal\\n' > cabal.project" + - "printf 'packages: servant-*/*.cabal servant-client-*/*.cabal servant-client-core-*/*.cabal servant-docs-*/*.cabal servant-foreign-*/*.cabal servant-server-*/*.cabal tutorial-*/*.cabal cookbook-basic-auth-*/*.cabal cookbook-db-postgres-pool-*/*.cabal cookbook-db-sqlite-simple-*/*.cabal cookbook-file-upload-*/*.cabal cookbook-https-*/*.cabal cookbook-pagination-*/*.cabal cookbook-structuring-apis-*/*.cabal cookbook-using-custom-monad-*/*.cabal\\n' > cabal.project" - "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project" - - "echo 'allow-newer: servant-js:servant,servant-js:servant-foreign,servant-auth-server:http-types,servant-multipart:lens,servant-multipart:resourcet,servant-multipart:servant,servant-multipart:servant-server,servant-auth-server:servant-server' >> cabal.project" + - "echo 'allow-newer: servant-js:servant,servant-js:servant-foreign,servant-auth-server:http-types,servant-multipart:lens,servant-multipart:resourcet,servant-multipart:servant,servant-multipart:servant-server,servant-auth-server:servant-server, http-media:base' >> cabal.project" - cat cabal.project - echo -en 'travis_fold:end:unpack\\r' - echo Building with tests and benchmarks... && echo -en 'travis_fold:start:build-everything\\r' # build & run tests, build benchmarks - - cabal new-build -w ${HC} ${TEST} ${BENCH} ${CABALNEWBUILDOPTS} all + - cabal new-build -w ${HC} ${TEST} ${BENCH} all - echo -en 'travis_fold:end:build-everything\\r' - - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} ${CABALNEWBUILDOPTS} all; fi + - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi -# - echo Haddock... && echo -en 'travis_fold:start:haddock\\r' -# # haddock -# - rm -rf ./dist-newstyle -# - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} ${CABALNEWBUILDOPTS} all; else echo "Skipping haddock generation";fi -# -# - echo -en 'travis_fold:end:haddock\\r' + - echo Haddock... && echo -en 'travis_fold:start:haddock\\r' + # haddock + - rm -rf ./dist-newstyle + - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi -# REGENDATA ["--config=cabal.make-travis-yml","--output=.travis.yml","--max-backjumps=10000","cabal.project"] + - echo -en 'travis_fold:end:haddock\\r' +# REGENDATA ["--config=cabal.make-travis-yml","--output=.travis.yml","cabal.project"] # EOF diff --git a/cabal.project b/cabal.project index a1d01559..2b41bbf5 100644 --- a/cabal.project +++ b/cabal.project @@ -5,19 +5,27 @@ packages: servant/ servant-foreign/ servant-server/ doc/tutorial/ - doc/cookbook/*/*.cabal + + -- doc/cookbook/*/*.cabal + + doc/cookbook/basic-auth + doc/cookbook/db-postgres-pool + doc/cookbook/db-sqlite-simple + doc/cookbook/file-upload + doc/cookbook/https + -- doc/cookbook/jwt-and-basic-auth + doc/cookbook/pagination + doc/cookbook/structuring-apis + doc/cookbook/using-custom-monad allow-newer: - servant-js:servant, - servant-js:servant-foreign, servant-auth-server:http-types, - servant-multipart:lens, - servant-multipart:resourcet, - servant-multipart:servant, - servant-multipart:servant-server, servant-auth-server:servant-server constraints: -- see https://github.com/haskell-infra/hackage-trustees/issues/119 foundation >=0.0.14, memory <0.14.12 || >0.14.12 + +allow-newer: + http-media:base diff --git a/doc/cookbook/basic-auth/basic-auth.cabal b/doc/cookbook/basic-auth/basic-auth.cabal index 5997b598..e2006578 100644 --- a/doc/cookbook/basic-auth/basic-auth.cabal +++ b/doc/cookbook/basic-auth/basic-auth.cabal @@ -8,7 +8,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com build-type: Simple cabal-version: >=1.10 -tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2 +tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.2 executable cookbook-basic-auth main-is: BasicAuth.lhs diff --git a/doc/cookbook/db-postgres-pool/db-postgres-pool.cabal b/doc/cookbook/db-postgres-pool/db-postgres-pool.cabal index a2236e40..cebcee7e 100644 --- a/doc/cookbook/db-postgres-pool/db-postgres-pool.cabal +++ b/doc/cookbook/db-postgres-pool/db-postgres-pool.cabal @@ -8,7 +8,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com build-type: Simple cabal-version: >=1.10 -tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2 +tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.2 executable cookbook-db-postgres-pool main-is: PostgresPool.lhs diff --git a/doc/cookbook/db-sqlite-simple/db-sqlite-simple.cabal b/doc/cookbook/db-sqlite-simple/db-sqlite-simple.cabal index 6115cf2f..760d3929 100644 --- a/doc/cookbook/db-sqlite-simple/db-sqlite-simple.cabal +++ b/doc/cookbook/db-sqlite-simple/db-sqlite-simple.cabal @@ -8,7 +8,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com build-type: Simple cabal-version: >=1.10 -tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2 +tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.2 executable cookbook-db-sqlite-simple main-is: DBConnection.lhs diff --git a/doc/cookbook/file-upload/file-upload.cabal b/doc/cookbook/file-upload/file-upload.cabal index 66b346a4..55722b3a 100644 --- a/doc/cookbook/file-upload/file-upload.cabal +++ b/doc/cookbook/file-upload/file-upload.cabal @@ -8,7 +8,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com build-type: Simple cabal-version: >=1.10 -tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2 +tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.2 executable cookbook-file-upload main-is: FileUpload.lhs diff --git a/doc/cookbook/https/https.cabal b/doc/cookbook/https/https.cabal index bec9273c..98df6c50 100644 --- a/doc/cookbook/https/https.cabal +++ b/doc/cookbook/https/https.cabal @@ -8,7 +8,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com build-type: Simple cabal-version: >=1.10 -tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2 +tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.2 executable cookbook-https main-is: Https.lhs diff --git a/doc/cookbook/jwt-and-basic-auth/jwt-and-basic-auth.cabal b/doc/cookbook/jwt-and-basic-auth/jwt-and-basic-auth.cabal index b5f751b0..15d8d22b 100644 --- a/doc/cookbook/jwt-and-basic-auth/jwt-and-basic-auth.cabal +++ b/doc/cookbook/jwt-and-basic-auth/jwt-and-basic-auth.cabal @@ -11,7 +11,7 @@ maintainer: haskell-servant-maintainers@googlegroups.com category: Servant build-type: Simple cabal-version: >=1.10 -tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2 +tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.2 executable cookbook-jwt-and-basic-auth if !impl(ghc >= 7.10) diff --git a/doc/cookbook/pagination/dummy/Pagination.lhs b/doc/cookbook/pagination/dummy/Pagination.lhs new file mode 100644 index 00000000..ab900f27 --- /dev/null +++ b/doc/cookbook/pagination/dummy/Pagination.lhs @@ -0,0 +1,5 @@ +```haskell +module Main (main) where +main :: IO () +main = return () +``` diff --git a/doc/cookbook/pagination/pagination.cabal b/doc/cookbook/pagination/pagination.cabal index e05d7401..db177efb 100644 --- a/doc/cookbook/pagination/pagination.cabal +++ b/doc/cookbook/pagination/pagination.cabal @@ -8,17 +8,25 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com build-type: Simple cabal-version: >=1.10 +extra-source-files: + Pagination.lhs + dummy/Pagination.lhs +tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.2 executable cookbook-pagination - if impl(ghc < 7.10.1) - buildable: False main-is: Pagination.lhs - build-depends: base == 4.* - , aeson - , servant - , servant-server - , servant-pagination >= 2.1.0 && < 3.0.0 - , warp + build-tool-depends: markdown-unlit:markdown-unlit default-language: Haskell2010 ghc-options: -Wall -pgmL markdown-unlit - build-tool-depends: markdown-unlit:markdown-unlit + + if impl(ghc >= 8.0) + hs-source-dirs: . + build-depends: base >= 4.8 && <4.12 + , aeson + , servant + , servant-server + , servant-pagination >= 2.1.0 && < 3.0.0 + , warp + else + hs-source-dirs: dummy + build-depends: base diff --git a/doc/cookbook/structuring-apis/structuring-apis.cabal b/doc/cookbook/structuring-apis/structuring-apis.cabal index b2a9985c..9b85de19 100644 --- a/doc/cookbook/structuring-apis/structuring-apis.cabal +++ b/doc/cookbook/structuring-apis/structuring-apis.cabal @@ -8,7 +8,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com build-type: Simple cabal-version: >=1.10 -tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2 +tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.2 executable cookbook-structuring-apis main-is: StructuringApis.lhs diff --git a/doc/cookbook/using-custom-monad/using-custom-monad.cabal b/doc/cookbook/using-custom-monad/using-custom-monad.cabal index 216f1cf6..22fb4450 100644 --- a/doc/cookbook/using-custom-monad/using-custom-monad.cabal +++ b/doc/cookbook/using-custom-monad/using-custom-monad.cabal @@ -8,7 +8,7 @@ author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com build-type: Simple cabal-version: >=1.10 -tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2 +tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.2 executable cookbook-using-custom-monad main-is: UsingCustomMonad.lhs diff --git a/doc/tutorial/tutorial.cabal b/doc/tutorial/tutorial.cabal index 18f86738..9b8cab59 100644 --- a/doc/tutorial/tutorial.cabal +++ b/doc/tutorial/tutorial.cabal @@ -17,6 +17,7 @@ tested-with: GHC==7.10.3 GHC==8.0.2 GHC==8.2.2 + GHC==8.4.2 extra-source-files: static/index.html static/ui.js @@ -34,7 +35,7 @@ library -- Packages `servant` depends on. -- We don't need to specify bounds here as this package is never released. build-depends: - base >= 4.7 && <4.11 + base >= 4.7 && <4.12 , aeson , aeson-compat , attoparsec diff --git a/servant-client-core/servant-client-core.cabal b/servant-client-core/servant-client-core.cabal index 56c46dff..6c116b78 100644 --- a/servant-client-core/servant-client-core.cabal +++ b/servant-client-core/servant-client-core.cabal @@ -23,6 +23,7 @@ tested-with: GHC==7.10.3 GHC==8.0.2 GHC==8.2.2 + GHC==8.4.2 source-repository head type: git @@ -47,7 +48,7 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.7 && < 4.11 + base >= 4.7 && < 4.12 , bytestring >= 0.10.4.0 && < 0.11 , containers >= 0.5.5.1 && < 0.6 , mtl >= 2.1 && < 2.3 diff --git a/servant-client-ghcjs/servant-client-ghcjs.cabal b/servant-client-ghcjs/servant-client-ghcjs.cabal index f832a2ff..f65c5aff 100644 --- a/servant-client-ghcjs/servant-client-ghcjs.cabal +++ b/servant-client-ghcjs/servant-client-ghcjs.cabal @@ -31,7 +31,7 @@ library Servant.Client.Ghcjs Servant.Client.Internal.XhrClient build-depends: - base >= 4.7 && < 4.11 + base >= 4.7 && < 4.12 , bytestring >= 0.10 && < 0.11 , case-insensitive >= 1.2.0.0 && < 1.3.0.0 , containers >= 0.5 && < 0.6 diff --git a/servant-client/servant-client.cabal b/servant-client/servant-client.cabal index dbf96c28..e5d25ae1 100644 --- a/servant-client/servant-client.cabal +++ b/servant-client/servant-client.cabal @@ -21,6 +21,7 @@ tested-with: GHC==7.10.3 GHC==8.0.2 GHC==8.2.2 + GHC==8.4.2 homepage: http://haskell-servant.readthedocs.org/ Bug-reports: http://github.com/haskell-servant/servant/issues extra-source-files: @@ -41,7 +42,7 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.7 && < 4.11 + base >= 4.7 && < 4.12 , bytestring >= 0.10.4.0 && < 0.11 , containers >= 0.5.5.1 && < 0.6 , mtl >= 2.1 && < 2.3 @@ -121,7 +122,7 @@ test-suite spec , hspec >= 2.4.4 && < 2.6 , HUnit >= 1.6 && < 1.7 , random-bytestring >= 0.1 && < 0.2 - , network >= 2.6.3.2 && < 2.7 + , network >= 2.6.3.2 && < 2.8 , QuickCheck >= 2.10.1 && < 2.12 , servant == 0.13.* , servant-server == 0.13.* diff --git a/servant-client/test/Servant/StreamSpec.hs b/servant-client/test/Servant/StreamSpec.hs index ad4a2664..950686ac 100644 --- a/servant-client/test/Servant/StreamSpec.hs +++ b/servant-client/test/Servant/StreamSpec.hs @@ -29,7 +29,6 @@ module Servant.StreamSpec (spec) where import Control.Monad (replicateM_, void) import qualified Data.ByteString as BS import Data.Proxy -import GHC.Stats (currentBytesUsed, getGCStats) import qualified Network.HTTP.Client as C import Prelude () import Prelude.Compat @@ -47,6 +46,11 @@ import Servant.ClientSpec (Person (..)) import qualified Servant.ClientSpec as CS import Servant.Server +#if MIN_VERSION_base(4,10,0) +import GHC.Stats (gcdetails_mem_in_use_bytes, gc, getRTSStats) +#else +import GHC.Stats (currentBytesUsed, getGCStats) +#endif spec :: Spec spec = describe "Servant.Stream" $ do @@ -81,16 +85,16 @@ server = serve sapi :<|> return (StreamGenerator lotsGenerator) where lotsGenerator f r = do - f "" - withFile "/dev/urandom" ReadMode $ + void $ f "" + void $ withFile "/dev/urandom" ReadMode $ \handle -> streamFiveMBNTimes handle 1000 r return () streamFiveMBNTimes handle left sink - | left <= 0 = return "" + | left <= (0 :: Int) = return () | otherwise = do msg <- BS.hGet handle (megabytes 5) - sink msg + _ <- sink msg streamFiveMBNTimes handle (left - 1) sink @@ -129,8 +133,12 @@ streamSpec = beforeAll (CS.startWaiApp server) $ afterAll CS.endWaiApp $ do Right (ResultStream res) <- runClient getGetALot baseUrl let consumeNChunks n = replicateM_ n (res void) consumeNChunks 900 +#if MIN_VERSION_base(4,10,0) + memUsed <- gcdetails_mem_in_use_bytes . gc <$> getRTSStats +#else memUsed <- currentBytesUsed <$> getGCStats - memUsed `shouldSatisfy` (< (megabytes 20)) +#endif + memUsed `shouldSatisfy` (< megabytes 22) megabytes :: Num a => a -> a -megabytes n = n * (1000 ^ 2) +megabytes n = n * (1000 ^ (2 :: Int)) diff --git a/servant-docs/servant-docs.cabal b/servant-docs/servant-docs.cabal index b8f6069f..6ee8277d 100644 --- a/servant-docs/servant-docs.cabal +++ b/servant-docs/servant-docs.cabal @@ -21,6 +21,7 @@ tested-with: GHC==7.10.3 GHC==8.0.2 GHC==8.2.2 + GHC==8.4.2 homepage: http://haskell-servant.readthedocs.org/ Bug-reports: http://github.com/haskell-servant/servant/issues extra-source-files: @@ -42,7 +43,7 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.7 && < 4.11 + base >= 4.7 && < 4.12 , bytestring >= 0.10.4.0 && < 0.11 , text >= 1.2.3.0 && < 1.3 diff --git a/servant-foreign/CHANGELOG.md b/servant-foreign/CHANGELOG.md index 73846801..796f9017 100644 --- a/servant-foreign/CHANGELOG.md +++ b/servant-foreign/CHANGELOG.md @@ -1,6 +1,11 @@ [The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-foreign/CHANGELOG.md) [Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md) +0.11.1 +------ + +- Add missing `Semigroup` instances + 0.11 ---- diff --git a/servant-foreign/servant-foreign.cabal b/servant-foreign/servant-foreign.cabal index 0b46e87a..2b0fbd6c 100644 --- a/servant-foreign/servant-foreign.cabal +++ b/servant-foreign/servant-foreign.cabal @@ -27,6 +27,7 @@ tested-with: GHC==7.10.3 GHC==8.0.2 GHC==8.2.2 + GHC==8.4.2 source-repository head type: git @@ -42,9 +43,13 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.7 && <4.11 + base >= 4.7 && <4.12 , text >= 1.2.3.0 && < 1.3 + if !impl(ghc >= 8.0) + build-depends: + semigroups >=0.18.3 && <0.19 + -- Servant dependencies build-depends: servant == 0.13.* diff --git a/servant-foreign/src/Servant/Foreign/Internal.hs b/servant-foreign/src/Servant/Foreign/Internal.hs index 69a21481..b79cbf70 100644 --- a/servant-foreign/src/Servant/Foreign/Internal.hs +++ b/servant-foreign/src/Servant/Foreign/Internal.hs @@ -27,6 +27,7 @@ import Control.Lens (makePrisms, makeLenses, Getter, (&), (<>~), (%~), (.~)) import Data.Data (Data) import Data.Proxy +import Data.Semigroup (Semigroup) import Data.String import Data.Text import Data.Typeable (Typeable) @@ -38,12 +39,12 @@ import Servant.API.TypeLevel import Servant.API.Modifiers (RequiredArgument) newtype FunctionName = FunctionName { unFunctionName :: [Text] } - deriving (Data, Show, Eq, Monoid, Typeable) + deriving (Data, Show, Eq, Semigroup, Monoid, Typeable) makePrisms ''FunctionName newtype PathSegment = PathSegment { unPathSegment :: Text } - deriving (Data, Show, Eq, IsString, Monoid, Typeable) + deriving (Data, Show, Eq, IsString, Semigroup, Monoid, Typeable) makePrisms ''PathSegment diff --git a/servant-server/servant-server.cabal b/servant-server/servant-server.cabal index 1823eba3..3da71e13 100644 --- a/servant-server/servant-server.cabal +++ b/servant-server/servant-server.cabal @@ -26,6 +26,7 @@ tested-with: GHC==7.10.3 GHC==8.0.2 GHC==8.2.2 + GHC==8.4.2 extra-source-files: include/*.h CHANGELOG.md @@ -60,7 +61,7 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.7 && < 4.11 + base >= 4.7 && < 4.12 , bytestring >= 0.10.4.0 && < 0.11 , containers >= 0.5.5.1 && < 0.6 , mtl >= 2.1 && < 2.3 @@ -89,7 +90,7 @@ library , http-types >= 0.12 && < 0.13 , network-uri >= 2.6.1.0 && < 2.7 , monad-control >= 1.0.0.4 && < 1.1 - , network >= 2.6.3.2 && < 2.7 + , network >= 2.6.3.2 && < 2.8 , safe >= 0.3.15 && < 0.4 , split >= 0.2.3.2 && < 0.3 , string-conversions >= 0.4.0.1 && < 0.5 diff --git a/servant/servant.cabal b/servant/servant.cabal index 7e8cc0da..0dd30bd5 100644 --- a/servant/servant.cabal +++ b/servant/servant.cabal @@ -22,6 +22,7 @@ tested-with: GHC==7.10.3 GHC==8.0.2 GHC==8.2.2 + GHC==8.4.2 extra-source-files: include/*.h CHANGELOG.md @@ -69,7 +70,7 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.7 && < 4.11 + base >= 4.7 && < 4.12 , bytestring >= 0.10.4.0 && < 0.11 , mtl >= 2.1 && < 2.3 , text >= 1.2.3.0 && < 1.3