Skip to content

Commit

Permalink
Tighten lower bounds, loosen upper bounds
Browse files Browse the repository at this point in the history
We now explicitly test in CI the lower and upper bounds in our
`build-depends`.

The PvP allows incrementing just the minor version of a package in the
case of an API addition. Testing the lower bounds explicitly assures we
don't accidentally rely on an API addition made in a minor version.

Attempting to test this case revealed our existing lower bounds could
not be tested because it did not lead to a valid build plan. So the
bounds have been tightened to specify a minor version that we can
actually test.

We can loosen our upper bounds to include the newest versions of `text`
and `tasty` by testing this configuration with cabal's `allow-newer`.
  • Loading branch information
DigitalBrains1 committed Sep 17, 2023
1 parent f0feb84 commit 991cf48
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
13 changes: 13 additions & 0 deletions .ci/cabal.project.local-lower
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package prettyprinter-interp
ghc-options: -Werror
prefer-oldest: True
constraints:
any.text ==1.2.3.0,
any.prettyprinter ==1.2,
any.string-interpolate ==0.3.1.0,
any.tasty ==1.2.2,
any.tasty-hunit ==0.10.0.2,
-- text-conversions-0.3.1.1 misses lower bound
any.base64-bytestring ==1.0.0.0,
-- string-interpolate-0.3.1.0 misses lower bound
any.utf8-string ==0.3.1,
8 changes: 8 additions & 0 deletions .ci/cabal.project.local-upper
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package prettyprinter-interp
ghc-options: -Werror
allow-newer:
text,
tasty,
constraints:
any.text == 2.1,
any.tasty == 1.5,
12 changes: 10 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,18 @@ jobs:

# Cabal
cabal:
name: Cabal / GHC ${{ matrix.ghc }}
name: Cabal / GHC ${{ matrix.ghc }} ${{ matrix.project-variant }}
runs-on: ubuntu-latest
strategy:
matrix:
ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2", "9.2.8", "9.4.7", "9.6.2"]
project-variant: [""]
include:
- ghc: 8.6.5
project-variant: -lower
- ghc: 9.6.2
project-variant: -upper

fail-fast: false
steps:
- name: Checkout
Expand All @@ -97,7 +104,8 @@ jobs:

- name: General Setup
run: |
cp .ci/cabal.project.local .
cp .ci/cabal.project.local${{ matrix.project-variant}} \
cabal.project.local
# Print out some information for debugging purposes
ghc --version
cabal --version
Expand Down
8 changes: 4 additions & 4 deletions prettyprinter-interp.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ source-repository head
source-repository this
type: git
location: https://github.com/DigitalBrains1/prettyprinter-interp
tag: v0.2.0.0
tag: v0.2.0.0+r2

library
exposed-modules: Prettyprinter.Interpolate

build-depends: base >=4.12 && < 4.19,
prettyprinter >=1.2 && < 1.8,
string-interpolate ^>=0.3.1,
string-interpolate ^>=0.3.1.0,
template-haskell,
text >=1.2 && < 2.1,
text >=1.2.3.0 && < 2.2,
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall -Wcompat
Expand All @@ -46,7 +46,7 @@ test-suite unittests
prettyprinter,
prettyprinter-interp,
string-interpolate,
tasty >= 1.2 && < 1.5,
tasty >= 1.2.2 && < 1.6,
tasty-hunit ^>=0.10.0.2,
text,
ghc-options: -Wall -Wcompat

0 comments on commit 991cf48

Please sign in to comment.