...
 
Commits (193)
......@@ -19,8 +19,8 @@ stages:
- deploy
variables:
# Commit of ghc/ci-images repository from which to pull Docker images
DOCKER_REV: 6d19c3adc1f5c28c82aed8c5b1ac40931ac60f3f
# Which nixos/nix Docker image tag to use
DOCKER_TAG: "2.3"
# Default GHC bindist
GHC_TARBALL: "https://gitlab.haskell.org/api/v4/projects/1/jobs/artifacts/master/raw/ghc-x86_64-fedora27-linux.tar.xz?job=validate-x86_64-linux-fedora27"
......@@ -57,15 +57,27 @@ build-master:
extends: .build
variables:
GHC_TARBALL: "https://gitlab.haskell.org/api/v4/projects/1/jobs/artifacts/master/raw/ghc-x86_64-fedora27-linux.tar.xz?job=validate-x86_64-linux-fedora27"
EXTRA_HC_OPTS: "-dcore-lint -ddump-timings"
only:
- branches
- merge_requests
# Build against the 8.8 branch
build-8.8:
# Build against the 8.10 branch
build-8.10:
extends: .build
variables:
GHC_TARBALL: "https://gitlab.haskell.org/api/v4/projects/1/jobs/artifacts/ghc-8.8/raw/ghc-8.8.1-x86_64-unknown-linux.tar.xz?job=validate-x86_64-linux-fedora27"
GHC_TARBALL: "https://gitlab.haskell.org/api/v4/projects/1/jobs/artifacts/ghc-8.10/raw/ghc-x86_64-fedora27-linux.tar.xz?job=validate-x86_64-linux-fedora27"
EXTRA_HC_OPTS: "-dcore-lint -ddump-timings"
only:
- branches
- merge_requests
# Build against the 9.0 branch
build-9.0:
extends: .build
variables:
GHC_TARBALL: "https://gitlab.haskell.org/api/v4/projects/1/jobs/artifacts/ghc-9.0/raw/ghc-x86_64-fedora27-linux.tar.xz?job=validate-x86_64-linux-fedora27"
EXTRA_HC_OPTS: "-dcore-lint"
only:
- branches
- merge_requests
......@@ -75,16 +87,25 @@ build-8.8:
tags:
- x86_64-linux
- head.hackage
image: nixos/nix
image: "nixos/nix:$DOCKER_TAG"
cache:
key: build-HEAD
paths:
- store.nar
before_script:
- |
if [ -e store.nar ]; then
echo "Extracting cached Nix store..."
nix-store --import -vv < store.nar || echo "invalid cache"
else
echo "No cache found"
fi
script:
# Install GHC
- echo "Bindist tarball is $GHC_TARBALL"
- |
nix build \
......@@ -92,28 +113,29 @@ build-8.8:
--argstr url $GHC_TARBALL \
--out-link ghc \
ghcHEAD
- GHC=`pwd`/ghc/bin/ghc
- rm -Rf $HOME/.cabal/pacakages/local tmp; mkdir -p tmp; cd tmp
- export GHC=`pwd`/ghc/bin/ghc
- rm -Rf $HOME/.cabal/packages/local ci/run
# Build CI executable
- |
EXTRA_OPTS="--cabal-option=-j$CPUS" # Use cabal's build parallelism
if [ -n "$EXTRA_HC_OPTS" ]; then
EXTRA_OPTS="$EXTRA_OPTS --ghc-option=\"$EXTRA_HC_OPTS\""
fi
nix-build ./ci -j$CPUS --no-build-output
nix-store --export \
$(nix-store -qR --include-outputs \
$(nix-instantiate --quiet ./ci)) \
> store.nar
# Test it
- nix run -f ./ci -c run-ci
nix eval --raw -f ../ci cabalDepsSrc > deps.cabal.project
nix run -f ../ci -c \
head-hackage-ci \
test-patches \
--extra-cabal-fragment=$(pwd)/deps.cabal.project \
--patches=../patches \
--with-compiler=$GHC \
$EXTRA_OPTS
- nix run -f ../ci -c xz results.json
after_script:
- ls -lh
- |
nix run -f ./ci -c \
tar -cJf results.tar.xz -C ci/run \
results.json logs compiler-info
artifacts:
when: always
paths:
- results.json.xz
- results.tar.xz
# Build and deploy a Hackage repository
update-repo:
......@@ -123,7 +145,7 @@ update-repo:
- x86_64-linux
- head.hackage
image: nixos/nix
image: "nixos/nix:$DOCKER_TAG"
variables:
KEYS_TARBALL: https://downloads.haskell.org/ghc/head.hackage-keys.tar.enc
......@@ -135,11 +157,9 @@ update-repo:
script:
- nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
- nix-channel --update
- nix build -f scripts/build-repo.nix
- nix run -f scripts/build-repo.nix -c build-repo.sh extract-build-repo
- nix run -f '<nixpkgs>' gnutar -c tar -zxf logs.tar.gz
- mv logs repo
- cp summary.dot.svg repo
- nix build -f ci/default.nix
- nix run -f ci/default.nix -c build-repo.sh extract-keys
- nix run -f ci/default.nix -c build-repo.sh build-repo
dependencies:
- build-master
......@@ -156,7 +176,7 @@ pages:
tags:
- x86_64-linux
- head.hackage
image: nixos/nix
image: "nixos/nix:$DOCKER_TAG"
script:
- mv repo public
dependencies:
......
......@@ -10,31 +10,24 @@ existing Hackage package(s).
you submit a PR).
- The patches SHOULD work with at least GHC HEAD and the most recent
stable released GHC version (currently this means with GHC 8.8.1 and
GHC 8.9).
stable released GHC version (currently this means with GHC 8.10.2 and
GHC 9.1).
- The patches SHOULD ideally result in the same code being compiled,
as one of the main purposes of these patches is to make regression
testing possible. I.e. try to avoid conditional compilation.
- If only the `.cabal` file needs to be modified, a `.cabal` file
SHOULD be used instead of a `.patch` file. If the changes to the
`.cabal` file are too invasive (e.g. removing modules, changing the
structure of the package etc), a `.patch` file must be used.
## How this works
This repo contains `<pkg-id>.patch` and `<pkg-id>.cabal` files in the
This repo contains `<pkg-id>.patch` files in the
[`patches/`](./patches/) folder (where `<pkg-id>` refers to a specific
release of a package, e.g. `lens-4.15.3`).
Once merged to `master`, all package releases whose `<pkg-id>` is
mentioned will enter the *HEAD.hackage* package index; if there is a
`.patch` file, the respective releases tarballs are patched
(i.e. mutated!). If there is a `.cabal` file, it is included as a
revision in the package index. Consequently, if there is only a
`.cabal` file and no `.patch` file, the original source `.tar.gz` is
included in verbatim (i.e. *not* mutated).
(i.e. mutated!).
If this operation succeeds, the `HEAD.hackage` package index at
http://HEAD.hackage.haskell.org/ is updated to contain the new index
......@@ -49,6 +42,20 @@ allowing to maximise sharing via the nix-style package-db cache store.
## How to use
If you know what you are looking for, here it is:
```cabal
repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
secure: True
key-threshold: 3
root-keys:
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
```
### As an add-on remote repository
......@@ -144,41 +151,28 @@ $ nix build -f ./. --arg ghc "(import ghc-from-source.nix {ghc-path=$GHC_TREE;})
```
### GitLab CI
[GHC's GitLab instance](https://gitlab.haskell.org/ghc/head.hackage) uses
GitLab CI and `nix` to build a subset of the head.hackage package set using GHC
snapshots.
GHC's GitLab instance uses GitLab CI and the `head-hackage-ci` tool (contained
in the `ci/` directory) to test the `head.hackage` patchset against GHC releases
and snapshots.
To run a similar build locally simply download a binary distribution from a
`x86_64-fedora27-linux` CI job and run:
To run a similar build locally start by downloading and installing a binary
distribution appropriate for your distribution and then call the `run-ci` script:
```
$ export GHC_TARBALL=./ghc-x86_64-fedora27-linux.tar.xz
# for extra correctness assurance...
$ export EXTRA_HC_OPTS=-dcore-lint
$ scripts/build-nix.sh
$ ./run-ci
```
This will build the set of packages defined by the `testedPackages` list in
`scripts/build-all.nix`.
After building `testedPackages` (allowing for failures) the script job runs
`scripts/summarize.py`, which produces a few artifacts:
This will build all packages having patches and produce a textual summary, as
well as a JSON file (`result.json`) describing the outcome.
* a JSON summary (`summary.json`) which includes the full dependency graph as
well as which package builds failed
* a DOT graph (`summary.dot`) showing the package depedencies and their build
success. This can be rendered with `scripts/render-graph.sh`.
* a directory (`./logs`) of build logs
Note that `build-nix.sh` can also be used to build packages not included in
`testedPackages`:
```
$ scripts/build-nix.sh pandoc
```
### Hackage repository
[GHC's GitLab instance](https://gitlab.haskell.org/ghc/head.hackage) uses
GitLab CI to deploy a Hackage repository with the patches provided by
`head.hackage`. See the [repository]() for usage instructions.
GHC's GitLab instance uses GitLab CI to deploy a Hackage repository with the
patches provided by `head.hackage`. See the
[repository](http://ghc.gitlab.haskell.org/head.hackage/) for usage
instructions.
### Travis CI
......
run
dist
dist-newstyle
......@@ -22,6 +22,7 @@ bootPkgs = S.fromList
, "Cabal"
, "ghc"
, "ghc-prim"
, "integer-gmp"
]
allowNewer :: S.Set Cabal.PackageName -> Doc
......
# head.hackage CI driver
This is the application which drives GHC's `head.hackage` continuous
integration infrastructure, namely `head-hackage-ci`. The general goals here
are three-fold:
1. test that the patches in the `head.hackage` repository build
2. use these patches to smoke-test GHC pre-releases and nightly builds
3. provide the patches as a Hackage repository
(<https://ghc.gitlab.haskell.org/head-hackage>) for consumption by end-users
We accomplish this via the `head-hackage-ci` executable. This executable has
two modes:
* `test-patches` is the primary driver of the CI testing process
* `make-constraints` is a utility for producing `cabal-install` constraints
to ensure that only patched versions of packages are used in install plans
Naturally, many Haskell packages have dependencies on native libraries.
`head-hackage-ci` supports two ways of providing these libraries:
* *from the host system*: Here we just rely on the host system to provide
native libraries; it is up to the user to ensure that the necessary packages
are installed.
* *from nixpkgs*: Here we use [nix][nix] and the [nixpkgs][nixpkgs] package set
to provide native libraries. These dependencies are defined in
`ci/build-deps.nix`. This mode is
[nix]: https://nixos.org/nix/
[nixpkgs]: https://github.com/NixOS/nixpkgs
## Test procedure
The testing part of the CI process (goals (1) and (2) above) uses `head-hackage-ci`'s
`test-patches` mode and some shell scripts (namely `ci/config.sh` and
`ci/build-repo.sh`) (and in the case of a Nix-based build, `ci/build-deps.nix`).
The below is all orchestrated by `run-ci.sh`:
1. Call `ci/config.sh` to determine the configuration of the run. This does
the following:
1. Identify the version of the compiler being tested (provided by the user
via the `GHC` environment variable)
1. Use the compiler version to find the set of packages
that we expected to be broken.
1. Build a set of command-line arguments destined for `head-hackage-ci`
from the broken-package set above and a set of "extra" packages
defined in `config.sh`
1. If we are using `nixpkgs` to get native libraries: compute a
`cabal.project` fragment from the dependency information in
`ci/build-deps.nix` (this logic lives in `ci/default.nix`).
1. Call `head-hackage-ci test-patches` with the computed arguments. This does the following:
1. Determine the set of packages to test (determined by the contents of the
`patches/` directory and additional packages provided via the
`--extra-package` flag)
1. Build a local Hackage repository of patched packages using the
`build-repo.sh` script (which itself depends upon
`hackage-repo-overlay-tool` and `hackage-overlay-tool`)
1. Build a `cabal.project` file containing configuration (e.g. the location
of the local repository, the location of the compiler, where native
dependencies are found, etc.)
1. Call `cabal v2-update` to inform `cabal` of the patched package repository
1. For each package to test:
1. Create a new working directory
1. Copy the previously constructed `cabal.project` into our working directory
1. Construct a dummy Cabal package depending only on the package under test
1. Call `cabal new-build` to build the package
1. Examine the state of `plan.json` and the cabal `logs` directory to work out
the outcome of the build
1. Write a JSON report (of type `Types.RunResult ()`) to `result.json`
1. Examine the failed units and determine whether there were any unexpected failures.
This diff is collapsed.
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Types
( RunResult(..)
, runResultUnits
, TestedPatch(..)
, PackageResult(..)
, BuildInfo(..)
, BuildResult(..)
, LogOutput(..)
, CompilerInfo(..)
) where
import Cabal.Plan
......@@ -29,41 +34,59 @@ data BuildInfo
deriving anyclass (ToJSON, FromJSON)
-- | The result of a unit build.
data BuildResult
= BuildSucceeded { buildLog :: T.Text }
data BuildResult log
= BuildSucceeded { buildLog :: log }
-- ^ the build succeeded.
| BuildPreexisted
-- ^ the unit pre-existed in the global package database.
| BuildFailed { buildLog :: T.Text }
| BuildFailed { buildLog :: log }
-- ^ the build failed
| BuildNotAttempted
-- ^ the build was not attempted either because a dependency failed or it
-- is an executable or testsuite component
deriving stock (Show, Generic)
deriving stock (Show, Generic, Functor, Foldable, Traversable)
deriving anyclass (ToJSON, FromJSON)
-- | The result of an attempt to tested a patch
data PackageResult
data PackageResult log
= PackagePlanningFailed { planningError :: T.Text }
-- ^ Our attempt to build the package resulting in no viable install plan.
| PackageResult { packageBuilt :: Bool
, units :: M.Map UnitId (BuildInfo, BuildResult)
, units :: M.Map UnitId (BuildInfo, BuildResult log)
}
-- ^ We attempted to build the package.
deriving stock (Show, Generic)
deriving stock (Show, Generic, Functor, Foldable, Traversable)
deriving anyclass (ToJSON, FromJSON)
-- | Information about a patch which we tested.
data TestedPatch
data TestedPatch log
= TestedPatch { patchedPackageName :: PkgName
, patchedPackageVersion :: Ver
, patchedPackageResult :: PackageResult
, patchedPackageResult :: PackageResult log
}
deriving stock (Show, Generic)
deriving stock (Show, Generic, Functor, Foldable, Traversable)
deriving anyclass (ToJSON, FromJSON)
-- | The result of a CI run.
data RunResult
= RunResult { testedPatches :: [TestedPatch] }
data RunResult log
= RunResult { testedPatches :: [TestedPatch log]
, compilerInfo :: CompilerInfo
}
deriving stock (Show, Generic, Functor, Foldable, Traversable)
deriving anyclass (ToJSON, FromJSON)
runResultUnits :: RunResult log -> M.Map UnitId (BuildInfo, BuildResult log)
runResultUnits runResult = M.unions
[ units
| tpatch <- testedPatches runResult
, PackageResult _ units <- pure $ patchedPackageResult tpatch
]
-- | Logged output from a build.
newtype LogOutput = LogOutput { getLogOutput :: T.Text }
deriving stock (Eq, Ord, Show)
deriving newtype (ToJSON, FromJSON)
newtype CompilerInfo = CompilerInfo [(String, String)]
deriving stock (Show, Generic)
deriving anyclass (ToJSON, FromJSON)
{ pkgs }:
let
# Maps Haskell package names to a list of their native library dependency
# attributes.
pkgDeps= with pkgs;
{
zlib = [ zlib ];
digest = [ zlib ];
};
mkCabalFragment = pkgName: deps:
with pkgs.lib;
let
libDirs = concatStringsSep " " (map (dep: getOutput "lib" dep + "/lib") deps);
includeDirs = concatStringsSep " " (map (dep: getOutput "dev" dep + "/include") deps);
in ''
package ${pkgName}
extra-lib-dirs: ${libDirs}
extra-include-dirs: ${includeDirs}
'';
in
pkgs.lib.concatStringsSep "\n" (pkgs.lib.mapAttrsToList mkCabalFragment pkgDeps)
# Maps Haskell package names to a list of the Nixpkgs attributes corresponding
# to their native library dependencies.
with pkgs;
{
zlib = [ zlib ];
digest = [ zlib ];
regex-pcre = [ pcre ];
bzlib = [ bzip2 ];
hmatrix = [ blas liblapack ];
hexpat = [ expat ];
}
......@@ -164,12 +164,13 @@ build_repo() {
mkdir -p repo/package
cp $HOME/.cabal/packages/hackage.haskell.org/acme-box/0.0.0.0/acme-box-0.0.0.0.tar.gz repo/package
cp -R $PATCHES patches
mkdir -p tmp
cp -R $PATCHES tmp/patches
hackage-repo-tool bootstrap --keys=./keys --repo=./repo
mkdir -p template patches.cache
mkdir -p template tmp/patches.cache
tool \
--patches=./patches \
--patches=./tmp/patches \
--repo-cache=./cache \
--keys=./keys \
--repo-name=head.hackage \
......@@ -178,15 +179,13 @@ build_repo() {
build_constraints > repo/cabal.constraints
build_index
rm -R tmp
}
case $1 in
gen-keys) gen_keys_tarball ;;
extract-keys) extract_keys_tarball ;;
build-repo) build_repo ;;
extract-build-repo)
extract_keys_tarball
build_repo ;;
build-constraints) build_constraints ;;
build-repository-blurb) build_repository_blurb ;;
build-index)
......
packages: .
source-repository-package
type: git
location: https://github.com/bgamari/hackage-overlay-repo-tool
tag: 18eb61c830ad908d36d343f400a1588af6b9a03a
# vi: set filetype=sh
# Packages expected not to build due to GHC bugs. This is `source`'d by the CI
# script and the arguments in BROKEN_ARGS are added to the hackage-ci
# command-line.
# Mark the named package as broken.
#
# Usage:
# broken $pkg_name $ghc_ticket_number
#
function broken() {
pkg_name="$1"
ticket="$2"
echo "Marking $pkg_name as broken due to #$ticket"
EXTRA_OPTS="$EXTRA_OPTS --expect-broken=$pkg_name"
}
function only_package() {
echo "Adding $@ to --only package list"
for pkg in $@; do
EXTRA_OPTS="$EXTRA_OPTS --only=$pkg"
done
}
# Return the version number of the most recent release of the given package
function latest_version() {
pkg=$1
curl -s -H "Accept: application/json" -L -X GET http://hackage.haskell.org/package/$pkg/preferred | jq '.["normal-version"] | .[0]' -r
}
# Add a package to the set of packages that lack patches but are nevertheless
# tested.
function extra_package() {
pkg_name="$1"
version="$2"
if [ -z "$version" ]; then
version=$(latest_version $pkg_name)
fi
echo "Adding $pkg_name-$version to extra package set"
EXTRA_OPTS="$EXTRA_OPTS --extra-package=$pkg_name==$version"
}
# Mark a package to be declared with build-tool-depends, not build-depends.
# This is necessary for packages that do not have a library component.
function build_tool_package() {
pkg_name="$1"
echo "Adding $pkg_name as a build-tool package"
EXTRA_OPTS="$EXTRA_OPTS --build-tool-package=$pkg_name"
}
if [ -z "$GHC" ]; then GHC=ghc; fi
function ghc_version() {
$GHC --version | sed 's/.*version \([0-9]*\.\([0-9]*\.\)*\)/\1/'
}
function ghc_commit() {
$GHC --print-project-git-commit-id
}
# ======================================================================
# The lists begin here
#
# For instance:
#
# broken "lens" 17988
version="$(ghc_version)"
commit="$(ghc_commit)"
echo "Found GHC $version, commit $commit."
case $version in
8.10.*)
# package ticket
;;
9.0.*)
# package ticket
;;
9.1.*)
# package ticket
;;
*)
echo "No broken packages for GHC $version"
;;
esac
# Extra packages
# ==============
#
# These are packages which we don't have patches for but want to test anyways.
extra_package lens
extra_package aeson
extra_package criterion
extra_package scotty
extra_package generic-lens
extra_package microstache
extra_package singletons
extra_package servant
# Build-tool packages
build_tool_package alex
# Quick build configuration
# =========================
#
# If $QUICK is defined we build the "quick" configuration, which builds a small
# subset of the overall package set. We do this during the merge request
# validation pipeline.
if [ -n "$QUICK" ]; then
only_package Cabal
only_package microlens
only_package free
only_package optparse-applicative
fi
......@@ -17,29 +17,48 @@ let
src = fetchFromGitHub {
owner = "bgamari";
repo = "hackage-overlay-repo-tool";
rev = "18eb61c830ad908d36d343f400a1588af6b9a03a";
sha256 = "1y1fw5x9lyd533lm67s7iyzb4640y8lya11sdjia0yd1j5if6s40";
rev = "7aac81e9bc468b103dd78b9c662672c86fe236f7";
sha256 = "0i4iw8nbhvc2xx05c0hbnnjyhap3b4xsclmxnmfa6dsa2ym02jc0";
};
in haskellPackages.callCabal2nix "hackage-overlay-repo-tool" src {};
head-hackage-ci =
haskellPackages.callCabal2nix "head-hackage-ci" ./. {};
let
src = nixpkgs.nix-gitignore.gitignoreSource [] ./.;
in haskellPackages.callCabal2nix "head-hackage-ci" src {};
buildDepsFragment =
let
buildDeps = import ./build-deps.nix { pkgs = nixpkgs; };
buildDeps = import ./build-deps.nix { pkgs = nixpkgs; };
mkCabalFragment = pkgName: deps:
with pkgs.lib;
let
libDirs = concatStringsSep " " (map (dep: getOutput "lib" dep + "/lib") deps);
includeDirs = concatStringsSep " " (map (dep: getOutput "dev" dep + "/include") deps);
in ''
package ${pkgName}
extra-lib-dirs: ${libDirs}
extra-include-dirs: ${includeDirs}
'';
in
pkgs.lib.concatStringsSep "\n"
(pkgs.lib.mapAttrsToList mkCabalFragment buildDeps);
buildDepsFile = pkgs.writeText "deps.cabal.project" buildDeps;
buildDepsFile = pkgs.writeText "deps.cabal.project" buildDepsFragment;
build-repo =
let
deps = [
bash curl gnutar findutils patch rsync openssl
cabal-install ghc gcc binutils-unwrapped pwgen gnused
hackage-repo-tool overlay-tool python3
hackage-repo-tool overlay-tool python3 jq
git # cabal-install wants this to fetch source-repository-packages
];
in
runCommand "repo" {
nativeBuildInputs = [ makeWrapper ];
cabalDepsSrc = buildDeps;
cabalDepsSrc = buildDepsFragment;
} ''
mkdir -p $out/bin
makeWrapper ${head-hackage-ci}/bin/head-hackage-ci $out/bin/head-hackage-ci \
......@@ -48,6 +67,14 @@ let
makeWrapper ${./build-repo.sh} $out/bin/build-repo.sh \
--prefix PATH : ${stdenv.lib.makeBinPath deps}:$out/bin
makeWrapper ${../run-ci} $out/bin/run-ci \
--prefix PATH : ${stdenv.lib.makeBinPath deps}:$out/bin \
--set USE_NIX 1 \
--set CI_CONFIG ${./config.sh}
makeWrapper ${./find-job.sh} $out/bin/find-job \
--prefix PATH : ${stdenv.lib.makeBinPath deps}:$out/bin
makeWrapper ${xz}/bin/xz $out/bin/xz
'';
in
......
#!/usr/bin/env bash
set -e
project_id=$1
pipeline_id=$2
job_name=$3
# Access token is a protected environment variable in the head.hackage project and
# is necessary for this query to succeed. Sadly job tokens only seem to
# give us access to the project being built.
curl \
--silent --show-error \
-H "Private-Token: $ACCESS_TOKEN" \
"https://gitlab.haskell.org/api/v4/projects/$project_id/pipelines/$pipeline_id/jobs?scope[]=success" \
> resp.json
job_id=$(jq ". | map(select(.name == \"$job_name\")) | .[0].id" < resp.json)
if [ "$job_id" = "null" ]; then
echo "Error finding job $job_name for $pipeline_id in project $project_id:" >&2
cat resp.json >&2
rm resp.json
exit 1
else
rm resp.json
echo -n "$job_id"
fi
diff --git a/Cabal.cabal b/Cabal.cabal
index b97d346..bbe236e 100644
--- a/Cabal.cabal
+++ b/Cabal.cabal
@@ -1,5 +1,6 @@
name: Cabal
version: 2.4.1.0
+x-revision: 2
copyright: 2003-2018, Cabal Development Team (see AUTHORS file)
license: BSD3
license-file: LICENSE
@@ -183,7 +184,7 @@ flag bundled-binary-generic
library
build-depends:
array >= 0.4.0.1 && < 0.6,
- base >= 4.6 && < 5,
+ base >= 4.8 && < 4.13,
bytestring >= 0.10.0.0 && < 0.11,
containers >= 0.5.0.0 && < 0.7,
deepseq >= 1.3.0.1 && < 1.5,
diff --git a/Distribution/Compat/Prelude.hs b/Distribution/Compat/Prelude.hs
index d032825..ecffbbc 100644
--- a/Distribution/Compat/Prelude.hs
+++ b/Distribution/Compat/Prelude.hs
@@ -140,7 +140,7 @@ import qualified Text.PrettyPrint as Disp
import qualified Prelude as OrigPrelude
import Distribution.Compat.Stack
-type IO a = WithCallStack (OrigPrelude.IO a)
+type IO a = OrigPrelude.IO a
type NoCallStackIO a = OrigPrelude.IO a
-- | New name for 'Text.PrettyPrint.<>'
diff --git a/Distribution/Compat/ReadP.hs b/Distribution/Compat/ReadP.hs
index 1f5a989..e314592 100644
--- a/Distribution/Compat/ReadP.hs
+++ b/Distribution/Compat/ReadP.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
-----------------------------------------------------------------------------
-- |
@@ -113,7 +114,9 @@ instance Monad (P s) where
(Result x p) >>= k = k x `mplus` (p >>= k)
(Final r) >>= k = final [ys' | (x,s) <- r, ys' <- run (k x) s]
+#if !(MIN_VERSION_base(4,13,0))
fail = Fail.fail
+#endif
instance Fail.MonadFail (P s) where
fail _ = Fail
@@ -172,7 +175,9 @@ instance s ~ Char => Alternative (Parser r s) where
instance Monad (Parser r s) where
return = pure
+#if !(MIN_VERSION_base(4,13,0))
fail = Fail.fail
+#endif
R m >>= f = R (\k -> m (\a -> let R m' = f a in m' k))
instance Fail.MonadFail (Parser r s) where
diff --git a/Distribution/FieldGrammar/FieldDescrs.hs b/Distribution/FieldGrammar/FieldDescrs.hs
index 4bd50d4..ce85fc0 100644
--- a/Distribution/FieldGrammar/FieldDescrs.hs
+++ b/Distribution/FieldGrammar/FieldDescrs.hs
@@ -44,7 +44,7 @@ fieldDescrPretty (F m) fn = pPretty <$> Map.lookup fn m
-- | Lookup a field value parser.
fieldDescrParse :: P.CabalParsing m => FieldDescrs s a -> String -> Maybe (s -> m s)
-fieldDescrParse (F m) fn = pParse <$> Map.lookup fn m
+fieldDescrParse (F m) fn = (\f -> pParse f) <$> Map.lookup fn m
fieldDescrsToList
:: P.CabalParsing m
diff --git a/Distribution/ParseUtils.hs b/Distribution/ParseUtils.hs
index 0e79049..f4b805c 100644
--- a/Distribution/ParseUtils.hs
+++ b/Distribution/ParseUtils.hs
@@ -19,6 +19,7 @@
-- This module is meant to be local-only to Distribution...
{-# OPTIONS_HADDOCK hide #-}
+{-# LANGUAGE CPP #-}
{-# LANGUAGE Rank2Types #-}
module Distribution.ParseUtils (
LineNo, PError(..), PWarning(..), locatedErrorMsg, syntaxError, warning,
@@ -107,7 +108,9 @@ instance Monad ParseResult where
ParseOk ws x >>= f = case f x of
ParseFailed err -> ParseFailed err
ParseOk ws' x' -> ParseOk (ws'++ws) x'
+#if !(MIN_VERSION_base(4,13,0))
fail = Fail.fail
+#endif
instance Fail.MonadFail ParseResult where
fail s = ParseFailed (FromString s Nothing)
diff --git a/Distribution/Parsec/Class.hs b/Distribution/Parsec/Class.hs
index d65ea54..d182360 100644
--- a/Distribution/Parsec/Class.hs
+++ b/Distribution/Parsec/Class.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
@@ -55,7 +56,7 @@ class Parsec a where
--
-- * knows @cabal-version@ we work with
--
-class (P.CharParsing m, MonadPlus m) => CabalParsing m where
+class (P.CharParsing m, MonadPlus m, Fail.MonadFail m) => CabalParsing m where
parsecWarning :: PWarnType -> String -> m ()
parsecHaskellString :: m String
@@ -116,7 +117,9 @@ instance Monad ParsecParser where
(>>) = (*>)
{-# INLINE (>>) #-}
+#if !(MIN_VERSION_base(4,13,0))
fail = Fail.fail
+#endif
instance MonadPlus ParsecParser where
mzero = empty
diff --git a/Distribution/Simple/Utils.hs b/Distribution/Simple/Utils.hs
index 871a3e9..d2f45d8 100644
--- a/Distribution/Simple/Utils.hs
+++ b/Distribution/Simple/Utils.hs
@@ -1360,7 +1360,7 @@ withTempFileEx opts tmpDir template action =
(\(name, handle) -> do hClose handle
unless (optKeepTempFiles opts) $
handleDoesNotExist () . removeFile $ name)
- (withLexicalCallStack (uncurry action))
+ (withLexicalCallStack (\x -> uncurry action x))
-- | Create and use a temporary directory.
--
@@ -1375,7 +1375,7 @@ withTempFileEx opts tmpDir template action =
withTempDirectory :: Verbosity -> FilePath -> String -> (FilePath -> IO a) -> IO a
withTempDirectory verbosity targetDir template f = withFrozenCallStack $
withTempDirectoryEx verbosity defaultTempFileOptions targetDir template
- (withLexicalCallStack f)
+ (withLexicalCallStack (\x -> f x))
-- | A version of 'withTempDirectory' that additionally takes a
-- 'TempFileOptions' argument.
@@ -1386,7 +1386,7 @@ withTempDirectoryEx _verbosity opts targetDir template f = withFrozenCallStack $
(createTempDirectory targetDir template)
(unless (optKeepTempFiles opts)
. handleDoesNotExist () . removeDirectoryRecursive)
- (withLexicalCallStack f)
+ (withLexicalCallStack (\x -> f x))
-----------------------------------
-- Safely reading and writing files
diff --git a/Distribution/Compat/Prelude.hs b/Distribution/Compat/Prelude.hs
index c3bc040..166e58d 100644
--- a/Distribution/Compat/Prelude.hs
+++ b/Distribution/Compat/Prelude.hs
@@ -158,7 +158,7 @@ import qualified Text.PrettyPrint as Disp
import qualified Prelude as OrigPrelude
import Distribution.Compat.Stack
-type IO a = WithCallStack (OrigPrelude.IO a)
+type IO a = OrigPrelude.IO a
type NoCallStackIO a = OrigPrelude.IO a
-- | New name for 'Text.PrettyPrint.<>'
diff --git a/Distribution/FieldGrammar/FieldDescrs.hs b/Distribution/FieldGrammar/FieldDescrs.hs
index b1d23db..82e58e6 100644
--- a/Distribution/FieldGrammar/FieldDescrs.hs
+++ b/Distribution/FieldGrammar/FieldDescrs.hs
@@ -45,7 +45,7 @@ fieldDescrPretty (F m) fn = pPretty <$> Map.lookup fn m
-- | Lookup a field value parser.
fieldDescrParse :: P.CabalParsing m => FieldDescrs s a -> P.FieldName -> Maybe (s -> m s)
-fieldDescrParse (F m) fn = pParse <$> Map.lookup fn m
+fieldDescrParse (F m) fn = (\f -> pParse f) <$> Map.lookup fn m
fieldDescrsToList
:: P.CabalParsing m
diff --git a/Distribution/Simple/Utils.hs b/Distribution/Simple/Utils.hs
index 12eb4ad..8efd8a7 100644
--- a/Distribution/Simple/Utils.hs
+++ b/Distribution/Simple/Utils.hs
@@ -1338,7 +1338,7 @@ withTempFileEx opts tmpDir template action =
(\(name, handle) -> do hClose handle
unless (optKeepTempFiles opts) $
handleDoesNotExist () . removeFile $ name)
- (withLexicalCallStack (uncurry action))
+ (withLexicalCallStack (\x -> uncurry action x))
-- | Create and use a temporary directory.
--
@@ -1353,7 +1353,7 @@ withTempFileEx opts tmpDir template action =
withTempDirectory :: Verbosity -> FilePath -> String -> (FilePath -> IO a) -> IO a
withTempDirectory verbosity targetDir template f = withFrozenCallStack $
withTempDirectoryEx verbosity defaultTempFileOptions targetDir template
- (withLexicalCallStack f)
+ (withLexicalCallStack (\x -> f x))
-- | A version of 'withTempDirectory' that additionally takes a
-- 'TempFileOptions' argument.
@@ -1364,7 +1364,7 @@ withTempDirectoryEx _verbosity opts targetDir template f = withFrozenCallStack $
(createTempDirectory targetDir template)
(unless (optKeepTempFiles opts)
. handleDoesNotExist () . removeDirectoryRecursive)
- (withLexicalCallStack f)
+ (withLexicalCallStack (\x -> f x))
-----------------------------------
-- Safely reading and writing files
diff --git a/Distribution/Compat/Prelude.hs b/Distribution/Compat/Prelude.hs
index 0cca7db..7186140 100644
--- a/Distribution/Compat/Prelude.hs
+++ b/Distribution/Compat/Prelude.hs
@@ -170,7 +170,7 @@ import Distribution.Compat.Stack
import Distribution.Utils.Structured (Structured)
-type IO a = WithCallStack (OrigPrelude.IO a)
+type IO a = OrigPrelude.IO a
type NoCallStackIO a = OrigPrelude.IO a
-- | New name for 'Text.PrettyPrint.<>'
diff --git a/Distribution/FieldGrammar/FieldDescrs.hs b/Distribution/FieldGrammar/FieldDescrs.hs
index 803ce60..f58a918 100644
--- a/Distribution/FieldGrammar/FieldDescrs.hs
+++ b/Distribution/FieldGrammar/FieldDescrs.hs
@@ -45,7 +45,7 @@ fieldDescrPretty (F m) fn = pPretty <$> Map.lookup fn m
-- | Lookup a field value parser.
fieldDescrParse :: P.CabalParsing m => FieldDescrs s a -> P.FieldName -> Maybe (s -> m s)
-fieldDescrParse (F m) fn = pParse <$> Map.lookup fn m
+fieldDescrParse (F m) fn = (\f -> pParse f) <$> Map.lookup fn m
fieldDescrsToList
:: P.CabalParsing m
diff --git a/Distribution/Simple/Utils.hs b/Distribution/Simple/Utils.hs
index 96c8406..96818df 100644
--- a/Distribution/Simple/Utils.hs
+++ b/Distribution/Simple/Utils.hs
@@ -798,7 +798,7 @@ createProcessWithEnv verbosity path args mcwd menv inp out err = withFrozenCallS
--
-- The output is assumed to be text in the locale encoding.
--
-rawSystemStdout :: forall mode. KnownIODataMode mode => Verbosity -> FilePath -> [String] -> IO mode
+rawSystemStdout :: forall mode. KnownIODataMode mode => Verbosity -> FilePath -> [String] -> IO mode
rawSystemStdout verbosity path args = withFrozenCallStack $ do
(output, errors, exitCode) <- rawSystemStdInOut verbosity path args
Nothing Nothing Nothing (IOData.iodataMode :: IODataMode mode)
@@ -1340,7 +1340,7 @@ withTempFileEx opts tmpDir template action =
(\(name, handle) -> do hClose handle
unless (optKeepTempFiles opts) $
handleDoesNotExist () . removeFile $ name)
- (withLexicalCallStack (uncurry action))
+ (withLexicalCallStack (\x -> uncurry action x))
-- | Create and use a temporary directory.
--
@@ -1355,7 +1355,7 @@ withTempFileEx opts tmpDir template action =
withTempDirectory :: Verbosity -> FilePath -> String -> (FilePath -> IO a) -> IO a
withTempDirectory verbosity targetDir template f = withFrozenCallStack $
withTempDirectoryEx verbosity defaultTempFileOptions targetDir template
- (withLexicalCallStack f)
+ (withLexicalCallStack (\x -> f x))
-- | A version of 'withTempDirectory' that additionally takes a
-- 'TempFileOptions' argument.
@@ -1366,7 +1366,7 @@ withTempDirectoryEx _verbosity opts targetDir template f = withFrozenCallStack $
(createTempDirectory targetDir template)
(unless (optKeepTempFiles opts)
. handleDoesNotExist () . removeDirectoryRecursive)
- (withLexicalCallStack f)
+ (withLexicalCallStack (\x -> f x))
-----------------------------------
-- Safely reading and writing files
diff --git a/src/Data/Decimal.hs b/src/Data/Decimal.hs
index 340b49b..5fbd685 100644
--- a/src/Data/Decimal.hs
+++ b/src/Data/Decimal.hs
@@ -66,8 +66,8 @@ import Text.ParserCombinators.ReadP
-- will return \"1.500\". Conversely the "Read" instance will use the decimal
-- places to determine the precision.
data DecimalRaw i = Decimal {
- decimalPlaces :: ! Word8,
- decimalMantissa :: ! i}
+ decimalPlaces :: !Word8,
+ decimalMantissa :: !i}
deriving (Typeable)
......@@ -720,9 +720,18 @@ index ed593dc..197f5b8 100644
| otherwise = return (lhead s')
where s' = drop i s
diff --git a/src/Data/Edison/Seq/FingerSeq.hs b/src/Data/Edison/Seq/FingerSeq.hs
index c74c70b..b069665 100644
index c74c70b..8ecb4ee 100644
--- a/src/Data/Edison/Seq/FingerSeq.hs
+++ b/src/Data/Edison/Seq/FingerSeq.hs
@@ -46,7 +46,7 @@ import Data.Semigroup as SG
import Test.QuickCheck
#ifdef __GLASGOW_HASKELL__
-import GHC.Base (unsafeCoerce#)
+import GHC.Exts (unsafeCoerce#)
#endif
@@ -243,7 +243,7 @@ lookupM i (Seq xs)
case FT.splitTree (> (SizeM i)) (SizeM 0) xs of
FT.Split _ (Elem x) _ -> return x
......
diff --git a/src/Graphics/Text/TrueType/CharacterMap.hs b/src/Graphics/Text/TrueType/CharacterMap.hs
index 2663806..75d2655 100644
--- a/src/Graphics/Text/TrueType/CharacterMap.hs
+++ b/src/Graphics/Text/TrueType/CharacterMap.hs
@@ -102,7 +102,7 @@ instance NFData CharacterMaps where
rnf (CharacterMaps maps) = rnf maps `seq` ()
instance Binary CharacterMaps where
- put _ = fail "Unimplemented"
+ put _ = error "Unimplemented"
get = do
startIndex <- bytesRead
versionNumber <- getWord16be
@@ -192,7 +192,7 @@ instance Ord CharacterTable where
compare _ _ = GT
instance Binary CharacterTable where
- put _ = fail "Binary.put CharacterTable - Unimplemented"
+ put _ = error "Binary.put CharacterTable - Unimplemented"
get = do
format <- getWord16be
case format of
@@ -305,7 +305,7 @@ instance CharMappeable Format0 where
langIdOfCharMap = _format0Language
instance Binary Format0 where
- put _ = fail "Binary.Format0.put - unimplemented"
+ put _ = error "Binary.Format0.put - unimplemented"
get = do
tableSize <- getWord16be
when (tableSize /= 262) $
@@ -347,7 +347,7 @@ instance Binary Format2SubHeader where
instance Binary Format2 where
- put _ = fail "Format2.put - unimplemented"
+ put _ = error "Format2.put - unimplemented"
get = do
_tableSize <- getWord16be
lang <- getWord16be
@@ -376,7 +376,7 @@ instance CharMappeable Format6 where
langIdOfCharMap = _format6Language
instance Binary Format6 where
- put _ = fail "Format6.put - unimplemented"
+ put _ = error "Format6.put - unimplemented"
get = do
_length <- getWord16be
language <- getWord16be
diff --git a/src/Graphics/Text/TrueType/Glyph.hs b/src/Graphics/Text/TrueType/Glyph.hs
index 5209222..aa0c500 100644
--- a/src/Graphics/Text/TrueType/Glyph.hs
+++ b/src/Graphics/Text/TrueType/Glyph.hs
@@ -313,7 +313,7 @@ getSimpleOutline counterCount = do
where breaker array ix = VU.splitAt (fromIntegral ix + 1) array
instance Binary Glyph where
- put _ = fail "Glyph.put - unimplemented"
+ put _ = error "Glyph.put - unimplemented"
get = do
hdr <- get
case _glfNumberOfContours hdr of
diff --git a/src/Graphics/Text/TrueType/Header.hs b/src/Graphics/Text/TrueType/Header.hs
index 2c425e5..abd6589 100644
--- a/src/Graphics/Text/TrueType/Header.hs
+++ b/src/Graphics/Text/TrueType/Header.hs
@@ -100,7 +100,7 @@ instance NFData FontHeader where
rnf (FontHeader {}) = ()
instance Binary FontHeader where
- put _ = fail "Unimplemented"
+ put _ = error "Unimplemented"
get =
FontHeader <$> get <*> get <*> g32 <*> g32 <*> get
<*> g16 <*> g64 <*> g64 <*> get <*> get
diff --git a/src/Graphics/Text/TrueType/MaxpTable.hs b/src/Graphics/Text/TrueType/MaxpTable.hs
index a0508c6..29c773c 100644
--- a/src/Graphics/Text/TrueType/MaxpTable.hs
+++ b/src/Graphics/Text/TrueType/MaxpTable.hs
@@ -50,7 +50,7 @@ instance NFData MaxpTable where
rnf (MaxpTable {}) = ()
instance Binary MaxpTable where
- put _ = fail "Unimplemented"
+ put _ = error "Unimplemented"
get = MaxpTable
<$> get <*> g16 <*> g16 <*> g16 <*> g16 <*> g16
<*> g16 <*> g16 <*> g16 <*> g16 <*> g16 <*> g16
diff --git a/src/Graphics/Text/TrueType/Name.hs b/src/Graphics/Text/TrueType/Name.hs
index 8c23605..c05a55f 100644
--- a/src/Graphics/Text/TrueType/Name.hs
+++ b/src/Graphics/Text/TrueType/Name.hs
@@ -35,7 +35,7 @@ instance NFData NameTable where
rnf (NameTable {}) = ()
instance Binary NameTable where
- put _ = fail "Binary.put NameTable - unimplemented"
+ put _ = error "Binary.put NameTable - unimplemented"
get = do
nameFormatId <- getWord16be
when (nameFormatId /= 0) $
diff --git a/Network/TCP.hs b/Network/TCP.hs
index 6f20319..ce01117 100644
--- a/Network/TCP.hs
+++ b/Network/TCP.hs
@@ -89,7 +89,7 @@ instance Eq EndPoint where
map toLower host1 == map toLower host2 && port1 == port2
data Conn a
- = MkConn { connSock :: ! Socket
+ = MkConn { connSock :: !Socket
, connHandle :: Handle
, connBuffer :: BufferOp a
, connInput :: Maybe a
diff --git a/src/Data/ListLike/Instances.hs b/src/Data/ListLike/Instances.hs
index ee5fcb3..0fdebc8 100644
--- a/src/Data/ListLike/Instances.hs
+++ b/src/Data/ListLike/Instances.hs
@@ -132,10 +132,12 @@ instance FoldableLL BS.ByteString Word8 where
foldr' = BS.foldr'
foldr1 = BS.foldr1
+#if !(MIN_VERSION_bytestring(0,10,12))
instance IsList BS.ByteString where
type Item BS.ByteString = Word8
toList = BS.unpack
fromList = BS.pack
+#endif
instance ListLike BS.ByteString Word8 where
empty = BS.empty
@@ -255,10 +257,12 @@ mi64toi :: Maybe Int64 -> Maybe Int
mi64toi Nothing = Nothing
mi64toi (Just x) = Just (fromIntegral x)
+#if !(MIN_VERSION_bytestring(0,10,12))
instance IsList BSL.ByteString where
type Item BSL.ByteString = Word8
toList = BSL.unpack
fromList = BSL.pack
+#endif
instance ListLike BSL.ByteString Word8 where
empty = BSL.empty
diff --git a/QuickCheck.cabal b/QuickCheck.cabal
index e8cb193..c2967f6 100644
--- a/QuickCheck.cabal
+++ b/QuickCheck.cabal
@@ -120,7 +120,7 @@ library
-- Use splitmix on newer GHCs.
if impl(ghc >= 7.0)
- Build-depends: splitmix >= 0.0.2
+ Build-depends: splitmix >= 0.0.2 && < 0.1
else
cpp-options: -DNO_SPLITMIX
diff --git a/Test/QuickCheck/All.hs b/Test/QuickCheck/All.hs
index 8230495..33d1db5 100644
--- a/Test/QuickCheck/All.hs
+++ b/Test/QuickCheck/All.hs
@@ -99,17 +99,33 @@ infoType (VarI _ ty _ _) = ty
deconstructType :: Error -> Type -> Q ([Name], Cxt, Type)
deconstructType err ty0@(ForallT xs ctx ty) = do
- let plain (PlainTV _) = True
+ let plain = elimTV (\_ -> True) $ \_ k ->
+ case k of
#if MIN_VERSION_template_haskell(2,8,0)
- plain (KindedTV _ StarT) = True
+ StarT -> True
#else
- plain (KindedTV _ StarK) = True
+ StarK -> True
#endif
- plain _ = False
+ _ -> False
unless (all plain xs) $ err "Higher-kinded type variables in type"
- return (map (\(PlainTV x) -> x) xs, ctx, ty)
+ return (map (elimTV id (error "KindedTV")) xs, ctx, ty)
deconstructType _ ty = return ([], [], ty)
+elimTV :: (Name -> r) -> (Name -> Kind -> r)
+#if MIN_VERSION_template_haskell(2,17,0)
+ -> TyVarBndr spec
+#else
+ -> TyVarBndr
+#endif
+ -> r
+#if MIN_VERSION_template_haskell(2,17,0)
+elimTV ptv _ktv (PlainTV n _) = ptv n
+elimTV _ptv ktv (KindedTV n _ k) = ktv n k
+#else
+elimTV ptv _ktv (PlainTV n) = ptv n
+elimTV _ptv ktv (KindedTV n k) = ktv n k
+#endif
+
monomorphiseType :: Error -> Type -> Type -> TypeQ
monomorphiseType err mono ty@(VarT n) = return mono
monomorphiseType err mono (AppT t1 t2) = liftM2 AppT (monomorphiseType err mono t1) (monomorphiseType err mono t2)
diff --git a/src/Test/QuickCheck/All.hs b/src/Test/QuickCheck/All.hs
index 8230495..1d9cab6 100644
--- a/src/Test/QuickCheck/All.hs
+++ b/src/Test/QuickCheck/All.hs
@@ -99,17 +99,33 @@ infoType (VarI _ ty _ _) = ty
deconstructType :: Error -> Type -> Q ([Name], Cxt, Type)
deconstructType err ty0@(ForallT xs ctx ty) = do
- let plain (PlainTV _) = True
+ let plain = elimTV (\_ -> True) $ \_ k ->
+ case k of
#if MIN_VERSION_template_haskell(2,8,0)
- plain (KindedTV _ StarT) = True
+ StarT -> True
#else
- plain (KindedTV _ StarK) = True
+ StarK -> True
#endif
- plain _ = False
+ _ -> False
unless (all plain xs) $ err "Higher-kinded type variables in type"
- return (map (\(PlainTV x) -> x) xs, ctx, ty)
+ return (map (elimTV id (error "KindedTV")) xs, ctx, ty)
deconstructType _ ty = return ([], [], ty)
+elimTV :: (Name -> r) -> (Name -> Kind -> r)
+#if MIN_VERSION_template_haskell(2,17,0)
+ -> TyVarBndr flag
+#else
+ -> TyVarBndr
+#endif
+ -> r
+#if MIN_VERSION_template_haskell(2,17,0)
+elimTV ptv _ktv (PlainTV n _) = ptv n
+elimTV _ptv ktv (KindedTV n _ k) = ktv n k
+#else
+elimTV ptv _ktv (PlainTV n) = ptv n
+elimTV _ptv ktv (KindedTV n k) = ktv n k
+#endif
+
monomorphiseType :: Error -> Type -> Type -> TypeQ
monomorphiseType err mono ty@(VarT n) = return mono
monomorphiseType err mono (AppT t1 t2) = liftM2 AppT (monomorphiseType err mono t1) (monomorphiseType err mono t2)
diff --git a/System/Unix/Chroot.hs b/System/Unix/Chroot.hs
index 06bf3dd..12de580 100644
--- a/System/Unix/Chroot.hs
+++ b/System/Unix/Chroot.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE CPP, ForeignFunctionInterface #-}
-- | This module, except for useEnv, is copied from the build-env package.
module System.Unix.Chroot
( fchroot
@@ -45,7 +45,11 @@ chroot fp = withCString fp $ \cfp -> throwErrnoIfMinus1_ "chroot" (c_chroot cfp)
fchroot :: (MonadIO m, MonadMask m) => FilePath -> m a -> m a
fchroot path action =
do origWd <- liftIO $ getWorkingDirectory
- rootFd <- liftIO $ openFd "/" ReadOnly Nothing defaultFileFlags
+ rootFd <- liftIO $ openFd "/" ReadOnly
+#if !(MIN_VERSION_unix(2,8,0))
+ Nothing
+#endif
+ defaultFileFlags
liftIO $ chroot path
liftIO $ changeWorkingDirectory "/"
action `finally` (liftIO $ breakFree origWd rootFd)
diff --git a/src/FRP/Yampa/Event.hs b/src/FRP/Yampa/Event.hs
index 804fe46..0639f3f 100644
--- a/src/FRP/Yampa/Event.hs
+++ b/src/FRP/Yampa/Event.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
-----------------------------------------------------------------------------------------
-- |
@@ -90,6 +91,7 @@ module FRP.Yampa.Event where
import Control.Applicative
import Control.DeepSeq (NFData(..))
+import qualified Control.Monad.Fail as Fail
import FRP.Yampa.Diagnostics
@@ -175,9 +177,14 @@ instance Monad Event where
-- | See 'pure'.
return = pure
+#if !(MIN_VERSION_base(4,13,0))
-- | Fail with 'NoEvent'.
- fail _ = NoEvent
+ fail = Fail.fail
+#endif
+instance Fail.MonadFail Event where
+ -- | Fail with 'NoEvent'.
+ fail _ = NoEvent
-- | Alternative instance
instance Alternative Event where
diff --git a/active.cabal b/active.cabal
index 125c007..43eb504 100644
--- a/active.cabal
+++ b/active.cabal
@@ -1,5 +1,6 @@
name: active
version: 0.2.0.14
+x-revision: 1
synopsis: Abstractions for animation
description: "Active" abstraction for animated things with finite start and end times.
license: BSD3
@@ -24,8 +25,8 @@ library
vector >= 0.10,
semigroups >= 0.1 && < 0.20,
semigroupoids >= 1.2 && < 5.4,
- lens >= 4.0 && < 4.19,
- linear >= 1.14 && < 1.21
+ lens >= 4.0 && < 4.20,
+ linear >= 1.14 && < 1.22
hs-source-dirs: src
default-language: Haskell2010
@@ -36,8 +37,8 @@ test-suite active-tests
vector >= 0.10,
semigroups >= 0.1 && < 0.20,
semigroupoids >= 1.2 && < 5.4,
- lens >= 4.0 && < 4.19,
- linear >= 1.14 && < 1.21,
+ lens >= 4.0 && < 4.20,
+ linear >= 1.14 && < 1.22,
QuickCheck >= 2.9 && < 2.14
other-modules: Data.Active
hs-source-dirs: src, test
diff --git a/src/Data/Active.hs b/src/Data/Active.hs
index c5e1b3f..4db447b 100644
--- a/src/Data/Active.hs
+++ b/src/Data/Active.hs
@@ -162,31 +162,6 @@ import Linear.Affine
-- Time
------------------------------------------------------------
--- | An abstract type for representing /points in time/. Note that
--- literal numeric values may be used as @Time@s, thanks to the the
--- 'Num' and 'Fractional' instances.
-newtype Time n = Time { unTime :: n }
- deriving (Eq, Ord, Show, Read, Enum, Num, Fractional, Real, RealFrac, Functor)
-
-makeWrapped ''Time
-
--- | A convenient wrapper function to convert a numeric value into a time.
-toTime :: n -> Time n
-toTime = Time
-
--- | A convenient unwrapper function to turn a time into a numeric value.
-fromTime :: Time n -> n
-fromTime = unTime
-
-instance Affine Time where
- type Diff Time = Duration
- (Time t1) .-. (Time t2) = Duration (t1 - t2)
- (Time t) .+^ (Duration d) = Time (t + d)
-
--- instance Deadline Time a where
--- -- choose tm deadline (if before / at deadline) (if after deadline)
<