Skip to content
Draft
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
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-20260217
GHC_VERSIONS=("9.12.4" "9.10.3" "9.8.4" "9.6.7")
CABAL_VERSIONS=("3.14.2.0" "3.14.2.0" "3.14.2.0" "3.14.2.0")
UBUNTU_VERSION=jammy-20260410
GHC_VERSIONS=( "9.14.1" "9.12.4" "9.10.3" "9.8.4" "9.6.7")
CABAL_VERSIONS=("3.16.1.0" "3.16.1.0" "3.16.1.0" "3.16.1.0" "3.16.1.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-20260417
image: ghcr.io/clash-lang/clash-ci:$GHC_VERSION-20260515
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: 2 hours
stage: build
variables:
CLASH_DOCKER_TAG: 20260417
CLASH_DOCKER_TAG: 20260515
CACHE_BUST_TOKEN: 3
# Note that the fallback key has two cache bust tokens. `$CACHE_BUST_TOKEN`
# is our own, defined right above, and the `-3` at the end in the fallback
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
os: ["macos-26", "windows-latest"]
ghc: ["9.6", "9.8", "9.10", "9.12"]
ghc: ["9.6", "9.8", "9.10", "9.12", "9.14"]
exclude:
# GHC/Clash starts extremely slowly, see
# https://github.com/clash-lang/clash-compiler/issues/2684
Expand All @@ -43,6 +43,9 @@ jobs:
- os: "windows-latest"
ghc: "9.12"

- os: "windows-latest"
ghc: "9.14"

steps:
- uses: actions/checkout@v5
- uses: haskell-actions/setup@v2
Expand Down Expand Up @@ -152,7 +155,7 @@ jobs:

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

env:
THREADS: 2
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ jobs:
"clash-prelude-hedgehog",
"clash-profiling",
"clash-profiling-prepare",
"clash-term",
"clash-testsuite"
]
exclude:
Expand Down
3 changes: 3 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ tests:
CI_PARENT_PIPELINE_SOURCE: $CI_PIPELINE_SOURCE
parallel:
matrix:
- GHC_VERSION: 9.14.1
RUN_TESTS: "always"

- GHC_VERSION: 9.12.4
RUN_TESTS: "always"

Expand Down
19 changes: 3 additions & 16 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ write-ghc-environment-files: always
-- index state, to go along with the cabal.project.freeze file. update the index
-- state by running `cabal update` twice and looking at the index state it
-- displays to you (as the second update will be a no-op)
index-state: 2026-05-09T11:46:50Z
index-state: 2026-05-15T04:09:15Z

-- For some reason the `clash-testsuite` executable fails to run without
-- this, as it cannot find the related library...
Expand Down Expand Up @@ -54,23 +54,14 @@ optional-packages:
./benchmark/profiling/prepare
./benchmark/profiling/run
./clash-cosim
./clash-term

allow-newer:
brick:base,
brick:deepseq,
hashable,
hedgehog-fakedata:hedgehog,
rewrite-inspector:binary,
rewrite-inspector:containers,
vty:deepseq,
derive-storable-plugin:ghc,
derive-storable-plugin:ghci,
string-random:text,
string-random:containers,
string-interpolate:template-haskell,
string-interpolate:text,
hint:ghc
ordered-containers:containers,
boring:base,

-- Works around: https://github.com/recursion-schemes/recursion-schemes/issues/128. This
-- shouldn't harm (runtime) performance of Clash, as we only use recursion-schemes with
Expand All @@ -80,7 +71,3 @@ package recursion-schemes

package regex-tdfa
optimization: 2


-- rewrite-inspector-0.1.0.11 uses brick-0.50 which doesn't compile with vty-6.0
constraints: vty < 6.0
1 change: 1 addition & 0 deletions changelog/2026-05-15T07_25_33+02_00_add_ghc914
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ADDED: Added support for GHC 9.14
2 changes: 1 addition & 1 deletion clash-ffi/clash-ffi.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ common common-options
ghc-options:
-Wall -Wcompat
build-depends:
base >= 4.11 && < 4.22,
base >= 4.11 && < 4.23,
bytestring >= 0.10 && < 0.13,
clash-prelude >= 1.2 && < 1.12,
deepseq >= 1.4 && < 1.6,
Expand Down
4 changes: 0 additions & 4 deletions clash-ffi/example/cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ packages: . .. ../../clash-ghc ../../clash-lib ../../clash-prelude
write-ghc-environment-files: always

allow-newer:
hashable,
derive-storable-plugin:ghc,
derive-storable-plugin:ghci,
string-interpolate:template-haskell,
string-interpolate:text,
hint:ghc
4 changes: 2 additions & 2 deletions clash-ffi/example/clash-ffi-example.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ category: Hardware
custom-setup
setup-depends:
base >= 4.11 && < 5,
Cabal >= 2.4 && < 3.14,
Cabal >= 2.4 && < 3.17,
directory >= 1.3.6 && < 1.4,
filepath >= 1.4.2 && < 1.5,
filepath >= 1.4.2 && < 1.6,

foreign-library clash-ffi-example
default-language: Haskell2010
Expand Down
23 changes: 15 additions & 8 deletions clash-ghc/clash-ghc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ executable clash
GHC-Options:
-- -T: Workaround for GHC #8754: if the GC stats aren't enabled because
-- the -- compiler couldn't use -Bsymbolic to link the default hooks, then
-- initialize them sensibly.
-- initialize them sensibly.
--
-- -I5: See GHC #3408: the default idle GC time of 0.3s is too short on
-- Windows where we receive console events once per second or so.
Expand Down Expand Up @@ -137,7 +137,9 @@ common common-options
library
import: common-options
HS-Source-Dirs: src-ghc, src-bin-common
if impl(ghc >= 9.12.0)
if impl(ghc >= 9.14.0)
HS-Source-Dirs: src-bin-9.14
elif impl(ghc >= 9.12.0)
HS-Source-Dirs: src-bin-9.12
elif impl(ghc >= 9.10.2)
HS-Source-Dirs: src-bin-9.10.2
Expand Down Expand Up @@ -179,17 +181,17 @@ library
ghc-typelits-knownnat,
ghc-typelits-natnormalise,
deepseq >= 1.3.0.2 && < 1.6,
time >= 1.4.0.1 && < 1.15,
ghc >= 9.6.0 && < 9.13,
ghc-bignum >= 1.0 && < 1.4,
ghc-boot >= 9.6.0 && < 9.13,
time >= 1.4.0.1 && < 1.17,
ghc >= 9.6.0 && < 9.15,
ghc-bignum >= 1.0 && < 1.5,
ghc-boot >= 9.6.0 && < 9.15,
ghc-prim >= 0.10 && < 0.14,
ghci >= 9.6.0 && < 9.13,
ghci >= 9.6.0 && < 9.15,
uniplate >= 1.6.12 && < 1.8,
reflection >= 2.1.2 && < 3.0,
primitive >= 0.5.0.1 && < 1.0,
string-interpolate ^>= 0.3,
template-haskell >= 2.8.0.0 && < 2.24,
template-haskell >= 2.8.0.0 && < 2.25,
utf8-string >= 1.0.0.0 && < 1.1.0.0,
vector >= 0.11 && < 1.0,
exceptions >= 0.10.4 && < 0.11,
Expand Down Expand Up @@ -238,3 +240,8 @@ library
Other-Modules: Clash.GHCi.UI.Exception
else
Other-Modules: Clash.GHCi.UI.Tags

if impl(ghc >= 9.14.0)
Other-Modules: Clash.GHCi.UI.Print
Clash.GHC.Driver.Session.Lint
Clash.GHC.Driver.Session.Mode
124 changes: 124 additions & 0 deletions clash-ghc/src-bin-9.14/Clash/GHC/Driver/Session/Lint.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NondecreasingIndentation #-}
{-# LANGUAGE TupleSections #-}
module Clash.GHC.Driver.Session.Lint (checkOptions) where

import GHC.Driver.Backend
import GHC.Driver.Phases
import GHC.Driver.Session
import GHC.Platform.Ways

import GHC.Utils.Misc
import GHC.Utils.Panic

import GHC.Data.Maybe

import System.IO
import Control.Monad
import qualified Data.Set as Set
import Prelude

import Clash.GHC.Driver.Session.Mode

-- -----------------------------------------------------------------------------
-- Option sanity checks

-- | Ensure sanity of options.
--
-- Throws 'UsageError' or 'CmdLineError' if not.
checkOptions :: PostLoadMode -> DynFlags -> [(String,Maybe Phase)] -> [String] -> [String] -> IO ()
-- Final sanity checking before kicking off a compilation (pipeline).
checkOptions mode dflags srcs objs units = do
-- Complain about any unknown flags
let unknown_opts = [ f | (f@('-':_), _) <- srcs ]
when (notNull unknown_opts) (unknownFlagsErr unknown_opts)

when (not (Set.null (rtsWays (ways dflags)))
&& isInterpretiveMode mode) $
hPutStrLn stderr ("Warning: -debug, -threaded and -ticky are ignored by GHCi")

-- -prof and --interactive are not a good combination
when ((fullWays (ways dflags) /= hostFullWays)
&& LinkInMemory == ghcLink dflags
&& not (gopt Opt_ExternalInterpreter dflags)) $
do throwGhcException (UsageError
"-fexternal-interpreter is required when using --interactive with a non-standard way (-prof, -static, or -dynamic).")
-- -ohi sanity check
if (isJust (outputHi dflags) &&
(isCompManagerMode mode || srcs `lengthExceeds` 1))
then throwGhcException (UsageError "-ohi can only be used when compiling a single source file")
else do

if (isJust (dynOutputHi dflags) &&
(isCompManagerMode mode || srcs `lengthExceeds` 1))
then throwGhcException (UsageError "-dynohi can only be used when compiling a single source file")
else do

-- -o sanity checking
if (srcs `lengthExceeds` 1 && isJust (outputFile dflags)
&& not (isLinkMode mode))
then throwGhcException (UsageError "can't apply -o to multiple source files")
else do

let not_linking = not (isLinkMode mode) || isNoLink (ghcLink dflags)

when (not_linking && not (null objs)) $
hPutStrLn stderr ("Warning: the following files would be used as linker inputs, but linking is not being done: " ++ unwords objs)

-- Check that there are some input files
-- (except in the interactive case)
if null srcs && (null objs || not_linking) && needsInputsMode mode && null units
then throwGhcException (UsageError "no input files" )
else do

case mode of
StopBefore StopC | not (backendGeneratesHc (backend dflags))
-> throwGhcException $ UsageError $
"the option -C is only available with an unregisterised GHC"
StopBefore StopAs | ghcLink dflags == NoLink
-> throwGhcException $ UsageError $
"the options -S and -fno-code are incompatible. Please omit -S"

_ -> return ()

-- Verify that output files point somewhere sensible.
verifyOutputFiles dflags

-- Compiler output options

-- Called to verify that the output files point somewhere valid.
--
-- The assumption is that the directory portion of these output
-- options will have to exist by the time 'verifyOutputFiles'
-- is invoked.
--
-- We create the directories for -odir, -hidir, -outputdir etc. ourselves if
-- they don't exist, so don't check for those here (#2278).
verifyOutputFiles :: DynFlags -> IO ()
verifyOutputFiles dflags = do
let ofile = outputFile dflags
when (isJust ofile) $ do
let fn = fromJust ofile
flg <- doesDirNameExist fn
when (not flg) (nonExistentDir "-o" fn)
let ohi = outputHi dflags
when (isJust ohi) $ do
let hi = fromJust ohi
flg <- doesDirNameExist hi
when (not flg) (nonExistentDir "-ohi" hi)
where
nonExistentDir flg dir =
throwGhcException (CmdLineError ("error: directory portion of " ++
show dir ++ " does not exist (used with " ++
show flg ++ " option.)"))

-- | Utility for reporting unknown flag error
unknownFlagsErr :: [String] -> a
unknownFlagsErr fs = throwGhcException $ UsageError $ concatMap oneError fs
where
oneError f =
"unrecognised flag: " ++ f ++ "\n" ++
(case flagSuggestions (nubSort allNonDeprecatedFlags) f of
[] -> ""
suggs -> "did you mean one of:\n" ++ unlines (map (" " ++) suggs))
Loading
Loading