Skip to content

Commit 94e6c31

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. 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. Further details: 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. Given an `instance C A`, it would seem that when it lists the instance under the Haddock of the definition of `C`, it tries to create a link to the listing of the instance under the Haddock of the definition of `A`, and fails somehow. I suspect a bug in Haddock rather than something we can fix.
1 parent 2f33cf2 commit 94e6c31

File tree

10 files changed

+36
-26
lines changed

10 files changed

+36
-26
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

.ci/cabal.project.local

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

.ci/cabal.project.local.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package *
2+
documentation: __CHECK_HADDOCK__
3+
4+
package clash-protocols
5+
documentation: False
6+
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: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,32 @@ 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+
include:
67+
- check_haddock: "False"
68+
- ghc: "9.6.4"
69+
check_haddock: "True"
70+
os: "ubuntu-latest"
71+
clash: "1.8.2"
72+
cabal: "3.10"
6573

6674
env:
75+
check_haddock: ${{ matrix.check_haddock }}
6776
clash_version: ${{ matrix.clash }}
6877

6978
steps:
@@ -79,7 +88,7 @@ jobs:
7988

8089
- name: Use CI specific settings
8190
run: |
82-
cp .ci/cabal.project.local .
91+
.ci/apply_settings.sh
8392
8493
- name: Setup CI
8594
run: |
@@ -105,6 +114,7 @@ jobs:
105114
.ci/test_cabal.sh
106115
107116
- name: Documentation
117+
if: ${{ matrix.check_haddock == 'True' }}
108118
run: |
109119
.ci/build_docs.sh
110120

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/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 #-}

stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ packages:
66

77
extra-deps:
88
- git: https://github.com/cchalmers/circuit-notation.git
9-
commit: 19b386c4aa3ff690758ae089c7754303f3500cc9
9+
commit: 564769c52aa05b90f81bbc898b7af7087d96613d
1010
- clash-prelude-1.8.1
1111
- clash-prelude-hedgehog-1.8.1

0 commit comments

Comments
 (0)