Commit 0165f0a7 authored by Oleg Grenrus's avatar Oleg Grenrus

Use hackage-security-0.6

Also in CI setup, install hackage-repo-tool using `cabal new-install`.
And remove slightly confusing cabal.project.travis file.
parent 0741375d
......@@ -35,7 +35,6 @@ import Hackage.Security.Client
import Hackage.Security.Client.Repository.HttpLib
import Hackage.Security.Util.Checked
import Hackage.Security.Util.Pretty
import qualified Hackage.Security.Util.Lens as Lens
{-------------------------------------------------------------------------------
'HttpLib' implementation
......@@ -142,7 +141,14 @@ mkReqHeaders reqHeaders mRange = concat [
finalize (name, strs) = [HTTP.Header name (intercalate ", " (reverse strs))]
insert :: Eq a => a -> [b] -> [(a, [b])] -> [(a, [b])]
insert x y = Lens.modify (Lens.lookupM x) (++ y)
insert x y = modifyAssocList x (++ y)
-- modify the first maching element
modifyAssocList :: Eq a => a -> (b -> b) -> [(a, b)] -> [(a, b)]
modifyAssocList a f = go where
go [] = []
go (p@(a', b) : xs) | a == a' = (a', f b) : xs
| otherwise = p : go xs
{-------------------------------------------------------------------------------
Custom exceptions
......
......@@ -260,8 +260,8 @@ EDIT_DISTANCE_VER="0.2.2.1"; EDIT_DISTANCE_VER_REGEXP="0\.2\.2\.?"
# 0.2.2.*
ED25519_VER="0.0.5.0"; ED25519_VER_REGEXP="0\.0\.?"
# 0.0.*
HACKAGE_SECURITY_VER="0.5.3.0"; HACKAGE_SECURITY_VER_REGEXP="0\.5\.((2\.[2-9]|[3-9])|3)"
# >= 0.5.2 && < 0.6
HACKAGE_SECURITY_VER="0.6.0.0"; HACKAGE_SECURITY_VER_REGEXP="0\.6\."
# >= 0.7.0.0 && < 0.7
TAR_VER="0.5.1.0"; TAR_VER_REGEXP="0\.5\.([1-9]|1[0-9]|0\.[3-9]|0\.1[0-9])\.?"
# >= 0.5.0.3 && < 0.6
DIGEST_VER="0.0.1.2"; DIGEST_REGEXP="0\.0\.(1\.[2-9]|[2-9]\.?)"
......
......@@ -336,7 +336,7 @@ executable cabal
time >= 1.5.0.1 && < 1.10,
transformers >= 0.4.2.0 && < 0.6,
zlib >= 0.5.3 && < 0.7,
hackage-security >= 0.5.2.2 && < 0.6,
hackage-security >= 0.6.0.0 && < 0.7,
text >= 1.2.3 && < 1.3,
parsec >= 3.1.13.0 && < 3.2
......
......@@ -43,7 +43,7 @@ Version: 3.1.0.0
time >= 1.5.0.1 && < 1.10,
transformers >= 0.4.2.0 && < 0.6,
zlib >= 0.5.3 && < 0.7,
hackage-security >= 0.5.2.2 && < 0.6,
hackage-security >= 0.6.0.0 && < 0.7,
text >= 1.2.3 && < 1.3,
parsec >= 3.1.13.0 && < 3.2
......
-- Force error messages to be better
-- Parallel new-build error messages are non-existent.
-- Turn off parallelization to get good errors.
jobs: 1
-- We vendor a copy of hackage-repo-tool so that we can
-- build it reliably. If we eventually get new-install
-- in the bootstrap, this can go away.
optional-packages: hackage-repo-tool-*/
-- hackage-repo-tool has upper bound on Cabal
allow-newer: hackage-repo-tool:Cabal, hackage-repo-tool:time, hackage-repo-tool:directory
-- The -fno-warn-orphans is a hack to make Cabal-1.24
-- build properly (unfortunately the flags here get applied
-- to the dependencies too!)
package Cabal
ghc-options: -Werror -fno-warn-orphans
package cabal-install
ghc-options: -Werror
-- A copy of cabal.project, but with a trimmed down 'packages'
-- field. Needed for LIB_ONLY configurations that can't build cabal-install,
-- only lib:Cabal.
packages: Cabal/ cabal-testsuite/
-- Uncomment to allow picking up extra local unpacked deps:
--optional-packages: */
program-options
-- So us hackers get all the assertion failures early:
--
-- NOTE: currently commented out, see
-- https://github.com/haskell/cabal/issues/3911
--
-- ghc-options: -fno-ignore-asserts
--
-- as a workaround we specify it for each package individually:
package Cabal
ghc-options: -fno-ignore-asserts
package cabal-testsuite
ghc-options: -fno-ignore-asserts
package cabal-install
ghc-options: -fno-ignore-asserts
set -e
HACKAGE_REPO_TOOL_VERSION="0.1.1.1"
CABAL_VERSION="3.1.0.0"
CABAL_INSTALL_VERSION="3.1.0.0"
......@@ -16,7 +15,6 @@ CABAL_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/$ARCH/ghc-$GHCVER/Cabal-${CA
CABAL_TESTSUITE_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/$ARCH/ghc-$GHCVER/cabal-testsuite-${CABAL_VERSION}"
CABAL_INSTALL_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/$ARCH/ghc-$GHCVER/cabal-install-${CABAL_INSTALL_VERSION}"
SOLVER_BENCHMARKS_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/$ARCH/ghc-$GHCVER/solver-benchmarks-${CABAL_VERSION}"
HACKAGE_REPO_TOOL_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/$ARCH/ghc-$GHCVER/hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}/x/hackage-repo-tool"
CABAL_INSTALL_EXE=${CABAL_INSTALL_BDIR}/x/cabal/build/cabal/cabal
# ---------------------------------------------------------------------
......
......@@ -73,9 +73,7 @@ timed cabal update
# Install executables if necessary
# ---------------------------------------------------------------------
#if ! command -v happy; then
timed cabal install $jobs happy
#fi
timed cabal install $jobs happy
# ---------------------------------------------------------------------
# Setup our local project
......@@ -83,16 +81,10 @@ timed cabal update
make cabal-install-monolithic
if [ "x$CABAL_LIB_ONLY" = "xYES" ]; then
cp cabal.project.travis.libonly cabal.project
cp cabal.project.libonly cabal.project
fi
cp cabal.project.local.travis cabal.project.local
# hackage-repo-tool is a bit touchy to install on GHC 8.0, so instead we
# do it via new-build. See also cabal.project.local.travis. The downside of
# doing it this way is that the build product cannot be cached, but
# hackage-repo-tool is a relatively small package so it's good.
timed cabal unpack hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}
# ---------------------------------------------------------------------
# Cabal
# ---------------------------------------------------------------------
......@@ -167,7 +159,7 @@ fi
# test suites are baked into the cabal binary
timed cabal new-build $jobs $CABAL_INSTALL_FLAGS cabal-install:cabal
timed cabal new-build $jobs hackage-repo-tool
timed cabal new-install $jobs hackage-repo-tool --overwrite-policy=always
if [ "x$SKIP_TESTS" = "xYES" ]; then
exit 1;
......@@ -177,7 +169,7 @@ fi
timed ${CABAL_INSTALL_EXE} update
# Big tests
(cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests --builddir=${CABAL_TESTSUITE_BDIR} -j3 --skip-setup-tests --with-cabal ${CABAL_INSTALL_EXE} --with-hackage-repo-tool ${HACKAGE_REPO_TOOL_BDIR}/build/hackage-repo-tool/hackage-repo-tool $TEST_OPTIONS) || exit $?
(cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests --builddir=${CABAL_TESTSUITE_BDIR} -j3 --skip-setup-tests --with-cabal ${CABAL_INSTALL_EXE} --with-hackage-repo-tool hackage-repo-tool $TEST_OPTIONS) || exit $?
# Cabal check
# TODO: remove -main-is and re-enable me.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment