Update dependencies/CI

Summary:
This PR accomplishes several things:

- removes dist-newstyle (local build artifacts should not be checked in)
- extends the .gitignore to include many common build artifacts/editor artifacts
- allow more modern dependencies (upper bounds of many were out of date by one or two years' worth of releases)
- upgrade stack lts (9.2 -> 14.2) to GHC 8.6.5
- regenerate .travis.yml using the now-standard haskell-ci (many haskell core libraries use this), instead of the outdated script that was maintained by hvr; as a precursor to this, the tested-with versions were updated

Reviewed By: patapizza

Differential Revision: D24623967

fbshipit-source-id: 838fe571df0b8d44106349659ce8ce8ab82f0bc6
This commit is contained in:
Daniel Cartwright 2020-10-29 10:56:50 -07:00 committed by Facebook GitHub Bot
parent 7889f396f3
commit 01b812b69c
5 changed files with 189 additions and 96 deletions

50
.gitignore vendored
View File

@ -1,3 +1,49 @@
# object files
*.a
*.o
*.so
# haskell stuff
.ghc.environment.*
dist
dist-*
cabal-dev
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
*.prof
*.hp
*.eventlog
.cabal-sandbox/
cabal.sandbox.config
cabal.config
cabal.project.local
.HTF/
.stack-work/
log/
.idea/
stack.yaml.lock
# vim stuff
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
*~
# nix stuff
result
result-*
*.hi
# make/latexmk stuff
.makefile
*.aux
*.fdb_latexmk
*.fls
*.log
*.out
# misc
tags
log
.idea

View File

@ -1,92 +1,140 @@
# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
# This Travis job script has been generated by a script via
#
# haskell-ci 'travis' 'duckling.cabal'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.10.3
#
version: ~> 1.0
language: c
sudo: false
os: linux
dist: xenial
git:
# whether to recursively clone submodules
submodules: false
cache:
directories:
- $HOME/.cabsnap
- $HOME/.cabal/packages
- $HOME/.cabal/store
- $HOME/.hlint
before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
matrix:
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
# remove files that are regenerated by 'cabal update'
- 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 $CABALHOME/packages/head.hackage
jobs:
include:
# crashes in travis because 2 versions of unix get installed and
# when text-show tries to use TH the wrong one gets linked
# - env: CABALVER=1.24 GHCVER=7.10.3 HAPPYVER=1.19.5 BUILD=cabal
# compiler: ": #GHC 7.10.3"
# addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.3,happy-1.19.5], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=8.0.2
compiler: ": #GHC 8.0.2"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2,happy-1.19.5], sources: [hvr-ghc]}}
- env: CABALVER=2.0 GHCVER=8.2.2
compiler: ": #GHC 8.2.2"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,happy-1.19.5], sources: [hvr-ghc]}}
- env: CABALVER=2.0 GHCVER=8.6.3
compiler: ": #GHC 8.6.3"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.6.3,happy-1.19.5], sources: [hvr-ghc]}}
- compiler: ghc-8.6.5
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.5","cabal-install-3.2"]}}
os: linux
- compiler: ghc-8.4.4
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.4.4","cabal-install-3.2"]}}
os: linux
before_install:
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
- WITHCOMPILER="-w $HC"
- HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
- HCPKG="$HC-pkg"
- unset CC
- export HAPPYVER=1.19.5
- export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
- export PATH=/opt/happy/$HAPPYVER/bin:$PATH
- CABAL=/opt/ghc/bin/cabal
- CABALHOME=$HOME/.cabal
- export PATH="$CABALHOME/bin:$PATH"
- TOP=$(pwd)
- "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
- echo $HCNUMVER
- CABAL="$CABAL -vnormal+nowrap"
- set -o pipefail
- TEST=--enable-tests
- BENCH=--enable-benchmarks
- HEADHACKAGE=false
- rm -f $CABALHOME/config
- |
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
echo "write-ghc-environment-files: always" >> $CABALHOME/config
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
echo "install-dirs user" >> $CABALHOME/config
echo " prefix: $CABALHOME" >> $CABALHOME/config
echo "repository hackage.haskell.org" >> $CABALHOME/config
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
install:
- cabal --version
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
then
zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
$HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
fi
- travis_retry cabal update -v
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
- cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
- sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
# check whether current requested install-plan matches cached package-db snapshot
- if diff -u $HOME/.cabsnap/installplan.txt installplan.txt;
then
echo "cabal build-cache HIT";
rm -rfv .ghc;
cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
else
echo "cabal build-cache MISS";
rm -rf $HOME/.cabsnap;
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
cabal install -j1 --only-dependencies --enable-tests --enable-benchmarks;
fi
# snapshot package-db on cache miss
- if [ ! -d $HOME/.cabsnap ];
then
echo "snapshotting package-db to build-cache";
mkdir $HOME/.cabsnap;
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
fi
# 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.
- ${CABAL} --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
- |
echo "program-default-options" >> $CABALHOME/config
echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
- cat $CABALHOME/config
- rm -fv cabal.project cabal.project.local cabal.project.freeze
- travis_retry ${CABAL} v2-update -v
# Generate cabal.project
- rm -rf cabal.project cabal.project.local cabal.project.freeze
- touch cabal.project
- |
echo "packages: ." >> cabal.project
- echo 'package duckling' >> cabal.project
- "echo ' ghc-options: -Werror=missing-methods' >> cabal.project"
- |
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(duckling)$' || true) | 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
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
- rm cabal.project.freeze
- travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
- travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
script:
- if [ -f configure.ac ]; then autoreconf -i; fi
- cabal configure --enable-tests -v2 # -v2 provides useful information for debugging
- cabal build -j1 # this builds all libraries and executables (including tests/benchmarks)
- travis_wait cabal test -j1 --show-details=always
- cabal check
- cabal sdist # tests that a source-distribution can be generated
# Check that the resulting source distribution can be built & installed.
# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
# `cabal install --force-reinstalls dist/*-*.tar.gz`
# Building it again doubles the time and it's currently timing out on Travis.
# It's also not that useful at the moment.
#- SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
# (cd dist && cabal install --force-reinstalls "$SRC_TGZ")
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
# Packaging...
- ${CABAL} v2-sdist all
# Unpacking...
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
- cd ${DISTDIR} || false
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
- PKGDIR_duckling="$(find . -maxdepth 1 -type d -regex '.*/duckling-[0-9.]*')"
# Generate cabal.project
- rm -rf cabal.project cabal.project.local cabal.project.freeze
- touch cabal.project
- |
echo "packages: ${PKGDIR_duckling}" >> cabal.project
- echo 'package duckling' >> cabal.project
- "echo ' ghc-options: -Werror=missing-methods' >> cabal.project"
- |
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(duckling)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
- cat cabal.project || true
- cat cabal.project.local || true
# Building...
# this builds all libraries and executables (without tests/benchmarks)
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
# Building with tests and benchmarks...
# build & run tests, build benchmarks
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
# Testing...
- ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
# cabal check...
- (cd ${PKGDIR_duckling} && ${CABAL} -vnormal check)
# haddock...
- ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
# Building without installed constraints for packages in global-db...
- rm -f cabal.project.local
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
# REGENDATA ("0.10.3",["travis","duckling.cabal"])
# EOF

Binary file not shown.

View File

@ -22,9 +22,8 @@ build-type: Simple
stability: alpha
cabal-version: >=1.10
tested-with:
GHC==8.0.2,
GHC==8.2.2,
GHC==8.6.3
GHC==8.4.4,
GHC==8.6.5
extra-source-files: README.md
@ -829,17 +828,17 @@ library
build-depends: base >= 4.8.2 && < 5.0
, array >= 0.5.1.1 && < 0.6
, attoparsec >= 0.13.1.0 && < 0.14
, aeson >= 0.11.3.0 && < 1.5
, aeson >= 0.11.3.0 && < 1.6
, bytestring >= 0.10.6.0 && < 0.11
, containers >= 0.5.6.2 && < 0.7
, deepseq >= 1.4.1.1 && < 1.5
, dependent-sum >= 0.3.2.2 && < 0.5
, extra >= 1.4.10 && < 1.7
, hashable >= 1.2.4.0 && < 1.3
, regex-base >= 0.93.2 && < 0.94
, regex-pcre >= 0.94.4 && < 0.95
, extra >= 1.4.10 && < 1.8
, hashable >= 1.2.4.0 && < 1.4
, regex-base >= 0.93.2 && < 0.95
, regex-pcre >= 0.94.4 && < 0.96
, text >= 1.2.2.1 && < 1.3
, text-show >= 2.1.2 && < 3.8
, text-show >= 2.1.2 && < 3.9
, time >= 1.5.0.1 && < 2
, timezone-series >= 0.1.5.1 && < 0.2
, unordered-containers >= 0.2.7.2 && < 0.3
@ -1160,7 +1159,7 @@ executable duckling-example-exe
, text
, text-show
, time
, timezone-olson >= 0.1.7 && < 0.2
, timezone-olson >= 0.1.7 && < 0.3
, timezone-series
, unordered-containers
default-language: Haskell2010
@ -1195,7 +1194,7 @@ executable duckling-request-sample
, filepath >= 1.4.0.0 && < 1.5
, text
, time
, timezone-olson >= 0.1.7 && < 0.2
, timezone-olson >= 0.1.7 && < 0.3
, timezone-series
, unordered-containers
default-language: Haskell2010
@ -1214,7 +1213,7 @@ executable duckling-expensive
, filepath >= 1.4.0.0 && < 1.5
, text
, time
, timezone-olson >= 0.1.7 && < 0.2
, timezone-olson >= 0.1.7 && < 0.3
, timezone-series
, unordered-containers
default-language: Haskell2010

View File

@ -1,4 +1,4 @@
resolver: lts-9.10
resolver: lts-14.20
packages:
- '.'