Skip to content

Commit

Permalink
Merge branch 'master' into captureall
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar authored Feb 9, 2024
2 parents ca86b49 + 644f3ad commit 55ee345
Show file tree
Hide file tree
Showing 141 changed files with 2,235 additions and 876 deletions.
149 changes: 80 additions & 69 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: CI

# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: [master]
branches:
- master

jobs:
cabal:
Expand All @@ -13,17 +13,21 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
cabal: ["3.4"]
cabal: ["3.10"]
ghc:
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.1"
- "9.0.2"
- "9.2.8"
- "9.4.8"
- "9.6.3"
- "9.8.1"
fail-fast: false

steps:
- uses: actions/checkout@v2

- uses: haskell/actions/setup@v1
- uses: haskell/actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
Expand All @@ -35,7 +39,7 @@ jobs:
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal freeze
- uses: actions/cache@v2.1.3
- uses: actions/cache/restore@v3
name: Cache ~/.cabal/store and dist-newstyle
with:
path: |
Expand All @@ -45,12 +49,9 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-
- name: Configure
- name: Install doctest
run: |
# Using separate store-dir because default one already has 'ghc-paths' package installed
# with hardcoded path to ghcup's GHC path (which it was built with). This leads to failure in
# doctest, as it tries to invoke that GHC, and it doesn't exist here.
cabal --store-dir /tmp/cabal-store install --ignore-project -j2 doctest --constraint='doctest ^>=0.18'
cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.22'
- name: Build
run: |
Expand All @@ -61,86 +62,87 @@ jobs:
cabal test all
- name: Run doctests
# doctests are broken on GHC 9 due to compiler bug:
# https://gitlab.haskell.org/ghc/ghc/-/issues/19460
continue-on-error: ${{ matrix.ghc == '9.0.1' }}
run: |
# Necessary for doctest to be found in $PATH
export PATH="$HOME/.cabal/bin:$PATH"
# Filter out base-compat-batteries from .ghc.environment.*, as its modules
# conflict with those of base-compat.
#
# FIXME: This is an ugly hack. Ultimately, we'll want to use cabal-doctest
# (or cabal v2-doctest, if it ever lands) to provide a clean GHC environment.
# This might allow running doctests in GHCJS build as well.
perl -i -e 'while (<ARGV>) { print unless /package-id\s+(base-compat-batteries)-\d+(\.\d+)*/; }' .ghc.environment.*
(cd servant && doctest src)
(cd servant-client && doctest src)
(cd servant-client-core && doctest src)
(cd servant-http-streams && doctest src)
(cd servant-docs && doctest src)
(cd servant-foreign && doctest src)
(cd servant-server && doctest src)
(cd servant-machines && doctest src)
(cd servant-conduit && doctest src)
(cd servant-pipes && doctest src)
stack:
name: stack / ghc ${{ matrix.ghc }}
runs-on: ubuntu-latest
strategy:
matrix:
stack: ["2.7.3"]
ghc: ["8.10.4"]

steps:
- uses: actions/checkout@v2

- uses: haskell/actions/setup@v1
name: Setup Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
stack-version: ${{ matrix.stack }}

- uses: actions/[email protected]
name: Cache ~/.stack
DOCTEST="cabal repl --with-ghc=doctest"
(cd servant && eval $DOCTEST)
(cd servant-client && eval $DOCTEST)
(cd servant-client-core && eval $DOCTEST)
(cd servant-http-streams && eval $DOCTEST)
(cd servant-docs && eval $DOCTEST)
(cd servant-foreign && eval $DOCTEST)
(cd servant-server && eval $DOCTEST)
(cd servant-machines && eval $DOCTEST)
(cd servant-conduit && eval $DOCTEST)
(cd servant-pipes && eval $DOCTEST)
- name: Save cache
uses: actions/cache/save@v3
if: always()
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack

- name: Install dependencies
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
- name: Build
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

- name: Test
run: |
stack test --system-ghc
# stack:
# name: stack / ghc ${{ matrix.ghc }}
# runs-on: ubuntu-latest
# strategy:
# matrix:
# stack: ["2.7.5"]
# ghc: ["8.10.7"]

# steps:
# - uses: actions/checkout@v2

# - uses: haskell/actions/setup@v1
# name: Setup Haskell Stack
# with:
# ghc-version: ${{ matrix.ghc }}
# stack-version: ${{ matrix.stack }}

# - uses: actions/[email protected]
# name: Cache ~/.stack
# with:
# path: ~/.stack
# key: ${{ runner.os }}-${{ matrix.ghc }}-stack

# - name: Install dependencies
# run: |
# stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies

# - name: Build
# run: |
# stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks

# - name: Test
# run: |
# stack test --system-ghc

ghcjs:
name: ubuntu-latest / ghcjs 8.6
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v13
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
extra_nix_config: |
trusted-public-keys = ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=1aba6f367982bd6dd78ec2fda75ab246a62d32c5 cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://nixcache.reflex-frp.org https://cache.nixos.org/
nix_path: nixpkgs=channel:release-22.11

- name: Setup
run: |
# Override cabal.project with the lightweight GHCJS one
cp cabal.ghcjs.project cabal.project
cat cabal.project
nix-shell ghcjs.nix --run "cabal v2-update && cabal v2-freeze"
- uses: actions/cache@v2.1.3
- uses: actions/cache/restore@v3
name: Cache ~/.cabal/store and dist-newstyle
with:
path: |
Expand All @@ -157,3 +159,12 @@ jobs:
- name: Tests
run: |
nix-shell ghcjs.nix --run ".github/run-ghcjs-tests.sh"
- name: Save cache
uses: actions/cache/save@v3
if: always()
with:
path: |
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-ghcjs8.6-${{ hashFiles('cabal.project.freeze') }}
65 changes: 22 additions & 43 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
# Contributing Guidelines

Contributions are very welcome! To hack on the github version, clone the
repository. You can use `cabal`:
Contributions are very welcome! To hack on the github version, clone the repository. You can use `cabal`:

```shell
./scripts/start-sandbox.sh # Initialize the sandbox and add-source the packages
./scripts/test-all.sh # Run all the tests
cabal build all # Install dependencies and build packages
cabal test all # Run all the tests
```

Or `stack`:

```shell
stack setup # Downloads and installs a proper GHC version if necessary
stack build --fast --pedantic # Install dependencies and build packages
stack test # Run all the tests
stack setup # Downloads and installs a proper GHC version if necessary
stack build --fast # Install dependencies and build packages
stack test # Run all the tests
```

Or `nix`:

```shell
./scripts/generate-nix-files.sh # Get up-to-date shell.nix files
nix-shell nix/shell.nix # Enter a new development shell with Cabal and Stack

# Alternatively, another version of GHC can be used. See nix/README.md for more info.
nix-shell nix/shell.nix --argstr compiler ghc901
```

To build the docs, see `doc/README.md`.
Expand All @@ -32,14 +35,13 @@ Some things we like:
- Few dependencies
- -Werror-compatible (7.8, 7.10 and 8.0)

Though we aren't sticklers for style, the `.stylish-haskell.yaml` and `HLint.hs`
files in the repository provide a good baseline for consistency.
Though we aren't sticklers for style, the `.stylish-haskell.yaml` and `HLint.hs` files in the repository provide a good baseline for consistency.

**Important**: please do not modify the versions of the servant packages you are sending patches for.

## Changelog entries

We experiment with using [changelog-d tool](https://github.com/phadej/changelog-d) to assemble changelogs.
We experiment with using [changelog-d](https://codeberg.org/fgaz/changelog-d) tool to assemble changelogs.
You are not required to install it.

In each PR please add a file to `changelog.d` directory named after issue you are solving or the pull request itself (in a separate commit after you know the pull request number). For example
Expand All @@ -66,50 +68,27 @@ for prose.

## PR process

We try to give timely reviews to PRs that pass CI. If CI for your PR fails, we
may close the PR if it has been open for too long (though you should feel free
to reopen when the issues have been fixed).
We try to give timely reviews to PRs that pass CI. If CI for your PR fails, we may close the PR if it has been open for too long (though you should feel free to reopen when the issues have been fixed).

We require two +1 from the maintainers of the repo. If you feel like there has
not been a timely response to a PR, you can ping the Maintainers group (with
`@haskell-servant/maintainers`).
We require two +1 from the maintainers of the repo. If you feel like there has not been a timely response to a PR, you can ping the Maintainers group (with `@haskell-servant/maintainers`).

## New combinators

We encourage people to experiment with new combinators and instances - it is
one of the most powerful ways of using `servant`, and a wonderful way of
getting to know it better. If you do write a new combinator, we would love to
know about it! Either hop on #servant on freenode and let us know, or open an
issue with the `news` tag (which we will close when we read it).

As for adding them to the main repo: maintaining combinators can be expensive,
since official combinators must have instances for all classes (and new classes
come along fairly frequently). We therefore have to be quite selective about
those that we accept. If you're considering writing a new combinator, open an
issue to discuss it first! Or contribute it to the
[servant-contrib](https://github.com/haskell-servant/servant-contrib) repository.
You could release your combinator as a separate package, of course.
We encourage people to experiment with new combinators and instances - it is one of the most powerful ways of using `servant`, and a wonderful way of getting to know it better. If you do write a new combinator, we would love to know about it! Either hop on [#haskell-servant on libera.chat](https://web.libera.chat/#haskell-servant) and let us know, or open an issue with the `news` tag (which we will close when we read it).

As for adding them to the main repo: maintaining combinators can be expensive, since official combinators must have instances for all classes (and new classes come along fairly frequently). We therefore have to be quite selective about those that we accept. If you're considering writing a new combinator, open an issue to discuss it first! Or contribute it to the [servant-contrib](https://github.com/haskell-servant/servant-contrib) repository.
You could release your combinator as a separate package, of course.

## New classes

The main benefit of having a new class and package in the main servant repo is
that we get to see via CI whether changes to other packages break the build.
Open an issue to discuss whether a package should be added to the main repo. If
we decide that it can, you can still keep maintainership over it.
The main benefit of having a new class and package in the main servant repo is that we get to see via CI whether changes to other packages break the build. Open an issue to discuss whether a package should be added to the main repo. If we decide that it can, you can still keep maintainership over it.

Whether or not you want your package to be in the repo, create an issue with
the `news` label if you make a new package so we can know about it!
Whether or not you want your package to be in the repo, create an issue with the `news` label if you make a new package so we can know about it!

## Release policy

We are currently moving to a more aggressive release policy, so that you can get
what you contribute from Hackage fairly soon. However, note that prior to major
releases it may take some time in between releases.
We are currently moving to a more aggressive release policy, so that you can get what you contribute from Hackage fairly soon. However, note that prior to major releases it may take some time in between releases.

## Reporting security issues

Please email haskell-servant-maintainers AT googlegroups DOT com. This group is
private, and accessible only to known maintainers. We will then discuss how to
proceed. Please do not make the issue public before we inform you that we have
a patch ready.
Please email haskell-servant-maintainers AT googlegroups DOT com. This group is private, and accessible only to known maintainers. We will then discuss how to proceed. Please do not make the issue public before we inform you that we have a patch ready.
3 changes: 3 additions & 0 deletions cabal.ghcjs.project
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ tests: True
-- Constraints so that reflex-platform provided packages are selected.
constraints: attoparsec == 0.13.2.2
constraints: hashable == 1.3.0.0
constraints: hspec < 2.10

constraints: clock < 0.8.4
29 changes: 8 additions & 21 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,17 @@ packages:
doc/cookbook/using-custom-monad
doc/cookbook/using-free-client
-- doc/cookbook/open-id-connect
doc/cookbook/managed-resource

tests: True
optimization: False
-- reorder-goals: True

constraints:
-- see https://github.com/haskell-infra/hackage-trustees/issues/119
foundation >=0.0.14,
memory <0.14.12 || >0.14.12
-- Print ticks so that doctest type querying is consistent across GHC versions.
-- This block can be removed when we drop support for GHC 9.4 and below.
if(impl(ghc >= 9.6.1))
package servant
ghc-options: -fprint-redundant-promotion-ticks

constraints: base-compat ^>=0.11
constraints: semigroups ^>=0.19

-- allow-newer: sqlite-simple-0.4.16.0:semigroups
-- allow-newer: direct-sqlite-2.3.24:semigroups

-- needed for doctests
write-ghc-environment-files: always

-- https://github.com/chordify/haskell-servant-pagination/pull/12
allow-newer: servant-pagination-2.2.2:servant
allow-newer: servant-pagination-2.2.2:servant-server

allow-newer: servant-js:servant

-- ghc 9
allow-newer: tdigest:base
package servant-server
ghc-options: -fprint-redundant-promotion-ticks
9 changes: 0 additions & 9 deletions changelog.d/1432

This file was deleted.

Loading

0 comments on commit 55ee345

Please sign in to comment.