Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .ci/stack-9.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
resolver: nightly-2025-04-17

ghc-options:
"$locals": -Wall -Wcompat

packages:
- clash-prelude
- clash-prelude-hedgehog
- clash-lib
- clash-lib-hedgehog
- clash-ghc
- clash-cores
- tests

extra-deps:
- tasty-flaky-0.1.2.0@sha256:2f91ab9f55ae0c472474087f98bb54076aca18f8b058343479d24597a3aa181b,1858
2 changes: 1 addition & 1 deletion .ci/stack-9.4.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-21.12
resolver: lts-21.21

ghc-options:
"$locals": -Wall -Wcompat
Expand Down
16 changes: 3 additions & 13 deletions .ci/stack-9.6.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-22.9
resolver: lts-22.43

ghc-options:
"$locals": -Wall -Wcompat
Expand All @@ -13,16 +13,6 @@ packages:
- tests

extra-deps:
- ansi-terminal-0.11.5@sha256:2fe3d006b9ea0dc1a5537a029edb0bc2bbe56a33a6d95264b38b54c58e931e51,3752
- hedgehog-1.2@sha256:cb20b0f1dad7a7e4461085ea2d8ef084a19d0d5f137133bf88d1fd2f7ce9a5aa,4561
- hedgehog-fakedata-0.0.1.5@sha256:d8059e4ef9b7b4112bef9791300118f3a2d776bb191e50b41635a411af609428,1424
- tasty-1.5@sha256:c62c96da1e9d65bf61ce583e9f7085eed1daeb62a45f3106ca252bf9ef87025b,2763
- hedgehog-fakedata-0.0.1.5@sha256:955223750b74b0097ce426c07409c4629d22fb6cbd3b6bd0e9aeedf991241bad,1424
- tasty-1.5.3@sha256:9d56ea9dbc274fc853fc531373b2c91bfe360e21460c2c6a5838897d86e3f6d0,2923
- tasty-flaky-0.1.2.0@sha256:2f91ab9f55ae0c472474087f98bb54076aca18f8b058343479d24597a3aa181b,1858

# TODO: Remove this workaround. See:
#
# https://github.com/clash-lang/clash-compiler/pull/2665#issuecomment-1939044550
- git: https://github.com/haskell/cabal.git
commit: a3865991986361b3a736007f620b6a8878d178e3
subdirs:
- Cabal
10 changes: 4 additions & 6 deletions .ci/stack-9.8.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-23.2
resolver: lts-23.18

ghc-options:
"$locals": -Wall -Wcompat
Expand All @@ -13,9 +13,7 @@ packages:
- tests

extra-deps:
- fakedata-1.0.3@sha256:75630f6b9665965b4b551239ffcf89e4f879f93d235b18d4b249b0ed50513d0d,24593
- hedgehog-fakedata-0.0.1.5@sha256:d8059e4ef9b7b4112bef9791300118f3a2d776bb191e50b41635a411af609428,1424
- string-random-0.1.4.3@sha256:4b3092568889e00b419093a1938f14a67743844bc86476ee5cb6f8827dc40545,2172
- fakedata-1.0.5@sha256:c44c037382a296f3a92991479fdc9522c31935322a67641b8bf107872a425d21,24593
- hedgehog-fakedata-0.0.1.5@sha256:955223750b74b0097ce426c07409c4629d22fb6cbd3b6bd0e9aeedf991241bad,1424
- string-random-0.1.4.4@sha256:5ea686e58354e89a9f236f795b9b161c8730a61b56194281639b97742d53ba48,2144
- tasty-flaky-0.1.2.0@sha256:2f91ab9f55ae0c472474087f98bb54076aca18f8b058343479d24597a3aa181b,1858

allow-newer: true
96 changes: 72 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,52 +15,57 @@ concurrency:
jobs:
build_mac_windows:
name: Build and run limited tests
runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: ["macOS", "windows"]
ghc: ["8.6", "8.8", "8.10", "9.0", "9.2", "9.4", "9.6", "9.8"]
os: ["macOS-13", "windows-latest"]
ghc: ["8.6", "8.8", "8.10", "9.0", "9.2", "9.4", "9.6", "9.8", "9.10"]
exclude:
# Some tests fail with a mysterious -11 error code.
- os: "macOS"
- os: "macOS-13"
ghc: "8.10"

# Windows gets non-deterministically gets stuck in infinite loops
# or segfaults while running the testcase.
- os: "windows"
- os: "windows-latest"
ghc: "8.8"

# GHC 9.0 fails to compile clash-cores due to a template haskell
# failure
- os: "windows"
- os: "windows-latest"
ghc: "9.0"

# GHC/Clash starts extremely slowly, see
# https://github.com/clash-lang/clash-compiler/issues/2684
- os: "windows"
- os: "windows-latest"
ghc: "9.6"

# Vector test suite takes an _extremely_ long time to execute. Same
# issue as 9.6?
- os: "windows"
- os: "windows-latest"
ghc: "9.8"

# Vector test suite takes an _extremely_ long time to execute. Same
# issue as 9.6?
- os: "windows-latest"
ghc: "9.10"

steps:
- uses: actions/checkout@v4
- uses: haskell/actions/setup@v2
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
enable-stack: true
stack-no-global: true

- name: Install IVerilog (macOS)
if: matrix.os == 'macOS'
if: ${{ startsWith(matrix.os, 'macOS') }}
run: brew install icarus-verilog

- name: Install IVerilog (Windows)
if: matrix.os == 'Windows'
if: ${{ startsWith(matrix.os, 'windows') }}
run: choco install --no-progress iverilog

- name: General Setup
Expand All @@ -70,18 +75,20 @@ jobs:
# Print out stack.yaml for debugging purposes
cat stack.yaml

- name: Cache (Windows)
if: ${{ runner.os == 'Windows' }}
uses: actions/cache@v4
- name: Restore cache (Windows)
if: ${{ startsWith(matrix.os, 'windows') }}
uses: actions/cache/restore@v4
id: cache-win
with:
# On windows we have to use "\" as a path separator, otherwise caching fails
path: |
${{ steps.setup-haskell.outputs.stack-root }}\snapshots
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('stack.yaml', '**/*.cabal', '.github/workflows/ci.yml') }}
restore-keys: ${{ matrix.os }}-${{ matrix.ghc }}-
- name: Cache (non-Windows)
if: ${{ runner.os != 'Windows' }}
uses: actions/cache@v4
- name: Restore cache (non-Windows)
if: ${{ !startsWith(matrix.os, 'windows') }}
uses: actions/cache/restore@v4
id: cache-other
with:
path: |
${{ steps.setup-haskell.outputs.stack-root }}/snapshots
Expand All @@ -104,6 +111,29 @@ jobs:
shell: bash
run: ./.ci/retry.sh stack build happy

- name: Build dependencies
run: stack build --only-dependencies

- name: Save cache (Windows)
uses: actions/cache/save@v4
# Trying to save over an existing cache gives distracting
# "Warning: Cache save failed." since they are immutable
if: ${{ startsWith(matrix.os, 'windows') && steps.cache-win.outputs.cache-hit != 'true' }}
with:
# On windows we have to use "\" as a path separator, otherwise caching fails
path: |
${{ steps.setup-haskell.outputs.stack-root }}\snapshots
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('stack.yaml', '**/*.cabal', '.github/workflows/ci.yml') }}
- name: Save cache (non-Windows)
uses: actions/cache/save@v4
# Trying to save over an existing cache gives distracting
# "Warning: Cache save failed." since they are immutable
if: ${{ !startsWith(matrix.os, 'windows') && steps.cache-other.outputs.cache-hit != 'true' }}
with:
path: |
${{ steps.setup-haskell.outputs.stack-root }}/snapshots
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('stack.yaml', '**/*.cabal', '.github/workflows/ci.yml') }}

# Note: the --pedantic switch adds -Wall -Werror to the options passed to
# GHC. Options specified in stack.yaml (like -Wcompat) are still passed;
# it is cumulative. Future versions of Stack might add behavior to
Expand Down Expand Up @@ -158,6 +188,8 @@ jobs:

- name: Setup CI
run: |
# Work around dubious owner error
git config --global --add safe.directory "$(pwd)"
export CABAL_DIR=$HOME/.cabal
./.ci/setup.sh
cabal v2-freeze
Expand All @@ -167,28 +199,44 @@ jobs:
mv cabal.project.freeze frozen

- name: Restore Cache
uses: actions/cache@v4
uses: actions/cache/restore@v4
id: cache
with:
path: |
dist-newstyle
~/.cabal/store

key: ${{ matrix.ghc }}-${{ hashFiles('frozen', 'cabal.project') }}
key: ${{ matrix.ghc }}-${{ hashFiles('frozen', 'cabal.project', '**/*.cabal', '.github/workflows/ci.yml') }}
restore-keys: ${{ matrix.ghc }}-

- name: Build Clash
run: |
export CABAL_DIR=$HOME/.cabal
./.ci/build.sh

- name: Save Cache
# Trying to save over an existing cache gives distracting
# "Warning: Cache save failed." since they are immutable
if: ${{ !cancelled() && steps.cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: |
dist-newstyle
~/.cabal/store

key: ${{ matrix.ghc }}-${{ hashFiles('frozen', 'cabal.project', '**/*.cabal', '.github/workflows/ci.yml') }}

- name: Unit Tests
if: github.ref != 'refs/heads/master'
run: |
export CABAL_DIR=$HOME/.cabal
cabal v2-test clash-prelude
cabal v2-test clash-lib
cabal v2-test clash-cores
cabal v2-test clash-cosim
cabal v2-run clash-prelude:doctests
cabal v2-run clash-prelude:unittests -- --hide-successes
cabal v2-run clash-lib:doctests
cabal v2-run clash-lib:unittests -- --hide-successes
cabal v2-run clash-cores:doctests
cabal v2-run clash-cores:unittests -- --hide-successes
cabal v2-run clash-cosim:test -- --hide-successes

- name: Testsuite (VHDL)
if: github.ref != 'refs/heads/master'
Expand All @@ -211,7 +259,7 @@ jobs:

all:
name: All jobs finished
if: always()
if: ${{ !cancelled() }}
needs: [
build_mac_windows,
build_and_test,
Expand Down
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,26 @@ git checkout 1.2
Note that release branches might contain non-released patches.

## GHC compatibility
| | Linux | Windows | macOS | Clash (released) | Clash (development version)
|------|-------|---------|-------|------------------|--------------------------
| 8.6 | ✔️ | ✔️ | ✔️ | 1.0 - 1.8 | ❌
| 8.8 | ✔️ | ❌ | ✔️ | 1.0 - 1.8 | ❌
| 8.10 | ✔️ | ✔️ | ❌ | 1.2 - 1.8 | ✔️
| 9.0 | ✔️ | ✔️² | ✔️ | 1.4 - 1.8 | ✔️
| 9.2 | ⚠️¹ | ⚠️¹ | ⚠️¹ | 1.8 | ⚠️¹️
| 9.4 | ⚠️³ ️ | ⚠️³ | ️⚠️³ ️ | 1.8 | ✔️
| 9.6 | ✔️³ | ✔️³ | ✔️³ | 1.8 | ✔️
| 9.8 | ✔️ | ✔️ | ✔️ | 1.8 | ️✔️

¹ GHC 9.2 contains a regression, rendering Clash error messages indecipherable. This change was reverted in 9.4.

² GHC 9.0.2 on Windows fails to compile `clash-cores`. We therefore don't run the Clash test suite on CI for this combination.

³ Clash starts extremely slowly when compiled with 9.4.8 up to and including 9.6.2. Consider downgrading to 9.4.7 or upgrading to 9.6.3 and up.
| | Linux | Windows | macOS | Clash (released) | Clash (development version)
|------|---------------------------------|---------------------------------|---------------------------------|------------------|------------------------------
| 8.6 | ✔️ | ✔️ | ✔️ | 1.0 - 1.8 | ❌
| 8.8 | ✔️ | ❌ | ✔️ | 1.0 - 1.8 | ❌
| 8.10 | ✔️ | ✔️ | ❌ | 1.2 - 1.8 | ✔️
| 9.0 | &#x2714;&#xfe0f; | &#x2714;&#xfe0f;<sup>2</sup> | &#x2714;&#xfe0f; | 1.4 - 1.8 | &#x2714;&#xfe0f;
| 9.2 | &#x26a0;&#xfe0f;<sup>1</sup> | &#x26a0;&#xfe0f;<sup>1</sup> | &#x26a0;&#xfe0f;<sup>1</sup> | 1.8 | &#x26a0;&#xfe0f;<sup>1</sup>
| 9.4 | &#x26a0;&#xfe0f;<sup>3</sup> ️ | &#x26a0;&#xfe0f;<sup>3</sup> | ️&#x26a0;&#xfe0f;<sup>3</sup> ️ | 1.8 | &#x2714;&#xfe0f;
| 9.6 | &#x2714;&#xfe0f;<sup>3</sup> | &#x2714;&#xfe0f;<sup>3,4</sup> | &#x2714;&#xfe0f;<sup>3</sup> | 1.8 | &#x2714;&#xfe0f;
| 9.8 | &#x2714;&#xfe0f; | &#x2714;&#xfe0f;<sup>4</sup> | &#x2714;&#xfe0f; | 1.8 | ️&#x2714;&#xfe0f;
| 9.10 | &#x2714;&#xfe0f; | &#x2714;&#xfe0f;<sup>4</sup> | &#x2714;&#xfe0f; | 1.8 | ️&#x2714;&#xfe0f;


<sup>1</sup> GHC 9.2 contains a regression, rendering Clash error messages indecipherable. This change was reverted in 9.4.

<sup>2</sup> GHC 9.0.2 on Windows fails to compile `clash-cores`. We therefore don't run the Clash test suite on CI for this combination.

<sup>3</sup> Clash starts extremely slowly when compiled with 9.4.8 up to and including 9.6.2. Consider downgrading to 9.4.7 or upgrading to 9.6.3 and up.

<sup>4</sup> Clash starts extremely slowly on Windows with GHC 9.6 through 9.10, consider downgrading to 9.4.7

## Cabal
To use Cabal you need both Cabal and GHC installed on your system. We recommend using [ghcup](https://www.haskell.org/ghcup/). For more information, see [https://www.haskell.org/downloads/](https://www.haskell.org/downloads/).
Expand Down
1 change: 1 addition & 0 deletions changelog/2025-04-27T14_45_08+02_00_windows_910
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ADDED: Support for GHC 9.10 on Windows (macOS and Linux were already supported)
2 changes: 1 addition & 1 deletion clash-ghc/clash-ghc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ library
CPP-Options: -DUSE_GHC_PATHS=1

if os(windows)
Build-Depends: Win32 >= 2.3.1 && < 2.14
Build-Depends: Win32 >= 2.3.1 && < 2.15
else
Build-Depends: unix >= 2.7.1 && < 2.9

Expand Down