Skip to content

Commit 55ee345

Browse files
authored
Merge branch 'master' into captureall
2 parents ca86b49 + 644f3ad commit 55ee345

File tree

141 files changed

+2235
-876
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+2235
-876
lines changed

.github/workflows/master.yml

Lines changed: 80 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: CI
22

3-
# Trigger the workflow on push or pull request, but only for the master branch
43
on:
54
pull_request:
65
push:
7-
branches: [master]
6+
branches:
7+
- master
88

99
jobs:
1010
cabal:
@@ -13,17 +13,21 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest]
16-
cabal: ["3.4"]
16+
cabal: ["3.10"]
1717
ghc:
18-
- "8.6.5"
1918
- "8.8.4"
2019
- "8.10.7"
21-
- "9.0.1"
20+
- "9.0.2"
21+
- "9.2.8"
22+
- "9.4.8"
23+
- "9.6.3"
24+
- "9.8.1"
25+
fail-fast: false
2226

2327
steps:
2428
- uses: actions/checkout@v2
2529

26-
- uses: haskell/actions/setup@v1
30+
- uses: haskell/actions/setup@v2
2731
id: setup-haskell-cabal
2832
name: Setup Haskell
2933
with:
@@ -35,7 +39,7 @@ jobs:
3539
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
3640
cabal freeze
3741
38-
- uses: actions/cache@v2.1.3
42+
- uses: actions/cache/restore@v3
3943
name: Cache ~/.cabal/store and dist-newstyle
4044
with:
4145
path: |
@@ -45,12 +49,9 @@ jobs:
4549
restore-keys: |
4650
${{ runner.os }}-${{ matrix.ghc }}-
4751
48-
- name: Configure
52+
- name: Install doctest
4953
run: |
50-
# Using separate store-dir because default one already has 'ghc-paths' package installed
51-
# with hardcoded path to ghcup's GHC path (which it was built with). This leads to failure in
52-
# doctest, as it tries to invoke that GHC, and it doesn't exist here.
53-
cabal --store-dir /tmp/cabal-store install --ignore-project -j2 doctest --constraint='doctest ^>=0.18'
54+
cabal install --ignore-project -j2 doctest --constraint='doctest ^>=0.22'
5455
5556
- name: Build
5657
run: |
@@ -61,86 +62,87 @@ jobs:
6162
cabal test all
6263
6364
- name: Run doctests
64-
# doctests are broken on GHC 9 due to compiler bug:
65-
# https://gitlab.haskell.org/ghc/ghc/-/issues/19460
66-
continue-on-error: ${{ matrix.ghc == '9.0.1' }}
6765
run: |
6866
# Necessary for doctest to be found in $PATH
6967
export PATH="$HOME/.cabal/bin:$PATH"
7068
71-
# Filter out base-compat-batteries from .ghc.environment.*, as its modules
72-
# conflict with those of base-compat.
73-
#
74-
# FIXME: This is an ugly hack. Ultimately, we'll want to use cabal-doctest
75-
# (or cabal v2-doctest, if it ever lands) to provide a clean GHC environment.
76-
# This might allow running doctests in GHCJS build as well.
77-
perl -i -e 'while (<ARGV>) { print unless /package-id\s+(base-compat-batteries)-\d+(\.\d+)*/; }' .ghc.environment.*
78-
79-
(cd servant && doctest src)
80-
(cd servant-client && doctest src)
81-
(cd servant-client-core && doctest src)
82-
(cd servant-http-streams && doctest src)
83-
(cd servant-docs && doctest src)
84-
(cd servant-foreign && doctest src)
85-
(cd servant-server && doctest src)
86-
(cd servant-machines && doctest src)
87-
(cd servant-conduit && doctest src)
88-
(cd servant-pipes && doctest src)
89-
90-
stack:
91-
name: stack / ghc ${{ matrix.ghc }}
92-
runs-on: ubuntu-latest
93-
strategy:
94-
matrix:
95-
stack: ["2.7.3"]
96-
ghc: ["8.10.4"]
97-
98-
steps:
99-
- uses: actions/checkout@v2
100-
101-
- uses: haskell/actions/setup@v1
102-
name: Setup Haskell Stack
103-
with:
104-
ghc-version: ${{ matrix.ghc }}
105-
stack-version: ${{ matrix.stack }}
106-
107-
- uses: actions/[email protected]
108-
name: Cache ~/.stack
69+
DOCTEST="cabal repl --with-ghc=doctest"
70+
(cd servant && eval $DOCTEST)
71+
(cd servant-client && eval $DOCTEST)
72+
(cd servant-client-core && eval $DOCTEST)
73+
(cd servant-http-streams && eval $DOCTEST)
74+
(cd servant-docs && eval $DOCTEST)
75+
(cd servant-foreign && eval $DOCTEST)
76+
(cd servant-server && eval $DOCTEST)
77+
(cd servant-machines && eval $DOCTEST)
78+
(cd servant-conduit && eval $DOCTEST)
79+
(cd servant-pipes && eval $DOCTEST)
80+
81+
- name: Save cache
82+
uses: actions/cache/save@v3
83+
if: always()
10984
with:
110-
path: ~/.stack
111-
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
112-
113-
- name: Install dependencies
114-
run: |
115-
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
116-
117-
- name: Build
118-
run: |
119-
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
85+
path: |
86+
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
87+
dist-newstyle
88+
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
12089

121-
- name: Test
122-
run: |
123-
stack test --system-ghc
90+
# stack:
91+
# name: stack / ghc ${{ matrix.ghc }}
92+
# runs-on: ubuntu-latest
93+
# strategy:
94+
# matrix:
95+
# stack: ["2.7.5"]
96+
# ghc: ["8.10.7"]
97+
98+
# steps:
99+
# - uses: actions/checkout@v2
100+
101+
# - uses: haskell/actions/setup@v1
102+
# name: Setup Haskell Stack
103+
# with:
104+
# ghc-version: ${{ matrix.ghc }}
105+
# stack-version: ${{ matrix.stack }}
106+
107+
# - uses: actions/[email protected]
108+
# name: Cache ~/.stack
109+
# with:
110+
# path: ~/.stack
111+
# key: ${{ runner.os }}-${{ matrix.ghc }}-stack
112+
113+
# - name: Install dependencies
114+
# run: |
115+
# stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
116+
117+
# - name: Build
118+
# run: |
119+
# stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
120+
121+
# - name: Test
122+
# run: |
123+
# stack test --system-ghc
124124

125125
ghcjs:
126126
name: ubuntu-latest / ghcjs 8.6
127127
runs-on: "ubuntu-latest"
128128

129129
steps:
130-
- uses: actions/checkout@v2
131-
- uses: cachix/install-nix-action@v13
130+
- uses: actions/checkout@v3
131+
- uses: cachix/install-nix-action@v20
132132
with:
133133
extra_nix_config: |
134134
trusted-public-keys = ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=1aba6f367982bd6dd78ec2fda75ab246a62d32c5 cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
135135
substituters = https://nixcache.reflex-frp.org https://cache.nixos.org/
136+
nix_path: nixpkgs=channel:release-22.11
137+
136138
- name: Setup
137139
run: |
138140
# Override cabal.project with the lightweight GHCJS one
139141
cp cabal.ghcjs.project cabal.project
140142
cat cabal.project
141143
nix-shell ghcjs.nix --run "cabal v2-update && cabal v2-freeze"
142144
143-
- uses: actions/cache@v2.1.3
145+
- uses: actions/cache/restore@v3
144146
name: Cache ~/.cabal/store and dist-newstyle
145147
with:
146148
path: |
@@ -157,3 +159,12 @@ jobs:
157159
- name: Tests
158160
run: |
159161
nix-shell ghcjs.nix --run ".github/run-ghcjs-tests.sh"
162+
163+
- name: Save cache
164+
uses: actions/cache/save@v3
165+
if: always()
166+
with:
167+
path: |
168+
~/.cabal/store
169+
dist-newstyle
170+
key: ${{ runner.os }}-ghcjs8.6-${{ hashFiles('cabal.project.freeze') }}

CONTRIBUTING.md

Lines changed: 22 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
# Contributing Guidelines
22

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

65
```shell
7-
./scripts/start-sandbox.sh # Initialize the sandbox and add-source the packages
8-
./scripts/test-all.sh # Run all the tests
6+
cabal build all # Install dependencies and build packages
7+
cabal test all # Run all the tests
98
```
109

1110
Or `stack`:
1211

1312
```shell
14-
stack setup # Downloads and installs a proper GHC version if necessary
15-
stack build --fast --pedantic # Install dependencies and build packages
16-
stack test # Run all the tests
13+
stack setup # Downloads and installs a proper GHC version if necessary
14+
stack build --fast # Install dependencies and build packages
15+
stack test # Run all the tests
1716
```
1817

1918
Or `nix`:
19+
2020
```shell
21-
./scripts/generate-nix-files.sh # Get up-to-date shell.nix files
21+
nix-shell nix/shell.nix # Enter a new development shell with Cabal and Stack
22+
23+
# Alternatively, another version of GHC can be used. See nix/README.md for more info.
24+
nix-shell nix/shell.nix --argstr compiler ghc901
2225
```
2326

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

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

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

4042
## Changelog entries
4143

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

4547
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
@@ -66,50 +68,27 @@ for prose.
6668

6769
## PR process
6870

69-
We try to give timely reviews to PRs that pass CI. If CI for your PR fails, we
70-
may close the PR if it has been open for too long (though you should feel free
71-
to reopen when the issues have been fixed).
71+
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).
7272

73-
We require two +1 from the maintainers of the repo. If you feel like there has
74-
not been a timely response to a PR, you can ping the Maintainers group (with
75-
`@haskell-servant/maintainers`).
73+
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`).
7674

7775
## New combinators
7876

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

79+
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.
80+
You could release your combinator as a separate package, of course.
9381

9482
## New classes
9583

96-
The main benefit of having a new class and package in the main servant repo is
97-
that we get to see via CI whether changes to other packages break the build.
98-
Open an issue to discuss whether a package should be added to the main repo. If
99-
we decide that it can, you can still keep maintainership over it.
84+
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.
10085

101-
Whether or not you want your package to be in the repo, create an issue with
102-
the `news` label if you make a new package so we can know about it!
86+
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!
10387

10488
## Release policy
10589

106-
We are currently moving to a more aggressive release policy, so that you can get
107-
what you contribute from Hackage fairly soon. However, note that prior to major
108-
releases it may take some time in between releases.
90+
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.
10991

11092
## Reporting security issues
11193

112-
Please email haskell-servant-maintainers AT googlegroups DOT com. This group is
113-
private, and accessible only to known maintainers. We will then discuss how to
114-
proceed. Please do not make the issue public before we inform you that we have
115-
a patch ready.
94+
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.

cabal.ghcjs.project

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ tests: True
1212
-- Constraints so that reflex-platform provided packages are selected.
1313
constraints: attoparsec == 0.13.2.2
1414
constraints: hashable == 1.3.0.0
15+
constraints: hspec < 2.10
16+
17+
constraints: clock < 0.8.4

cabal.project

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,17 @@ packages:
4747
doc/cookbook/using-custom-monad
4848
doc/cookbook/using-free-client
4949
-- doc/cookbook/open-id-connect
50+
doc/cookbook/managed-resource
5051

5152
tests: True
5253
optimization: False
5354
-- reorder-goals: True
5455

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

60-
constraints: base-compat ^>=0.11
61-
constraints: semigroups ^>=0.19
62-
63-
-- allow-newer: sqlite-simple-0.4.16.0:semigroups
64-
-- allow-newer: direct-sqlite-2.3.24:semigroups
65-
66-
-- needed for doctests
67-
write-ghc-environment-files: always
68-
69-
-- https://github.com/chordify/haskell-servant-pagination/pull/12
70-
allow-newer: servant-pagination-2.2.2:servant
71-
allow-newer: servant-pagination-2.2.2:servant-server
72-
73-
allow-newer: servant-js:servant
74-
75-
-- ghc 9
76-
allow-newer: tdigest:base
62+
package servant-server
63+
ghc-options: -fprint-redundant-promotion-ticks

changelog.d/1432

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)