From cd395a27e85c29f8a899d773df9e1a7114c22183 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 5 Nov 2015 09:13:24 +0800 Subject: [PATCH 1/3] aeson-0.10.0.0 fixes --- servant-examples/tutorial/T1.hs | 3 +++ servant-examples/tutorial/T2.hs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/servant-examples/tutorial/T1.hs b/servant-examples/tutorial/T1.hs index 491465ea..97bbecb8 100644 --- a/servant-examples/tutorial/T1.hs +++ b/servant-examples/tutorial/T1.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeFamilies #-} @@ -17,10 +18,12 @@ data User = User , registration_date :: Day } deriving (Eq, Show, Generic) +#if !MIN_VERSION_aeson(0,10,0) -- orphan ToJSON instance for Day. necessary to derive one for User instance ToJSON Day where -- display a day in YYYY-mm-dd format toJSON d = toJSON (showGregorian d) +#endif instance ToJSON User diff --git a/servant-examples/tutorial/T2.hs b/servant-examples/tutorial/T2.hs index 72aca76a..fc49d256 100644 --- a/servant-examples/tutorial/T2.hs +++ b/servant-examples/tutorial/T2.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeFamilies #-} @@ -17,10 +18,12 @@ data User = User , registration_date :: Day } deriving (Eq, Show, Generic) +#if !MIN_VERSION_aeson(0,10,0) -- orphan ToJSON instance for Day. necessary to derive one for User instance ToJSON Day where -- display a day in YYYY-mm-dd format toJSON d = toJSON (showGregorian d) +#endif instance ToJSON User From 4e53e2083bbe70cd5e85962de05259eedbad079e Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 24 Sep 2015 14:40:27 +0800 Subject: [PATCH 2/3] Use tinc on travis --- .travis.yml | 32 +++++++++++++++++++------------- servant-blaze/tinc.yaml | 3 +++ servant-cassava/tinc.yaml | 3 +++ servant-client/tinc.yaml | 5 +++++ servant-docs/tinc.yaml | 3 +++ servant-examples/tinc.yaml | 15 +++++++++++++++ servant-foreign/tinc.yaml | 3 +++ servant-js/tinc.yaml | 7 +++++++ servant-lucid/tinc.yaml | 3 +++ servant-mock/tinc.yaml | 5 +++++ servant-server/tinc.yaml | 3 +++ 11 files changed, 69 insertions(+), 13 deletions(-) create mode 100644 servant-blaze/tinc.yaml create mode 100644 servant-cassava/tinc.yaml create mode 100644 servant-client/tinc.yaml create mode 100644 servant-docs/tinc.yaml create mode 100644 servant-examples/tinc.yaml create mode 100644 servant-foreign/tinc.yaml create mode 100644 servant-js/tinc.yaml create mode 100644 servant-lucid/tinc.yaml create mode 100644 servant-mock/tinc.yaml create mode 100644 servant-server/tinc.yaml diff --git a/.travis.yml b/.travis.yml index da7c7f71..8056cb98 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,32 @@ sudo: false +language: c + +env: + - GHCVER=7.8.4 + - GHCVER=7.10.2 + addons: apt: + sources: + - hvr-ghc packages: + - ghc-7.8.4 + - ghc-7.10.2 + - cabal-install-1.22 - libgmp-dev -env: - - STACK_YAML=stack-ghc-7.8.4.yaml - - STACK_YAML=stack.yaml - install: - # stack - - mkdir -p ~/.local/bin - - travis_retry curl -L https://github.com/commercialhaskell/stack/releases/download/v0.1.4.0/stack-0.1.4.0-x86_64-linux.tar.gz | tar -xvzf - - - mv stack ~/.local/bin - - export PATH=~/.local/bin:$PATH - - stack --version + - (mkdir -p $HOME/.local/bin && cd $HOME/.local/bin && wget https://zalora-public.s3.amazonaws.com/tinc && chmod +x tinc) + - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.22/bin:$PATH + - ghc --version + - cabal --version + - travis_retry cabal update + - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config script: - - stack setup - - stack build --test --ghc-options "-Werror" + - for package in $(cat sources.txt); do (cd $package && tinc && cabal configure --enable-tests --ghc-options=-Werror --disable-optimization && cabal build && cabal test) || exit 1; done cache: directories: - - $HOME/.stack + - $HOME/.tinc/cache diff --git a/servant-blaze/tinc.yaml b/servant-blaze/tinc.yaml new file mode 100644 index 00000000..dbf42cc7 --- /dev/null +++ b/servant-blaze/tinc.yaml @@ -0,0 +1,3 @@ +dependencies: + - name: servant + path: ../servant diff --git a/servant-cassava/tinc.yaml b/servant-cassava/tinc.yaml new file mode 100644 index 00000000..dbf42cc7 --- /dev/null +++ b/servant-cassava/tinc.yaml @@ -0,0 +1,3 @@ +dependencies: + - name: servant + path: ../servant diff --git a/servant-client/tinc.yaml b/servant-client/tinc.yaml new file mode 100644 index 00000000..ec6d448f --- /dev/null +++ b/servant-client/tinc.yaml @@ -0,0 +1,5 @@ +dependencies: + - name: servant + path: ../servant + - name: servant-server + path: ../servant-server diff --git a/servant-docs/tinc.yaml b/servant-docs/tinc.yaml new file mode 100644 index 00000000..dbf42cc7 --- /dev/null +++ b/servant-docs/tinc.yaml @@ -0,0 +1,3 @@ +dependencies: + - name: servant + path: ../servant diff --git a/servant-examples/tinc.yaml b/servant-examples/tinc.yaml new file mode 100644 index 00000000..10af8970 --- /dev/null +++ b/servant-examples/tinc.yaml @@ -0,0 +1,15 @@ +dependencies: + - name: servant + path: ../servant + - name: servant-server + path: ../servant-server + - name: servant-client + path: ../servant-client + - name: servant-js + path: ../servant-js + - name: servant-lucid + path: ../servant-lucid + - name: servant-docs + path: ../servant-docs + - name: servant-foreign + path: ../servant-foreign diff --git a/servant-foreign/tinc.yaml b/servant-foreign/tinc.yaml new file mode 100644 index 00000000..dbf42cc7 --- /dev/null +++ b/servant-foreign/tinc.yaml @@ -0,0 +1,3 @@ +dependencies: + - name: servant + path: ../servant diff --git a/servant-js/tinc.yaml b/servant-js/tinc.yaml new file mode 100644 index 00000000..15c4a72b --- /dev/null +++ b/servant-js/tinc.yaml @@ -0,0 +1,7 @@ +dependencies: + - name: servant + path: ../servant + - name: servant-server + path: ../servant-server + - name: servant-foreign + path: ../servant-foreign diff --git a/servant-lucid/tinc.yaml b/servant-lucid/tinc.yaml new file mode 100644 index 00000000..dbf42cc7 --- /dev/null +++ b/servant-lucid/tinc.yaml @@ -0,0 +1,3 @@ +dependencies: + - name: servant + path: ../servant diff --git a/servant-mock/tinc.yaml b/servant-mock/tinc.yaml new file mode 100644 index 00000000..ec6d448f --- /dev/null +++ b/servant-mock/tinc.yaml @@ -0,0 +1,5 @@ +dependencies: + - name: servant + path: ../servant + - name: servant-server + path: ../servant-server diff --git a/servant-server/tinc.yaml b/servant-server/tinc.yaml new file mode 100644 index 00000000..dbf42cc7 --- /dev/null +++ b/servant-server/tinc.yaml @@ -0,0 +1,3 @@ +dependencies: + - name: servant + path: ../servant From fccb01907bcb85cf46434c2ffd8e54398e42e795 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 27 Oct 2015 23:19:46 +0800 Subject: [PATCH 3/3] Disable -Werror due to aeson-0.10.0.0 issue --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8056cb98..62501f7a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ install: - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config script: - - for package in $(cat sources.txt); do (cd $package && tinc && cabal configure --enable-tests --ghc-options=-Werror --disable-optimization && cabal build && cabal test) || exit 1; done + - for package in $(cat sources.txt); do (cd $package && tinc && cabal configure --enable-tests --disable-optimization && cabal build && cabal test) || exit 1; done cache: directories: