diff --git a/.ci/cabal.project.local b/.ci/cabal.project.local index 659253ccbf..31160a2414 100644 --- a/.ci/cabal.project.local +++ b/.ci/cabal.project.local @@ -14,9 +14,6 @@ package clash-prelude tests: True benchmarks: True - -- clash-prelude unittests fail with dynamic executables - executable-dynamic: False - package clash-lib ghc-options: -Werror tests: True @@ -30,13 +27,20 @@ package clash-cosim ghc-options: -Werror tests: True - -- clash-cosim unittests fail with dynamic executables + -- clash-cosim unittests fail with dynamic executables because of a bug in + -- Cabal-the-library in combination with custom setup where the library path + -- is not added to the RPATH executable-dynamic: False package clash-cores ghc-options: -Werror tests: True + -- clash-cores unittests fail with dynamic executables because of a bug in + -- Cabal-the-library in combination with custom setup where the library path + -- is not added to the RPATH + executable-dynamic: False + package clash-prelude-hedgehog ghc-options: -Werror tests: True diff --git a/.ci/find_cabal_bin.sh b/.ci/find_cabal_bin.sh new file mode 100755 index 0000000000..1deedaeb5f --- /dev/null +++ b/.ci/find_cabal_bin.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail + +SIMPLE_PATH=$(echo dist-newstyle/build/*/*/"$1"-*/"$3"/"$2"/build/"$2"/"$2") +CUSTOM_PATH=$(echo dist-newstyle/build/*/*/"$1"-*/build/"$2"/"$2") + +if [ -x "$SIMPLE_PATH" ]; then + echo "$SIMPLE_PATH" +elif [ -x "$CUSTOM_PATH" ]; then + echo "$CUSTOM_PATH" +else + echo "find_cabal_bin.sh: Could not find $1 $2" >/dev/stderr +fi diff --git a/.ci/gitlab/test.yml b/.ci/gitlab/test.yml index 8d733746a7..37b6ee9e07 100644 --- a/.ci/gitlab/test.yml +++ b/.ci/gitlab/test.yml @@ -82,37 +82,37 @@ build: cores:unittests: extends: .test-nocache script: - - ./dist-newstyle/build/*/*/clash-cores-*/t/unittests/build/unittests/unittests --hide-successes + - $(.ci/find_cabal_bin.sh clash-cores unittests t) --hide-successes cosim:unittests: extends: .test-nocache script: - - ./dist-newstyle/build/*/*/clash-cosim-*/build/test/test + - $(.ci/find_cabal_bin.sh clash-cosim test t) prelude:unittests: extends: .test-nocache script: - - ./dist-newstyle/build/*/*/clash-prelude-*/t/unittests/build/unittests/unittests --hide-successes + - $(.ci/find_cabal_bin.sh clash-prelude unittests t) --hide-successes lib:doctests: extends: .test-nocache script: - - ./dist-newstyle/build/*/*/clash-lib-*/t/doctests/build/doctests/doctests -j${THREADS} + - $(.ci/find_cabal_bin.sh clash-lib doctests t) -j${THREADS} lib:unittests: extends: .test-nocache script: - - ./dist-newstyle/build/*/*/clash-lib-*/t/unittests/build/unittests/unittests --hide-successes + - $(.ci/find_cabal_bin.sh clash-lib unittests t) --hide-successes prelude:doctests: extends: .test-nocache script: - - ./dist-newstyle/build/*/*/clash-prelude-*/t/doctests/build/doctests/doctests -j${THREADS} + - $(.ci/find_cabal_bin.sh clash-prelude doctests t) -j${THREADS} ffi:interface-tests: extends: .test-nocache script: - - ./dist-newstyle/build/*/*/clash-ffi-*/x/ffi-interface-tests/build/ffi-interface-tests/ffi-interface-tests --smallcheck-max-count 2000 + - $(.ci/find_cabal_bin.sh clash-ffi ffi-interface-tests x) --smallcheck-max-count 2000 # Tests run on local fast machines: @@ -128,17 +128,17 @@ build-clash-dev: suite:vhdl: extends: .test-cache-local script: - - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .VHDL --hide-successes --no-vivado + - $(.ci/find_cabal_bin.sh clash-testsuite clash-testsuite x) -j${THREADS} -p .VHDL --hide-successes --no-vivado suite:verilog: extends: .test-cache-local script: - - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .Verilog --hide-successes --no-vivado + - $(.ci/find_cabal_bin.sh clash-testsuite clash-testsuite x) -j${THREADS} -p .Verilog --hide-successes --no-vivado suite:systemverilog: extends: .test-cache-local script: - - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .SystemVerilog --hide-successes --no-modelsim --no-vivado + - $(.ci/find_cabal_bin.sh clash-testsuite clash-testsuite x) -j${THREADS} -p .SystemVerilog --hide-successes --no-modelsim --no-vivado # Vivado is quite slow, so we only run a subset of the tests on development branches # with it. The full testsuite gets run with Vivado every night on 'master'. @@ -146,7 +146,7 @@ suite:cores: extends: .test-cache-local script: - source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh - - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p Cores --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys + - $(.ci/find_cabal_bin.sh clash-testsuite clash-testsuite x) -j$THREADS -p Cores --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys tags: - local - vivado-2022.1-standard @@ -195,7 +195,7 @@ suite:vivado:verilog: extends: .test-cache-local-nightly script: - source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh - - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .Verilog --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys + - $(.ci/find_cabal_bin.sh clash-testsuite clash-testsuite x) -j$THREADS -p .Verilog --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys tags: - local - vivado-2022.1-standard @@ -215,7 +215,7 @@ suite:vivado:verilog: # extends: .test-cache-local-nightly # script: # - source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh -# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .VHDL --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys +# - $(.ci/find_cabal_bin.sh clash-testsuite clash-testsuite x) -j$THREADS -p .VHDL --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys # tags: # - local # - vivado-2022.1-standard diff --git a/.ci/stack-9.6.yaml b/.ci/stack-9.6.yaml new file mode 100644 index 0000000000..c29e6e4a98 --- /dev/null +++ b/.ci/stack-9.6.yaml @@ -0,0 +1,27 @@ +resolver: lts-22.9 + +ghc-options: + "$locals": -Wall -Wcompat + +packages: +- clash-prelude +- clash-prelude-hedgehog +- clash-lib +- clash-lib-hedgehog +- clash-ghc +- clash-cores +- 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 + +# 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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2c0ee35fc..127423f2a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,11 @@ jobs: fail-fast: false matrix: os: ["macOS", "windows"] +<<<<<<< HEAD ghc: ["8.6", "8.8", "8.10", "9.0", "9.2", "9.4"] +======= + ghc: ["8.10", "9.0", "9.2", "9.4", "9.6"] +>>>>>>> cb331a852 (Update README to list 9.6 properly (#2665)) exclude: # Some tests fail with a mysterious -11 error code. - os: macOS @@ -64,7 +68,7 @@ jobs: if: ${{ runner.os == 'Windows' }} uses: actions/cache@v3 with: - # On windows we have to use "\" as a path seperator, otherwise caching fails + # 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') }} diff --git a/README.md b/README.md index cf87134c49..4c73f3676f 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ Note that release branches might contain non-released patches. ## GHC compatibility | | Linux | Windows | macOS | Clash (released) | Clash (development version) |------|-------|---------|-------|------------------|-------------------------- +<<<<<<< HEAD | 8.6 | ✔️ | ✔️ | ✔️ | 1.0 - 1.6 | ✔️ | 8.8 | ✔️ | ❌ | ✔️ | 1.0 - 1.6 | ✔️ | 8.10 | ✔️ | ✔️ | ❌ | 1.2 - 1.6 | ✔️ @@ -72,13 +73,20 @@ Note that release branches might contain non-released patches. | 9.2 | ⚠️¹ | ⚠️¹ | ⚠️¹ | | ⚠️¹️ | 9.4 | ✔️ | ✔️ | ✔️ | | ✔️ | 9.6 | ✔️ | ❔³ | ❔³ | | ✔️ +======= +| 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 | ✔️ +>>>>>>> cb331a852 (Update README to list 9.6 properly (#2665)) ¹ 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 testsuite on CI for this combination. -³ We use Stack to test on Windows/macOS. There is no resolver yet that uses GHC 9.6, so this remains untested. - ## 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/). diff --git a/clash-cores/clash-cores.cabal b/clash-cores/clash-cores.cabal index ce179cb6fe..d018305df7 100644 --- a/clash-cores/clash-cores.cabal +++ b/clash-cores/clash-cores.cabal @@ -12,7 +12,10 @@ maintainer: devops@qbaylogic.com copyright: Copyright © 2019 , Foamspace Corp., 2022-2023, QBayLogic B.V. category: Hardware -build-type: Simple +-- TODO: Revert to "Simple". See: +-- +-- https://github.com/clash-lang/clash-compiler/pull/2665#issuecomment-1939044550 +build-type: Custom extra-source-files: CHANGELOG.md flag doctests @@ -39,6 +42,14 @@ flag nix default: False manual: True +-- TODO: Remove this workaround. See: +-- +-- https://github.com/clash-lang/clash-compiler/pull/2665#issuecomment-1939044550 +custom-setup + setup-depends: + base, + Cabal + common basic-config default-language: Haskell2010