Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
788d332
Update flake
rowanG077 Dec 23, 2025
24e7d90
Update nix haskell overlays
rowanG077 Dec 23, 2025
6db0636
doctest <0.4 -> <0.5
rowanG077 Dec 23, 2025
b068030
GA: Update GHC matrix for nix jobs
rowanG077 Dec 23, 2025
2f1d9cf
flake: Use ghc 9.10.3
rowanG077 Dec 24, 2025
d29e895
clash-ghc: Remove Opt_LlvmTBAA from unwanted
rowanG077 Dec 24, 2025
6c7a1a3
Add changelog
rowanG077 Dec 24, 2025
64f09f4
Flake: Fix renamed packages
rowanG077 Dec 24, 2025
7bb110c
flake: Fix lib.optional usage
rowanG077 Dec 24, 2025
0636cc0
Bump CI versions
DigitalBrains1 Dec 29, 2025
36b1f97
clash-ffi: Remove seemingly wrong buildable guards
rowanG077 Dec 30, 2025
ac5d7ca
clash-ffi: Make ffi_interface-tests a proper test-suite
rowanG077 Dec 30, 2025
af906b8
nix: Make clash-ffi work including tests
rowanG077 Dec 30, 2025
e38f41b
ci: Remove conditional test run for clash-ffi
rowanG077 Dec 30, 2025
adf764c
Revert "clash-ffi: Remove seemingly wrong buildable guards"
DigitalBrains1 Dec 30, 2025
2bfa624
Revert "ci: Remove conditional test run for clash-ffi"
DigitalBrains1 Dec 30, 2025
0dbddc3
GitLab CI: Enable `clash-ffi` on GHC 9.10.3
DigitalBrains1 Dec 30, 2025
fdbb7b8
Unneeded clause in overlay-ghc98.nix
DigitalBrains1 Dec 30, 2025
7304cb0
Make `clash-ffi` buildable on GHC 9.10
DigitalBrains1 Dec 30, 2025
7866f56
Nix: Mark clash-ffi broken on the GHC version it does not work on
DigitalBrains1 Dec 30, 2025
8f9ba76
Finalize handling of GHC issue in clash-ffi
DigitalBrains1 Jan 7, 2026
32b4294
update flake.lock
rowanG077 Feb 10, 2026
66efc21
Fix test running for natnormalise and extra plugins
rowanG077 Feb 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ clash-prelude:doctests
clash-prelude:unittests
clash-testsuite:clash-testsuite
"
mkdir bin
for TEST in $TESTS; do
ln -s "$(realpath --relative-to=bin "$(cabal list-bin $TEST)")" bin/$TEST
done

# TODO: remove this and put it back into tests when
# https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
# is fixed
# GHC 9.8.3, 9.8.4 and 9.10.2 have issues, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
set +u
if [[ "$SKIP_CLASH_FFI_EXAMPLE" != "yes" ]]; then
ln -s "$(realpath --relative-to=bin "$(cabal list-bin clash-ffi:ffi-interface-tests)")" bin/clash-ffi:ffi-interface-tests
TESTS="$TESTS clash-ffi:ffi-interface-tests"
fi
set -u

mkdir bin
for TEST in $TESTS; do
ln -s "$(realpath --relative-to=bin "$(cabal list-bin $TEST)")" bin/$TEST
done
2 changes: 1 addition & 1 deletion .ci/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ RUN git clone https://github.com/verilator/verilator verilator \

FROM builder AS build-ghc

ARG ghcup_version="0.1.40.0"
ARG ghcup_version="0.1.50.2"

# Must be explicitly set
ARG ghc_version
Expand Down
6 changes: 3 additions & 3 deletions .ci/docker/build-and-publish-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ elif [[ "$1" != "" ]]; then
echo "Unrecognized argument: $1" >&2
exit 1
fi
UBUNTU_VERSION=jammy-20250126
GHC_VERSIONS=("9.10.2" "9.8.4" "9.6.7" "9.4.8" "9.2.8" "9.0.2" "8.10.7")
CABAL_VERSIONS=("3.14.2.0" "3.14.2.0" "3.14.2.0" "3.14.2.0" "3.14.2.0" "3.14.2.0" "3.12.1.0")
UBUNTU_VERSION=jammy-20251013
GHC_VERSIONS=( "9.10.3" "9.8.4" "9.6.7")
CABAL_VERSIONS=("3.14.2.0" "3.14.2.0" "3.14.2.0")

# We want to use docker buildkit so that our layers are built in parallel. This
# is ignored completely on versions of docker which don't support buildkit.
Expand Down
2 changes: 1 addition & 1 deletion .ci/gitlab/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.benchmark:
image: ghcr.io/clash-lang/clash-ci:$GHC_VERSION-20251007
image: ghcr.io/clash-lang/clash-ci:$GHC_VERSION-20251229
stage: test
timeout: 2 hours
variables:
Expand Down
2 changes: 1 addition & 1 deletion .ci/gitlab/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ default:
timeout: 10 minutes
stage: build
variables:
CLASH_DOCKER_TAG: 20251007
CLASH_DOCKER_TAG: 20251229
CACHE_BUST_TOKEN: 3
# Note that we copy+paste the image name into CACHE_FALLBACK_KEY. If we don't,
# $GHC_VERSION gets inserted at verbatim, instead of resolving to some ghc version.
Expand Down
6 changes: 2 additions & 4 deletions .ci/gitlab/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ lib:unittests:

ffi:interface-tests:
extends: .test-nocache
# TODO: remove this when https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
# is fixed
# GHC 9.8.3, 9.8.4 and 9.10.2 have issues, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
rules:
- if: $SKIP_CLASH_FFI_EXAMPLE != "yes"
script:
Expand Down Expand Up @@ -154,8 +153,7 @@ ffi:example:
extends:
- .common-local
- .nightly-rules
# TODO: remove this when https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
# is fixed
# GHC 9.8.3, 9.8.4 and 9.10.2 have issues, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
rules:
- if: $SKIP_CLASH_FFI_EXAMPLE != "yes"
stage: test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:

# Run steps inside the clash CI docker image
container:
image: ghcr.io/clash-lang/clash-ci:${{ matrix.ghc }}-20251007
image: ghcr.io/clash-lang/clash-ci:${{ matrix.ghc }}-20251229

env:
THREADS: 2
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
fail-fast: false
matrix:
ghc: [
"ghc9101",
"ghc982",
"ghc964"
ghc9103,
ghc984,
ghc967
]
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -65,9 +65,9 @@ jobs:
fail-fast: false
matrix:
ghc: [
"ghc9101",
"ghc982",
"ghc964"
ghc9103,
ghc984,
ghc967
]
package: [
"clash-benchmark",
Expand All @@ -80,6 +80,10 @@ jobs:
"clash-term",
"clash-testsuite"
]
exclude:
- ghc: ghc984
package: clash-ffi

needs: packages_common
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -108,9 +112,9 @@ jobs:
fail-fast: false
matrix:
ghc: [
ghc9101,
ghc982,
ghc964
ghc9103,
ghc984,
ghc967
]
steps:
- uses: actions/checkout@v4
Expand Down
8 changes: 2 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,11 @@ tests:
CI_PARENT_PIPELINE_SOURCE: $CI_PIPELINE_SOURCE
parallel:
matrix:
- GHC_VERSION: 9.10.2
# TODO: remove this when https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
# is fixed
SKIP_CLASH_FFI_EXAMPLE: "yes"
- GHC_VERSION: 9.10.3
RUN_TESTS: "always"

- GHC_VERSION: 9.8.4
# TODO: remove this when https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
# is fixed
# GHC 9.8.3, 9.8.4 and 9.10.2 have issues, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
SKIP_CLASH_FFI_EXAMPLE: "yes"
RUN_TESTS: "always"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
clash-ghc: Remove "Opt_LlvmTBAA" from unwanted flags. See [#2508](https://github.com/clash-lang/clash-compiler/issues/2823).
13 changes: 6 additions & 7 deletions clash-ffi/clash-ffi.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ library
Clash.FFI.VPI.Port
Clash.FFI.VPI.Port.Direction
Clash.FFI.VPI.Reg
-- TODO: remove this once https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
-- is fixed
if impl(ghc < 9.8.3) || impl(ghc == 9.10.1)
-- GHC 9.8.3, 9.8.4 and 9.10.2 have issues, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
if impl(ghc < 9.8.3) || impl(ghc == 9.10.1) || impl(ghc > 9.10.2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not:

if impl(ghc < 9.8.3) || impl(ghc >= 9.10.1)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because GHC 9.10.2 has the issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course we could do

if impl(ghc < 9.8.3) || impl(ghc > 9.10.2)

and just ignore the fact that 9.10.1 would actually work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, perhaps we should reverse the logic and do:

-- GHC 9.8.4 and 9.10.2 have issues, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
if impl(ghc == 9.8.4) || impl(ghc == 9.10.2)
  buildable: False
else
  buildable: True

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're thinking nobody will be trying 9.8.3 anymore? In that case, it would indeed match everything in practice.

What happened to 9.8.3? :-) Do you know why it was pulled from GHCup? I couldn't find anything at a really quick glance, and my dinner is cooling.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can just leave the logic as is, but update the comment to specify which GHCs are affected

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me! What do we do with

-- TODO: remove this once https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
-- is fixed

I'm not sure what it suggests we do, but I think it's saying: once GHC 9.8 and GHC 9.10 both have received a minor version update that fixes the bug, remove this stanza. I wonder whether that would even be a good idea.

Also, after reading the discussion about 9.8.3 I linked to in my previous message, I doubt there will ever be another 9.8 release.

You wrote the comment; what did you intend?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I meant that when a fix was released, we should properly fix the bounds. The original version didn’t allow building on e.g. GHC 9.12

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I've updated the comments from

-- TODO: remove this once https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
-- is fixed

to

-- GHC 9.8.3, 9.8.4 and 9.10.2 have issues, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406

I note that in .ci/build.sh the phrasing was a bit different:

# TODO: remove this and put it back into tests when
# https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
# is fixed

I think it'll be quite a while before we can actually put it back into tests; I suppose that will be once we drop 9.8 support from Clash. In the interest of clarity and maintainability, I've rewritten it a bit so it doesn't duplicate shell code and is easier to grok.

Are you satisfied with how it is now, @christiaanb ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christiaanb Just pinging you again on this PR so it doesn't slip through the cracks. If you are not satisfied yet please let us know.

buildable: True
else
buildable: False

executable ffi-interface-tests
test-suite ffi-interface-tests
import: common-options
type: exitcode-stdio-1.0
default-extensions:
DataKinds
RankNTypes
Expand Down Expand Up @@ -113,9 +113,8 @@ executable ffi-interface-tests
, tasty
, tasty-hunit
, tasty-smallcheck
-- TODO: remove this once https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
-- is fixed
if impl(ghc < 9.8.3) || impl(ghc == 9.10.1)
-- GHC 9.8.3, 9.8.4 and 9.10.2 have issues, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12264#note_602406
if impl(ghc < 9.8.3) || impl(ghc == 9.10.1) || impl(ghc > 9.10.2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not

if impl(ghc < 9.8.3) || impl(ghc >= 9.10.1)

buildable: True
else
buildable: False
3 changes: 0 additions & 3 deletions clash-ghc/src-ghc/Clash/GHC/LoadModules.hs
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,6 @@ unwantedOptimizationFlags df =
, Opt_RegsGraph -- Don't care
, Opt_RegsGraph -- Don't care
, Opt_PedanticBottoms -- Stops eta-expansion through case: avoid
#if !MIN_VERSION_ghc(9,10,0)
, Opt_LlvmTBAA -- Don't care
#endif
, Opt_CmmSink -- Don't care
, Opt_CmmElimCommonBlocks -- Don't care
, Opt_OmitYields -- Don't care
Expand Down
2 changes: 1 addition & 1 deletion clash-lib/clash-lib.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ test-suite doctests
build-depends:
base,
clash-lib,
doctest-parallel >= 0.2 && < 0.4,
doctest-parallel >= 0.2 && < 0.5,
filepath

test-suite unittests
Expand Down
2 changes: 1 addition & 1 deletion clash-prelude/clash-prelude.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ test-suite doctests
build-depends:
base,
clash-prelude,
doctest-parallel >= 0.3.1 && < 0.4,
doctest-parallel >= 0.3.1 && < 0.5,
filepath

if arch(x86_64) && flag(workaround-ghc-mmap-crash)
Expand Down
36 changes: 18 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
# The versions of GHC that we want to be able to build / develop against
# within the nix environment. Since nix is lazy, only derivations for
# versions of GHC which are used are actually evaluated.
ghcVersions = [ "ghc964" "ghc982" "ghc9101" ];
ghcVersions = [ "ghc967" "ghc984" "ghc9103" ];

# We pick a single version of GHC to use by default within nix. This is
# probably cleaner than always having N copies of each package / app and
# being forced to refer to them by their GHC version.
defaultGhcVersion = "ghc9101";
defaultGhcVersion = "ghc9103";

# Overlays are not per-system, so let's only compute them once.
# For each version of GHC we produce a `pkgs.clashPackages-ghcVER`, e.g.
# `pkgs.clashPackages-ghc962`.
# `pkgs.clashPackages-ghc967`.
overlays =
let
makeOverlay =
Expand Down
10 changes: 6 additions & 4 deletions nix/devshell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ pkgs.mkShell {
# https://discourse.nixos.org/t/non-interactive-bash-errors-from-flake-nix-mkshell/33310
pkgs.bashInteractive

pkgs.ghdl-llvm
pkgs.nixpkgs-fmt
pkgs.symbiyosys
pkgs.sby
pkgs.verilator
pkgs.verilog
pkgs.iverilog
pkgs.yosys
];
] ++
# depends on gnat14 which doesn't work ATM on aarch64:
# https://github.com/NixOS/nixpkgs/issues/469109
pkgs.lib.optional (!pkgs.stdenv.hostPlatform.isAarch64) pkgs.ghdl-llvm;
}
Loading
Loading