Skip to content

Commit 6b49557

Browse files
Support GHC 9.8 and 9.10
GHC 9.8 and 9.10 give a lot of Haddock warnings. We used to check the Haddock for all GHC versions, but this is overkill. Just check it on GHC 9.6 only. Haddock for GHC 9.8 and up generate more information about type family instances. However, this also leads to "could not find link destinations for" warnings that are somehow related to these type family instances. I suspect a bug in Haddock rather than something we can fix. We used to first invoke `cabal build` and then `cabal build --enable-documentation`. But this rebuilds all dependencies, effectively doubling running time. The `allow-newer` on `circuit-notation` is superfluous.
1 parent aafdee7 commit 6b49557

File tree

10 files changed

+32
-25
lines changed

10 files changed

+32
-25
lines changed

.ci/apply_settings.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
if [[ "$check_haddock" != @(true|false) ]]; then
4+
echo "check_haddock: Expected true or false, got \"$check_haddock\"" >&2
5+
exit 1
6+
fi
7+
sed <.ci/cabal.project.local.in >cabal.project.local "
8+
s/__CHECK_HADDOCK__/$check_haddock/"

.ci/build_docs.sh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
11
#!/bin/bash
22
set -xeou pipefail
33

4-
# Build dependencies first, so they don't end up in logs
5-
cabal v2-build \
6-
--constraint=clash-prelude==$clash_version \
7-
--enable-documentation \
8-
--allow-newer=circuit-notation:ghc \
9-
clash-protocols
10-
11-
# circuit-notation currently _compiles on 8.10, but isn't usable. The only
12-
# other GHC version it supports is 8.6.5, but this GHC bundles a Haddock that
13-
# cannot generate documentation for clash-prelude. Hence, we build docs with
14-
# 8.10 and relax circuit-notation's ghc bounds
154
cabal v2-haddock \
165
--constraint=clash-prelude==$clash_version \
17-
--enable-documentation \
18-
--allow-newer=circuit-notation:ghc \
196
clash-protocols \
207
|& tee haddock_log
218

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
package *
2+
documentation: __CHECK_HADDOCK__
3+
14
package clash-protocols
25
ghc-options: -Werror

.ci/test_cabal.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
22
set -xeou pipefail
33

4-
cabal v2-build all --constraint=clash-prelude==$clash_version -fci
54
cabal v2-run unittests --constraint=clash-prelude==$clash_version -fci --enable-tests
65
cabal v2-run doctests --constraint=clash-prelude==$clash_version -fci --enable-tests
76
cabal v2-sdist clash-protocols

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,30 @@ jobs:
4747
.ci/test_stack.sh
4848
4949
cabal:
50-
name: Cabal tests - ghc ${{ matrix.ghc }} / clash ${{ matrix.clash }}
50+
name: Cabal tests - ghc ${{ matrix.ghc }} / clash ${{ matrix.clash }} / doc ${{ matrix.check_haddock }}
5151
runs-on: ${{ matrix.os }}
5252
strategy:
5353
fail-fast: false
5454
matrix:
5555
os: [ubuntu-latest]
5656
clash:
57-
- "1.8.1"
57+
- "1.8.2"
5858
cabal:
5959
- "3.10"
6060
ghc:
6161
- "9.0.2"
6262
- "9.2.8"
6363
- "9.4.8"
64-
- "9.6.4"
64+
- "9.8.4"
65+
- "9.10.1"
66+
check_haddock:
67+
- "false"
68+
include:
69+
- ghc: "9.6.4"
70+
check_haddock: "true"
6571

6672
env:
73+
check_haddock: ${{ matrix.check_haddock }}
6774
clash_version: ${{ matrix.clash }}
6875

6976
steps:
@@ -79,7 +86,7 @@ jobs:
7986

8087
- name: Use CI specific settings
8188
run: |
82-
cp .ci/cabal.project.local .
89+
.ci/apply_settings.sh
8390
8491
- name: Setup CI
8592
run: |
@@ -105,6 +112,7 @@ jobs:
105112
.ci/test_cabal.sh
106113
107114
- name: Documentation
115+
if: ${{ matrix.check_haddock }}
108116
run: |
109117
.ci/build_docs.sh
110118

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ package clash-prelude
1414
source-repository-package
1515
type: git
1616
location: https://github.com/cchalmers/circuit-notation.git
17-
tag: 19b386c4aa3ff690758ae089c7754303f3500cc9
17+
tag: 564769c52aa05b90f81bbc898b7af7087d96613d
1818

1919
package clash-protocols-base
2020
-- Reduces compile times by ~20%

clash-protocols-base/clash-protocols-base.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ library
104104
, circuit-notation
105105
, deepseq
106106
, extra
107-
, ghc >= 8.7 && < 9.7
107+
, ghc >= 8.7 && < 9.11
108108
, hashable
109109
, tagged
110110
, template-haskell

clash-protocols/clash-protocols.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ library
120120
, data-default ^>= 0.7.1.1
121121
, deepseq
122122
, extra
123-
, ghc >= 8.7 && < 9.7
123+
, ghc >= 8.7 && < 9.11
124124
, hashable
125125
, hedgehog >= 1.0.2
126126
, lifted-async

clash-protocols/src/Protocols/Df.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,13 @@ import Prelude hiding (
114114
import qualified Data.Bifunctor as B
115115
import Data.Bool (bool)
116116
import qualified Data.Coerce as Coerce
117+
#if MIN_VERSION_base(4,19,0)
118+
import qualified Data.Functor as Functor (unzip)
119+
#else
120+
import qualified Data.List.NonEmpty as Functor (unzip)
121+
#endif
117122
import Data.Kind (Type)
118123
import Data.List ((\\))
119-
import qualified Data.List.NonEmpty
120124
import qualified Data.Maybe as Maybe
121125
import Data.Proxy
122126
import qualified Prelude as P
@@ -862,7 +866,7 @@ roundrobinCollect Parallel =
862866
nacks = C.repeat (Ack False)
863867
acks = Maybe.fromMaybe nacks ((\i -> C.replace i ack nacks) <$> iM)
864868
dat1 = Maybe.fromMaybe NoData dat0
865-
(iM, dat0) = Data.List.NonEmpty.unzip dats1
869+
(iM, dat0) = Functor.unzip dats1
866870
dats1 = C.fold @(n C.- 1) (<|>) (C.zipWith goDat C.indicesI dats0)
867871

868872
goDat i dat

clash-protocols/src/Protocols/Internal.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
{-# LANGUAGE TypeFamilyDependencies #-}
77
{-# LANGUAGE UndecidableInstances #-}
88
{-# OPTIONS_GHC -fconstraint-solver-iterations=20 #-}
9-
#if !MIN_VERSION_clash_prelude(1, 8, 2)
109
{-# OPTIONS_GHC -fno-warn-orphans #-}
11-
#endif
1210

1311
-- TODO: Hide internal documentation
1412
-- {-# OPTIONS_HADDOCK hide #-}

0 commit comments

Comments
 (0)