VSCode integration with Clash - Failed to parse result of calling cabal; also a build error on Clash Cabal package

Continuing to try to work through the Clash.Tutorial examples - my VSCode Haskell extension is failing with the following error:

Failed to parse result of calling cabal
Failed command: cabal --builddir=/home/bry/.cache/hie-bios/dist-clash-misc-d35e8c8fc4856f7cddec64eaaf9725cc v2-repl --with-compiler /home/bry/.cache/hie-bios/wrapper-b54f81dea4c0e6d1626911c526bc4e36 lib:clash-misc
Build profile: -w ghc-9.6.7 -O1
In order, the following will be built (use -v for more details):
 - clash-misc-0.1 (interactive) (lib) (first run)
Preprocessing library for clash-misc-0.1...
GHCi, version 9.6.7: https://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Test             ( src/Test.hs, interpreted )
Ok, one module loaded.
ghci> Leaving GHCi.



Process Environment:
HIE_BIOS_GHC: /home/bry/.ghcup/tmp/ghcup-ghc-9.6.7_cabal-3.16.0.0_hls-2.11.0.0_stack-3.7.1/ghc
HIE_BIOS_GHC_ARGS: -B/home/bry/.ghcup/ghc/9.6.7/lib/ghc-9.6.7/lib

Has anyone encountered this issue before? I get the same issue in both Stack and the Cabal example. My main motivation for switching from Verilog to Clash is better type annotation in the editor so if this doesn’t work it’s kind of a deal-breaker for me.

Additionally, I tried to manually install Clash via cabal install (I’m more comfortable with makefiles than integrated build managers anyway) but got the following error:

src/Clash/Unique.hs:73:17: error: [GHC-83865]
    • Couldn't match type ‘Word64’ with ‘Int’
      Expected: GHC.Unique -> Unique
        Actual: GHC.Unique -> Word64
    • In the expression: GHC.getKey
      In an equation for ‘fromGhcUnique’: fromGhcUnique = GHC.getKey
   |
73 | fromGhcUnique = GHC.getKey

Is this a known issue? I get the same when I try to build the example Cabal project.

A while ago I did see that same Failed to parse result of calling cabal in VSCode at a the machine of a colleague.

I don’t remember the specifics, but that error seems to means something like: “Something went, but I won’t tell you what. Let me just show these things that seems to indicate no problem what so ever”

Try executing that failed cabal command manually in a terminal, look at all it’s output.

Or just execute cabal build all manually, see if it works.

And then follow the errors you get, or if you can’t figure them out, post them here.

But probably a lot easier way is to start a project using the this starter project.
It sets up a number of things, so every should “just work”, including IDE integration.

As for the Unique Word64 issue with ghc-9.6.7, this know and fixed: Clash doesn't build on GHC 9.6.7 (but does on 9.6.6) ¡ Issue #2916 ¡ clash-lang/clash-compiler ¡ GitHub
The fix for it should be in clash-lib-1.8.3, which was uploaded to hackage on 2025-10-06. And it’s probably only a single cabal update away.

The failed cabal command executes without errors in a terminal, and its output is the same as the “output” tab in VSCode.

I’ve tried cloning the starter project and it has the same issue.

Try running haskell-language-server typecheck
Depending on how the haskell-language-server is installed, its actual executable might be called something like haskell-language-server-GHC_VERSION~HLS_VERSION.
Shell tab completion is your friend here.

I get the same thing - normal-looking results from cabal which HLS fails to parse.

If building with cabal on its own work correctly, then it doesn’t seem like a clash issue.
But some problem with HLS, maybe their troubleshooting page can help you.

Update for future adventurers - I did manage to figure this out. It turns out the version of HLS that ghcup ships as “latest” is not in fact the latest, and this bug ( "Failed to parse result of calling cabal" on HLS 2.10.0.0 & cabal-install 3.15.0.0 · Issue #4590 · haskell/haskell-language-server · GitHub ) has only been fixed in the absolute most recent version of HLS. Manually building the newest HLS version with ghcup compile fixed the issue.

Still no idea why I didn’t see the behavior on non-Clash projects, but it’s fixed now.

2 Likes