Skip to content

Commit

Permalink
Merge pull request #29 from BlockScope/fix/libyaml-test-28
Browse files Browse the repository at this point in the history
Use explicit extra-deps in all but latest stack-*.yaml.
  • Loading branch information
philderbeast authored Mar 3, 2019
2 parents e286bb8 + 6361ff7 commit 420c099
Show file tree
Hide file tree
Showing 22 changed files with 122 additions and 139 deletions.
100 changes: 53 additions & 47 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# This Travis job script has been generated by a script via
#
# runghc make_travis_yml_2.hs '--output=.travis.yml' '--config=cabal.haskell-ci' 'hpack-dhall.cabal'
# haskell-ci '--output=.travis.yml' '--config=cabal.haskell-ci' 'hpack-dhall.cabal'
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.1.0.0
#
language: c
sudo: false
dist: xenial

git:
submodules: false # whether to recursively clone submodules
Expand All @@ -16,98 +18,102 @@ cache:
- $HOME/.cabal/store

before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
# remove files that are regenerated by 'cabal update'
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
- rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
- rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx

- rm -rfv $HOME/.cabal/packages/head.hackage
- rm -rfv $CABALHOME/packages/head.hackage

matrix:
include:
- compiler: "ghc-8.6.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.2], sources: [hvr-ghc]}}
- compiler: "ghc-8.6.1"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.1], sources: [hvr-ghc]}}
- compiler: "ghc-8.6.3"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.3], sources: [hvr-ghc]}}
- compiler: "ghc-8.4.4"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}}
- compiler: "ghc-8.4.3"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.3], sources: [hvr-ghc]}}
- compiler: "ghc-8.2.2"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}}

before_install:
- HC=${CC}
- HC=/opt/ghc/bin/${CC}
- HCPKG=${HC/ghc/ghc-pkg}
- unset CC
- CABAL=/opt/ghc/bin/cabal
- CABALHOME=$HOME/.cabal
- export PATH="$CABALHOME/bin:$PATH"
- ROOTDIR=$(pwd)
- mkdir -p $HOME/.local/bin
- "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
- echo $HCNUMVER

install:
- cabal --version
- ${CABAL} --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
- BENCH=${BENCH---enable-benchmarks}
- TEST=${TEST---enable-tests}
- HADDOCK=${HADDOCK-true}
- UNCONSTRAINED=${UNCONSTRAINED-true}
- NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}
- TEST=--enable-tests
- BENCH=--enable-benchmarks
- GHCHEAD=${GHCHEAD-false}
- travis_retry cabal update -v
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
- travis_retry ${CABAL} update -v
- sed -i.bak 's/^jobs:/-- jobs:/' $CABALHOME/config
- rm -fv cabal.project cabal.project.local
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
- (cd /tmp && echo '' | cabal new-repl -w ${HC} --build-dep fail)
- if [ $HCNUMVER -eq 80403 ]; then cabal new-install -w ${HC} -j2 --symlink-bindir=$HOME/.local/bin hlint --constraint='hlint ==2.0.*'; fi
- "printf 'packages: \".\"\\n' > cabal.project"
- grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$'
- if [ $HCNUMVER -eq 80603 ] ; then ${CABAL} new-install -w ${HC} -j2 hlint --constraint='hlint ==2.0.*' ; fi
- rm -f cabal.project
- touch cabal.project
- "printf 'packages: \".\"\\n' >> cabal.project"
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
- touch cabal.project.local
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- hpack-dhall | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(hpack-dhall)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
- cat cabal.project || true
- cat cabal.project.local || true
- if [ -f "./configure.ac" ]; then
(cd "." && autoreconf -i);
fi
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
- rm -f cabal.project.freeze
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
- ${CABAL} new-freeze -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dry
- "cat \"cabal.project.freeze\" | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
- rm "cabal.project.freeze"
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
- rm -rf .ghc.environment.* "."/dist
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)

# 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.
script:
# test that source-distributions can be generated
- cabal new-sdist all
- ${CABAL} new-sdist all
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
- cd ${DISTDIR} || false
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
- "printf 'packages: hpack-dhall-*/*.cabal\\n' > cabal.project"
- rm -f cabal.project
- touch cabal.project
- "printf 'packages: \"hpack-dhall-*/*.cabal\"\\n' >> cabal.project"
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
- touch cabal.project.local
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- hpack-dhall | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(hpack-dhall)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
- cat cabal.project || true
- cat cabal.project.local || true
# this builds all libraries and executables (without tests/benchmarks)
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
- ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all

# build & run tests, build benchmarks
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
- if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all
- if [ "x$TEST" = "x--enable-tests" ]; then ${CABAL} new-test -w ${HC} ${TEST} ${BENCH} all; fi

# hlint
- if [ $HCNUMVER -eq 80403 ]; then (cd hpack-dhall-* && hlint library); fi
- if [ $HCNUMVER -eq 80603 ] ; then (cd hpack-dhall-* && hlint library) ; fi
- if [ $HCNUMVER -eq 80603 ] ; then (cd hpack-dhall-* && hlint library exe/options exe/dhall-hpack-yaml) ; fi
- if [ $HCNUMVER -eq 80603 ] ; then (cd hpack-dhall-* && hlint library exe/options exe/dhall-hpack-json) ; fi
- if [ $HCNUMVER -eq 80603 ] ; then (cd hpack-dhall-* && hlint library exe/options exe/dhall-hpack-dhall) ; fi
- if [ $HCNUMVER -eq 80603 ] ; then (cd hpack-dhall-* && hlint library exe/options exe/dhall-hpack-cabal) ; fi

# haddock
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
- ${CABAL} new-haddock -w ${HC} ${TEST} ${BENCH} all

# Build without installed constraints for packages in global-db
- if $UNCONSTRAINED; then rm -f cabal.project.local; echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks all; else echo "Not building without installed constraints"; fi
- rm -f cabal.project.local; ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all;

# REGENDATA ["--output=.travis.yml","--config=cabal.haskell-ci","hpack-dhall.cabal"]
# EOF
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,6 @@ This can be represented in `package.dhall` as;

With haskell-ci tooling installed, generate the `.travis.yml` setup with;
```
> make-travis-yml --output=.travis.yml --config=cabal.haskell-ci hpack-dhall.cabal
*INFO* Generating Travis-CI config for testing for GHC versions: 8.4.3 8.4.4 8.6.1 8.6.2
> haskell-ci --output=.travis.yml --config=cabal.haskell-ci hpack-dhall.cabal
*INFO* Generating Travis-CI config for testing for GHC versions: 8.2.2 8.4.3 8.4.4 8.6.3
```
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
The [latest version](https://github.com/blockscope/hpack-dhall/blob/master/changelog.md) of this changelog.

## 0.5.2 - Consistent Golden Tests
* Use explicit dependencies to achieve consistent golden tests in all but
stack-8.6.3.yaml.

## 0.5.1 - Minor, bump in hpack version
* Regenerate golden files for the bump in hpack's version:

Expand Down
2 changes: 1 addition & 1 deletion exe/dhall-hpack-cabal/CabalMain.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ parseOptions = O.helper <*> do
pkgFile <- parsePkgFile
force <- parseForce
quiet <- parseQuiet
return (Options {..})
return Options{..}

parserInfo :: O.ParserInfo Command
parserInfo =
Expand Down
2 changes: 1 addition & 1 deletion exe/options/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ newtype Options = Options {pkgFile :: FilePath}
parseOptions :: Parser Options
parseOptions = helper <*> do
pkgFile <- parsePkgFile
return (Options {..})
return Options{..}

parsePkgFile :: Parser FilePath
parsePkgFile =
Expand Down
6 changes: 3 additions & 3 deletions hpack-dhall.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: b3f8d5f1300d63e3eb10dd2b12fac8f38da8deb93e323b4fd95a0ffe9bbad9e9
-- hash: 98b50eed37278c62f016933a31bdfb02a687ae915796045d96e6357a4a826acb

name: hpack-dhall
version: 0.5.1
version: 0.5.2
synopsis: hpack's dhalling
description: Work with hpack's top-level
<https://github.com/sol/hpack#top-level-fields fields> in a Dhall
Expand All @@ -24,7 +24,7 @@ maintainer: Phil de Joux <[email protected]>
copyright: © 2018 Phil de Joux, © 2018 Block Scope Limited
license: BSD3
license-file: LICENSE
tested-with: GHC == 8.4.3, GHC == 8.4.4, GHC == 8.6.1, GHC == 8.6.2
tested-with: GHC == 8.2.2, GHC == 8.4.3, GHC == 8.4.4, GHC == 8.6.3
build-type: Simple
extra-source-files:
package.dhall
Expand Down
8 changes: 4 additions & 4 deletions package.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ let deps =

in let exe-deps =
[ "hpack-dhall", "optparse-applicative" ]

in { name =
"hpack-dhall"
, version =
"0.5.1"
"0.5.2"
, maintainer =
"Phil de Joux <[email protected]>"
, copyright =
Expand All @@ -39,7 +39,7 @@ in let exe-deps =
Work with hpack's top-level
<https://github.com/sol/hpack#top-level-fields fields> in a Dhall
record with the following executables;

* with @dhall-hpack-cabal@ write the @.cabal@ for a @.dhall@ package description.
* with @dhall-hpack-dhall@ show the package description expression, with imports resolved.
* with @dhall-hpack-json@ show the package description as JSON.
Expand All @@ -48,7 +48,7 @@ in let exe-deps =
, github =
"blockscope/hpack-dhall"
, tested-with =
"GHC == 8.4.3, GHC == 8.4.4, GHC == 8.6.1, GHC == 8.6.2"
"GHC == 8.2.2, GHC == 8.4.3, GHC == 8.4.4, GHC == 8.6.3"
, extra-source-files =
[ "package.dhall"
, "changelog.md"
Expand Down
30 changes: 14 additions & 16 deletions stack-8.2.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@ resolver: lts-11.22
packages:
- '.'
extra-deps:
- dhall-1.18.0
- dhall-json-1.2.4
- megaparsec-7.0.1
- repline-0.2.0.0
- serialise-0.2.1.0
- cborg-0.2.1.0
- parser-combinators-1.0.0
- hpack-0.31.0
- infer-license-0.2.0
- Cabal-2.4.0.1
- yaml-0.11.0.0
- libyaml-0.1.0.0
# WARNING: Ignoring out of range dependency (allow-newer enabled):
# yaml-0.11.0.0. dhall-json requires: >=0.5.0 && <0.11
# WARNING: Ignoring out of range dependency (allow-newer enabled):
# Cabal-2.4.0.1. cabal-doctest requires: >=1.10 && <2.3
- dhall-1.20.1@sha256:3377090039ba3560b50515799affc57d74d2d3e57d3f8699bb2a9fc428fa4918
- dhall-json-1.2.6@sha256:dd2073697cc0c73ee3611b596e0c33363afb3a926a148c39de15b5c7b07ecdf4
- hpack-0.31.2@sha256:c86aba85013358c2bea1e602d3582741e4a4393df388c65539d3602b7e6eef8d
- megaparsec-7.0.4@sha256:a7397151601cbe6b8f831f8bdad1a10118dcd6d9a7ee50d6bbdcfbd1181b4ba2
- cborg-json-0.2.1.0@sha256:af9137557002ca5308fe80570a9a29398dfb9708423870875223796760689ac3
- dotgen-0.4.2@sha256:309b7cc8a3593a8e48bee7b53020d5f72db156d58edf78a0214f58fbb84b292b
- infer-license-0.2.0@sha256:98dbe0e8d726fd698f9961e69cc69343f37952b4b7428283d0b8dbe3b09f8125
- serialise-0.2.1.0@sha256:8d6051f64c6ebfaf705195dd0b8dfb667617f2e674b290ed2e44985009e4f951
- repline-0.2.0.0@sha256:0ebbf9a59edb60eeac7e002971d501a81ef633b2dc4db3908d27f30f95e4eac1
- yaml-0.11.0.0@sha256:8303b3e445295f4fe28ee18efe49ef2667f9f88742ce8049db437c6579be425e
- libyaml-0.1.1.0@sha256:b3fcd8c44622c75e054c2267f3fec39a58a311748000310cbc8257a4683d3f02
- Cabal-2.4.1.0@sha256:56c858cf85e8756a94aaf930f2be4c2eaee623f067e7c55394194d3741147ab7
- cborg-0.2.1.0@sha256:6e2c9a4dc3ccd621d799689d6c3ff862c761ffbab4da104874ba04a14c60ac7a
- parser-combinators-1.0.1@sha256:c28576a0851300fdbd9ffa9970c305eb879dc3f7c36907a667233a0fef4268dc
allow-newer: true
local-bin-path: __bin
23 changes: 11 additions & 12 deletions stack-8.4.3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ resolver: lts-12.14
packages:
- '.'
extra-deps:
- dhall-1.18.0
- dhall-json-1.2.4
- megaparsec-7.0.1
- repline-0.2.0.0
- serialise-0.2.1.0
- hpack-0.31.0
- infer-license-0.2.0
- yaml-0.11.0.0
- libyaml-0.1.0.0
# WARNING: Ignoring out of range dependency (allow-newer enabled):
# yaml-0.11.0.0. dhall-json requires: >=0.5.0 && <0.11
allow-newer: true
- dhall-1.20.1@sha256:3377090039ba3560b50515799affc57d74d2d3e57d3f8699bb2a9fc428fa4918
- dhall-json-1.2.6@sha256:dd2073697cc0c73ee3611b596e0c33363afb3a926a148c39de15b5c7b07ecdf4
- hpack-0.31.2@sha256:c86aba85013358c2bea1e602d3582741e4a4393df388c65539d3602b7e6eef8d
- megaparsec-7.0.4@sha256:a7397151601cbe6b8f831f8bdad1a10118dcd6d9a7ee50d6bbdcfbd1181b4ba2
- cborg-json-0.2.1.0@sha256:af9137557002ca5308fe80570a9a29398dfb9708423870875223796760689ac3
- dotgen-0.4.2@sha256:309b7cc8a3593a8e48bee7b53020d5f72db156d58edf78a0214f58fbb84b292b
- infer-license-0.2.0@sha256:98dbe0e8d726fd698f9961e69cc69343f37952b4b7428283d0b8dbe3b09f8125
- serialise-0.2.1.0@sha256:8d6051f64c6ebfaf705195dd0b8dfb667617f2e674b290ed2e44985009e4f951
- repline-0.2.0.0@sha256:0ebbf9a59edb60eeac7e002971d501a81ef633b2dc4db3908d27f30f95e4eac1
- yaml-0.11.0.0@sha256:8303b3e445295f4fe28ee18efe49ef2667f9f88742ce8049db437c6579be425e
- libyaml-0.1.1.0@sha256:b3fcd8c44622c75e054c2267f3fec39a58a311748000310cbc8257a4683d3f02
local-bin-path: __bin
25 changes: 12 additions & 13 deletions stack-8.4.4.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
resolver: lts-12.15
resolver: lts-12.26
packages:
- '.'
extra-deps:
- dhall-1.18.0
- dhall-json-1.2.4
- megaparsec-7.0.1
- repline-0.2.0.0
- serialise-0.2.1.0
- hpack-0.31.0
- infer-license-0.2.0
- yaml-0.11.0.0
- libyaml-0.1.0.0
# WARNING: Ignoring out of range dependency (allow-newer enabled):
# yaml-0.11.0.0. dhall-json requires: >=0.5.0 && <0.11
allow-newer: true
- dhall-1.20.1@sha256:3377090039ba3560b50515799affc57d74d2d3e57d3f8699bb2a9fc428fa4918
- dhall-json-1.2.6@sha256:dd2073697cc0c73ee3611b596e0c33363afb3a926a148c39de15b5c7b07ecdf4
- hpack-0.31.2@sha256:c86aba85013358c2bea1e602d3582741e4a4393df388c65539d3602b7e6eef8d
- megaparsec-7.0.4@sha256:a7397151601cbe6b8f831f8bdad1a10118dcd6d9a7ee50d6bbdcfbd1181b4ba2
- cborg-json-0.2.1.0@sha256:af9137557002ca5308fe80570a9a29398dfb9708423870875223796760689ac3
- dotgen-0.4.2@sha256:309b7cc8a3593a8e48bee7b53020d5f72db156d58edf78a0214f58fbb84b292b
- infer-license-0.2.0@sha256:98dbe0e8d726fd698f9961e69cc69343f37952b4b7428283d0b8dbe3b09f8125
- serialise-0.2.1.0@sha256:8d6051f64c6ebfaf705195dd0b8dfb667617f2e674b290ed2e44985009e4f951
- repline-0.2.0.0@sha256:0ebbf9a59edb60eeac7e002971d501a81ef633b2dc4db3908d27f30f95e4eac1
- yaml-0.11.0.0@sha256:8303b3e445295f4fe28ee18efe49ef2667f9f88742ce8049db437c6579be425e
- libyaml-0.1.1.0@sha256:b3fcd8c44622c75e054c2267f3fec39a58a311748000310cbc8257a4683d3f02
local-bin-path: __bin
23 changes: 0 additions & 23 deletions stack-8.6.1.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion stack-8.6.2.yaml → stack-8.6.3.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: nightly-2018-11-27
resolver: lts-13.9
packages:
- '.'
local-bin-path: __bin
2 changes: 1 addition & 1 deletion stack-dhall.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: nightly-2018-11-27
resolver: lts-13.9
flags: {}
packages: []
work-dir: .stack-work-dhall
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.31.1.
-- This file has been generated from package.yaml by hpack version 0.31.2.
--
-- see: https://github.com/sol/hpack
--
Expand Down
Loading

0 comments on commit 420c099

Please sign in to comment.