Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Clash 1.8.1 #2

Open
prabhupraveen opened this issue Feb 9, 2024 · 2 comments
Open

Upgrade to Clash 1.8.1 #2

prabhupraveen opened this issue Feb 9, 2024 · 2 comments

Comments

@prabhupraveen
Copy link

Hi,

I have purchased the retroclash book and finding it very useful. Although I am a beginner and this book is meant for experienced users, In the absence of any other book/material for beginners, This book and examples there in are invaluable to me.

I have setup a clash project with 1.8.1 (resolver lts-22.9), and I am trying to run a few samples from the retroclash-book-code repo. However, I am unable to run examples from that repo.

When I add retroclash-lib to the build-depends section of my project cabal file, I get the following error while building:

In the dependencies for retroclash-lib-0.1.2.1:
    * clash-ghc must match >=1.4.2 && <1.5 || >=1.6.1 && <1.7, but clash-ghc-1.8.1 is in the Stack configuration (latest matching version is 1.6.6).
    * clash-lib must match >=1.4.2 && <1.5 || >=1.6.1 && <1.7, but clash-lib-1.8.1 is in the Stack configuration (latest matching version is 1.6.6).
    * clash-prelude must match >=1.4.2 && <1.5 || >=1.6.1 && <1.7, but clash-prelude-1.8.1 is in the Stack configuration (latest matching version is 1.6.6).
needed since retroclash-lib is a build target.

It would be helpful if this library and any other library used by the above repo could be upgraded to clash 1.8.1.

@gergoerdi
Copy link
Owner

I'm glad you're liking the book so far!

Annoyingly, because of commercialhaskell/stack#6251 , even though I've updated the code to compile with Clash 1.8.1, it is currently not usable with Stack with GHC 9.6. I'm leaving this ticket open until this situation resolves.

@prabhupraveen
Copy link
Author

prabhupraveen commented Feb 9, 2024

Ah that one... I spent one entire day on it, and as a work around, I had to add the following 3 lines in my .cabal file (for some reason, latest clash starter project seems to use .cabal). You could perhaps add these same lines in the package.yaml file under ghc-options: and it should work. (Assuming you are getting errors for the same 3 plugins)

    -package ghc-typelits-extra
    -package ghc-typelits-natnormalise
    -package ghc-typelits-knownnat

In addition, you might want to also have these plugins registered with ghc. I had do the following steps too (as I am using docker based environment)

First, find the package(s):

stack exec -- ghc-pkg find-module GHC.TypeLits.Extra.Solver

From the output, note the path where the packages are found, then register them:

ghc-pkg -v register <package path>/ghc-tcplugins-extra-0.4.5-LoPBimuwmAgCj5M5ykKFtm.conf
ghc-pkg -v register <package path>/ghc-typelits-natnormalise-0.7.9-2LocrQy3VVV7lBggmw970k.conf
ghc-pkg -v register <package path>/ghc-typelits-knownnat-0.7.10-fJlMrMNkyh9qGWAkYZ6O6.conf
ghc-pkg -v register <package path>/ghc-typelits-extra-0.4.6-L6c8cgcuJuRHcCyvlVGpAw.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants