From b685efecbe8f1fb2aa202f5cc1980155edcb2214 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Tue, 22 Jan 2019 15:24:16 +0200 Subject: [PATCH] Allow network-3.0 --- .travis.yml | 17 +++++++---------- cabal.project | 18 +++++++++++------- doc/cookbook/file-upload/FileUpload.lhs | 2 +- servant-client-core/servant-client-core.cabal | 4 ++-- servant-client/servant-client.cabal | 2 +- servant-client/test/Servant/ClientSpec.hs | 4 ++-- servant-foreign/servant-foreign.cabal | 4 ++-- servant-server/servant-server.cabal | 8 ++++---- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4492891b..fa534767 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,12 +69,12 @@ install: - 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\" \"servant-machines\" \"servant-conduit\" \"servant-pipes\" \"doc/cookbook/basic-auth\" \"doc/cookbook/curl-mock\" \"doc/cookbook/basic-streaming\" \"doc/cookbook/db-postgres-pool\" \"doc/cookbook/db-sqlite-simple\" \"doc/cookbook/file-upload\" \"doc/cookbook/generic\" \"doc/cookbook/hoist-server-with-context\" \"doc/cookbook/https\" \"doc/cookbook/jwt-and-basic-auth\" \"doc/cookbook/sentry\" \"doc/cookbook/testing\" \"doc/cookbook/structuring-apis\" \"doc/cookbook/using-custom-monad\" \"doc/cookbook/using-free-client\"\\n' > cabal.project" + - "printf 'packages: \"servant\" \"servant-client\" \"servant-client-core\" \"servant-docs\" \"servant-foreign\" \"servant-server\" \"doc/tutorial\" \"servant-machines\" \"servant-conduit\" \"servant-pipes\" \"doc/cookbook/basic-auth\" \"doc/cookbook/curl-mock\" \"doc/cookbook/basic-streaming\" \"doc/cookbook/db-postgres-pool\" \"doc/cookbook/db-sqlite-simple\" \"doc/cookbook/file-upload\" \"doc/cookbook/generic\" \"doc/cookbook/hoist-server-with-context\" \"doc/cookbook/https\" \"doc/cookbook/jwt-and-basic-auth\" \"doc/cookbook/testing\" \"doc/cookbook/structuring-apis\" \"doc/cookbook/using-custom-monad\" \"doc/cookbook/using-free-client\"\\n' > cabal.project" - "printf 'write-ghc-environment-files: always\\n' >> cabal.project" - "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project" - - "echo 'allow-newer: servant-js:base, servant-pagination:servant, servant-pagination:servant-server,servant-multipart:servant, servant-multipart:servant-server,servant-quickcheck:servant, servant-quickcheck:servant-client, servant-quickcheck:servant-server,servant-auth-server:servant, servant-auth-server:servant-server, servant-auth-server:http-api-data,servant-js:servant, servant-js:servant-foreign,servant-quickcheck:hspec,servant-quickcheck:http-client' >> cabal.project" + - "echo 'allow-newer: servant-js:base, servant-quickcheck:servant, servant-quickcheck:servant-client, servant-quickcheck:servant-server,servant-quickcheck:hspec,servant-quickcheck:http-client' >> cabal.project" - touch cabal.project.local - - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- servant | grep -vw -- servant-client | grep -vw -- servant-client-core | grep -vw -- servant-docs | grep -vw -- servant-foreign | grep -vw -- servant-server | grep -vw -- tutorial | grep -vw -- servant-machines | grep -vw -- servant-conduit | grep -vw -- servant-pipes | grep -vw -- cookbook-basic-auth | grep -vw -- cookbook-curl-mock | grep -vw -- cookbook-basic-streaming | grep -vw -- cookbook-db-postgres-pool | grep -vw -- cookbook-db-sqlite-simple | grep -vw -- cookbook-file-upload | grep -vw -- cookbook-generic | grep -vw -- cookbook-hoist-server-with-context | grep -vw -- cookbook-https | grep -vw -- cookbook-jwt-and-basic-auth | grep -vw -- cookbook-sentry | grep -vw -- cookbook-testing | grep -vw -- cookbook-structuring-apis | grep -vw -- cookbook-using-custom-monad | grep -vw -- cookbook-using-free-client | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi" + - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- servant | grep -vw -- servant-client | grep -vw -- servant-client-core | grep -vw -- servant-docs | grep -vw -- servant-foreign | grep -vw -- servant-server | grep -vw -- tutorial | grep -vw -- servant-machines | grep -vw -- servant-conduit | grep -vw -- servant-pipes | grep -vw -- cookbook-basic-auth | grep -vw -- cookbook-curl-mock | grep -vw -- cookbook-basic-streaming | grep -vw -- cookbook-db-postgres-pool | grep -vw -- cookbook-db-sqlite-simple | grep -vw -- cookbook-file-upload | grep -vw -- cookbook-generic | grep -vw -- cookbook-hoist-server-with-context | grep -vw -- cookbook-https | grep -vw -- cookbook-jwt-and-basic-auth | grep -vw -- cookbook-testing | grep -vw -- cookbook-structuring-apis | grep -vw -- cookbook-using-custom-monad | grep -vw -- cookbook-using-free-client | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi" - cat cabal.project || true - cat cabal.project.local || true - if [ -f "servant/configure.ac" ]; then @@ -137,9 +137,6 @@ install: - 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/sentry/configure.ac" ]; then - (cd "doc/cookbook/sentry" && autoreconf -i); - fi - if [ -f "doc/cookbook/testing/configure.ac" ]; then (cd "doc/cookbook/testing" && autoreconf -i); fi @@ -153,7 +150,7 @@ install: (cd "doc/cookbook/using-free-client" && 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 "servant-machines"/dist "servant-conduit"/dist "servant-pipes"/dist "doc/cookbook/basic-auth"/dist "doc/cookbook/curl-mock"/dist "doc/cookbook/basic-streaming"/dist "doc/cookbook/db-postgres-pool"/dist "doc/cookbook/db-sqlite-simple"/dist "doc/cookbook/file-upload"/dist "doc/cookbook/generic"/dist "doc/cookbook/hoist-server-with-context"/dist "doc/cookbook/https"/dist "doc/cookbook/jwt-and-basic-auth"/dist "doc/cookbook/sentry"/dist "doc/cookbook/testing"/dist "doc/cookbook/structuring-apis"/dist "doc/cookbook/using-custom-monad"/dist "doc/cookbook/using-free-client"/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 "servant-machines"/dist "servant-conduit"/dist "servant-pipes"/dist "doc/cookbook/basic-auth"/dist "doc/cookbook/curl-mock"/dist "doc/cookbook/basic-streaming"/dist "doc/cookbook/db-postgres-pool"/dist "doc/cookbook/db-sqlite-simple"/dist "doc/cookbook/file-upload"/dist "doc/cookbook/generic"/dist "doc/cookbook/hoist-server-with-context"/dist "doc/cookbook/https"/dist "doc/cookbook/jwt-and-basic-auth"/dist "doc/cookbook/testing"/dist "doc/cookbook/structuring-apis"/dist "doc/cookbook/using-custom-monad"/dist "doc/cookbook/using-free-client"/dist - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) # Here starts the actual work to be performed for the package under test; @@ -167,12 +164,12 @@ script: - mv dist-newstyle/sdist/*.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 servant-machines-*/*.cabal servant-conduit-*/*.cabal servant-pipes-*/*.cabal cookbook-basic-auth-*/*.cabal cookbook-curl-mock-*/*.cabal cookbook-basic-streaming-*/*.cabal cookbook-db-postgres-pool-*/*.cabal cookbook-db-sqlite-simple-*/*.cabal cookbook-file-upload-*/*.cabal cookbook-generic-*/*.cabal cookbook-hoist-server-with-context-*/*.cabal cookbook-https-*/*.cabal cookbook-jwt-and-basic-auth-*/*.cabal cookbook-sentry-*/*.cabal cookbook-testing-*/*.cabal cookbook-structuring-apis-*/*.cabal cookbook-using-custom-monad-*/*.cabal cookbook-using-free-client-*/*.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 servant-machines-*/*.cabal servant-conduit-*/*.cabal servant-pipes-*/*.cabal cookbook-basic-auth-*/*.cabal cookbook-curl-mock-*/*.cabal cookbook-basic-streaming-*/*.cabal cookbook-db-postgres-pool-*/*.cabal cookbook-db-sqlite-simple-*/*.cabal cookbook-file-upload-*/*.cabal cookbook-generic-*/*.cabal cookbook-hoist-server-with-context-*/*.cabal cookbook-https-*/*.cabal cookbook-jwt-and-basic-auth-*/*.cabal cookbook-testing-*/*.cabal cookbook-structuring-apis-*/*.cabal cookbook-using-custom-monad-*/*.cabal cookbook-using-free-client-*/*.cabal\\n' > cabal.project" - "printf 'write-ghc-environment-files: always\\n' >> cabal.project" - "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project" - - "echo 'allow-newer: servant-js:base, servant-pagination:servant, servant-pagination:servant-server,servant-multipart:servant, servant-multipart:servant-server,servant-quickcheck:servant, servant-quickcheck:servant-client, servant-quickcheck:servant-server,servant-auth-server:servant, servant-auth-server:servant-server, servant-auth-server:http-api-data,servant-js:servant, servant-js:servant-foreign,servant-quickcheck:hspec,servant-quickcheck:http-client' >> cabal.project" + - "echo 'allow-newer: servant-js:base, servant-quickcheck:servant, servant-quickcheck:servant-client, servant-quickcheck:servant-server,servant-quickcheck:hspec,servant-quickcheck:http-client' >> cabal.project" - touch cabal.project.local - - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- servant | grep -vw -- servant-client | grep -vw -- servant-client-core | grep -vw -- servant-docs | grep -vw -- servant-foreign | grep -vw -- servant-server | grep -vw -- tutorial | grep -vw -- servant-machines | grep -vw -- servant-conduit | grep -vw -- servant-pipes | grep -vw -- cookbook-basic-auth | grep -vw -- cookbook-curl-mock | grep -vw -- cookbook-basic-streaming | grep -vw -- cookbook-db-postgres-pool | grep -vw -- cookbook-db-sqlite-simple | grep -vw -- cookbook-file-upload | grep -vw -- cookbook-generic | grep -vw -- cookbook-hoist-server-with-context | grep -vw -- cookbook-https | grep -vw -- cookbook-jwt-and-basic-auth | grep -vw -- cookbook-sentry | grep -vw -- cookbook-testing | grep -vw -- cookbook-structuring-apis | grep -vw -- cookbook-using-custom-monad | grep -vw -- cookbook-using-free-client | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi" + - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- servant | grep -vw -- servant-client | grep -vw -- servant-client-core | grep -vw -- servant-docs | grep -vw -- servant-foreign | grep -vw -- servant-server | grep -vw -- tutorial | grep -vw -- servant-machines | grep -vw -- servant-conduit | grep -vw -- servant-pipes | grep -vw -- cookbook-basic-auth | grep -vw -- cookbook-curl-mock | grep -vw -- cookbook-basic-streaming | grep -vw -- cookbook-db-postgres-pool | grep -vw -- cookbook-db-sqlite-simple | grep -vw -- cookbook-file-upload | grep -vw -- cookbook-generic | grep -vw -- cookbook-hoist-server-with-context | grep -vw -- cookbook-https | grep -vw -- cookbook-jwt-and-basic-auth | grep -vw -- cookbook-testing | grep -vw -- cookbook-structuring-apis | grep -vw -- cookbook-using-custom-monad | grep -vw -- cookbook-using-free-client | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi" - cat cabal.project || true - cat cabal.project.local || true - echo -en 'travis_fold:end:unpack\\r' diff --git a/cabal.project b/cabal.project index fa658be1..a059a9f4 100644 --- a/cabal.project +++ b/cabal.project @@ -23,12 +23,14 @@ packages: servant/ doc/cookbook/https doc/cookbook/jwt-and-basic-auth/ -- doc/cookbook/pagination - doc/cookbook/sentry + -- doc/cookbook/sentry doc/cookbook/testing doc/cookbook/structuring-apis doc/cookbook/using-custom-monad doc/cookbook/using-free-client +tests: true + allow-newer: servant-js:base @@ -38,11 +40,13 @@ constraints: memory <0.14.12 || >0.14.12 allow-newer: - servant-pagination:servant, servant-pagination:servant-server, - servant-multipart:servant, servant-multipart:servant-server, - servant-quickcheck:servant, servant-quickcheck:servant-client, servant-quickcheck:servant-server, - servant-auth-server:servant, servant-auth-server:servant-server, servant-auth-server:http-api-data, - servant-js:servant, servant-js:servant-foreign, - servant-quickcheck:hspec, +-- servant-pagination:servant, servant-pagination:servant-server, +-- servant-multipart:servant, servant-multipart:servant-server, +-- servant-auth-server:servant, servant-auth-server:servant-server, servant-auth-server:http-api-data, +-- servant-js:servant, servant-js:servant-foreign, +-- servant-quickcheck +allow-newer: + servant-quickcheck:servant, servant-quickcheck:servant-client, servant-quickcheck:servant-server, + servant-quickcheck:hspec, servant-quickcheck:http-client diff --git a/doc/cookbook/file-upload/FileUpload.lhs b/doc/cookbook/file-upload/FileUpload.lhs index ecd04588..3f19092b 100644 --- a/doc/cookbook/file-upload/FileUpload.lhs +++ b/doc/cookbook/file-upload/FileUpload.lhs @@ -17,7 +17,7 @@ import Control.Exception import Control.Monad import Control.Monad.IO.Class import Data.Text.Encoding (encodeUtf8) -import Network (withSocketsDo) +import Network.Socket (withSocketsDo) import Network.HTTP.Client hiding (Proxy) import Network.HTTP.Client.MultipartFormData import Network.Wai.Handler.Warp diff --git a/servant-client-core/servant-client-core.cabal b/servant-client-core/servant-client-core.cabal index fb327071..dda7aea9 100644 --- a/servant-client-core/servant-client-core.cabal +++ b/servant-client-core/servant-client-core.cabal @@ -98,8 +98,8 @@ test-suite spec -- Additonal dependencies build-depends: deepseq >= 1.4.2.0 && < 1.5 - , hspec >= 2.6.0 && < 2.7 + , hspec >= 2.6.0 && < 2.8 , QuickCheck >= 2.12.6.1 && < 2.13 build-tool-depends: - hspec-discover:hspec-discover >= 2.6.0 && <2.7 + hspec-discover:hspec-discover >= 2.6.0 && <2.8 diff --git a/servant-client/servant-client.cabal b/servant-client/servant-client.cabal index c6509133..a739d7c7 100644 --- a/servant-client/servant-client.cabal +++ b/servant-client/servant-client.cabal @@ -114,7 +114,7 @@ test-suite spec , generics-sop >= 0.4.0.1 && < 0.5 , hspec >= 2.6.0 && < 2.7 , HUnit >= 1.6.0.0 && < 1.7 - , network >= 2.8.0.0 && < 2.9 + , network >= 2.8.0.0 && < 3.1 , QuickCheck >= 2.12.6.1 && < 2.13 , servant == 0.15.* , servant-server == 0.15.* diff --git a/servant-client/test/Servant/ClientSpec.hs b/servant-client/test/Servant/ClientSpec.hs index ed375758..d864fef0 100644 --- a/servant-client/test/Servant/ClientSpec.hs +++ b/servant-client/test/Servant/ClientSpec.hs @@ -523,8 +523,8 @@ endWaiApp (thread, _) = killThread thread openTestSocket :: IO (Port, Socket) openTestSocket = do s <- socket AF_INET Stream defaultProtocol - localhost <- inet_addr "127.0.0.1" - bind s (SockAddrInet aNY_PORT localhost) + let localhost = tupleToHostAddress (127, 0, 0, 1) + bind s (SockAddrInet defaultPort localhost) listen s 1 port <- socketPort s return (fromIntegral port, s) diff --git a/servant-foreign/servant-foreign.cabal b/servant-foreign/servant-foreign.cabal index 56e1213a..955c27e5 100644 --- a/servant-foreign/servant-foreign.cabal +++ b/servant-foreign/servant-foreign.cabal @@ -78,8 +78,8 @@ test-suite spec -- Additonal dependencies build-depends: - hspec >= 2.6.0 && <2.7 + hspec >= 2.6.0 && <2.8 build-tool-depends: - hspec-discover:hspec-discover >=2.6.0 && <2.7 + hspec-discover:hspec-discover >=2.6.0 && <2.8 default-language: Haskell2010 diff --git a/servant-server/servant-server.cabal b/servant-server/servant-server.cabal index 95ad5f7b..30bc3e08 100644 --- a/servant-server/servant-server.cabal +++ b/servant-server/servant-server.cabal @@ -87,9 +87,9 @@ library , exceptions >= 0.10.0 && < 0.11 , http-media >= 0.7.1.3 && < 0.8 , http-types >= 0.12.2 && < 0.13 - , network-uri >= 2.6.1.0 && < 2.7 + , network-uri >= 2.6.1.0 && < 2.8 , monad-control >= 1.0.2.3 && < 1.1 - , network >= 2.8 && < 2.9 + , network >= 2.8 && < 3.1 , string-conversions >= 0.4.0.1 && < 0.5 , resourcet >= 1.2.2 && < 1.3 , tagged >= 0.8.6 && < 0.9 @@ -160,7 +160,7 @@ test-suite spec build-depends: aeson >= 1.4.1.0 && < 1.5 , directory >= 1.3.0.0 && < 1.4 - , hspec >= 2.6.0 && < 2.7 + , hspec >= 2.6.0 && < 2.8 , hspec-wai >= 0.9.0 && < 0.10 , QuickCheck >= 2.12.6.1 && < 2.13 , should-not-typecheck >= 2.1.0 && < 2.2 @@ -168,7 +168,7 @@ test-suite spec , wai-extra >= 3.0.24.3 && < 3.1 build-tool-depends: - hspec-discover:hspec-discover >= 2.6.0 && <2.7 + hspec-discover:hspec-discover >= 2.6.0 && <2.8 test-suite doctests build-depends: