-
Notifications
You must be signed in to change notification settings - Fork 841
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
-fplugin
could not find module when using GHC 9.6
#6251
Comments
@knightzmc, thanks for reporting. With GHC 9.4.7, with Cabal 3.8.1.0 (works):
GHC 9.6.2, with Cabal 3.10.1.0 (fails):
It looks to me that Stack is giving identical commands to Cabal (the tool) and it, in turn, is giving the same command to different versions of GHC. The next step is to turn on GHC's verbosity ... |
Ahh sorry, I totally forgot the verbose log! The logs of both can be found here, https://gist.github.com/knightzmc/77e219e582242362b2d7d1370b529d28 |
With GHC's verbosity turned on, I see in the GHC error message:
That does not exist in |
Looking earlier in Stack's verbose output: GHC 9.4.7 (extracts only):
GHC 9.6.2 (extracts only):
Stack seems to be configuring Cabal (the tool) in an identical way - save for the change in the versions of |
Thinking out loud: why is GHC 9.6.2 looking for (and, of course, failing to find) EDIT: I am stumped. GHC 9.4.7:
GHC 9.6.2:
|
I pinned some of the dependencies to rule that out as the cause: resolver: nightly-2023-09-22 # alternatively lts-21.12
extra-deps:
- Cabal-3.8.1.0
- Cabal-syntax-3.8.1.0
- polysemy-1.9.1.2
- polysemy-plugin-0.4.5.1 |
It is the same issue as haskell/cabal#9375, it was fixed two weeks ago in haskell/cabal#9384. There was an old workaround for an issue with ghc-cabal (which is now gone). The workaround was to not pass -package-db to GHC when calling --abi-hash. It used to be unnecessary but with GHC 9.6 the plugin initialisation happens earlier than before, and this means we do need to pass -package-db. |
So if this has been fixed in Cabal, what can I, as a user of Stack, do to apply that Cabal fix? |
@gergoerdi as a work-around you can:
Very ugly, but it works. |
@christiaanb Thank you! But it did not work for me, before I sink a lot of time (you probably have already spend), do you happen to have a public project here this worked for you so I can check whatever I have done differently? I checked your clash repos but did not see this specific solution (or I'm bad in searching which may very well be the case!). |
@mbj we have a variant of the fix at this PR: clash-lang/clash-compiler#2665 And it’s passing CI with GHC 9.6.4: https://github.com/clash-lang/clash-compiler/actions/runs/7886581662/job/21520111671?pr=2665 |
@christiaanb ty, I cannot yet spot the difference to what I tried, but will keep digging! |
This would seem to say the fix is in Cabal. @mpilgrem Are there dragons lurking in updating the dependency to 3.10.2.1? This is the blocker for getting to 9.6 right now. Would be happy to give that update a shot, unless there is some reason to hold off. |
@telser, (EDIT: Unless a custom EDIT: I've not looked into the full history of that design choice (to use only GHC's Cabal boot library) but some of it is here: #4070. The reason given was 'You shouldn't generally do this [change the boot library version of Cabal], since new Cabal versions may introduce incompatibilities with package sets'. |
@mpilgrem I see. If I'm understanding correctly then it really is EDIT: That is to say the situation is certainly frustrating for users. I haven't been able to find an issue for this on the ghc side, so I'll raise one there. The optics for this are frustrating because for users they can easily get the impression the issue is with the plugin(s) they use or stack or stack's integration with |
For anyone watching this, there is a ghc issue: https://gitlab.haskell.org/ghc/ghc/-/issues/24518 |
For anyone watching this: The cabal version with the fix has a release now. |
ghcup 0.1.22.0 latest,recommended ghc 9.6.4 base-4.18.2.0 hls-powered cabal 3.10.2.1 latest,recommended stack 2.13.1 recommended - How to start ```bash git clone https://github.com/tonosaman/haskell-dev-env cd haskell-dev-env stack new --resolver lts-22.13 clash-project clash-lang/simple ``` - [BUG]`stack build` is failed "`-fplugin` could not find module when using GHC 9.6 #6251" commercialhaskell/stack#6251 Use cabal for build project `cabal run clash -- Example.Project --systemverilog`
GHC 9.10.0.20240328 comes with Cabal-3.11.0.0 >= 3.10.3.0, but |
I've worked around this by just disabling the plugin (effectful-plugin in my case) for now. I had to add exactly one type annotation to get my code base to compile, so not a big deal. YMMV of course. |
Unfortunately, now that I've tried this, it still fails with the same Could not find module ‘GHC.TypeLits.KnownNat.Solver’ error message. |
Unless... maybe this needs to be applied to all Clash-using dependencies as well, not just the main program? @christiaanb I'll try that out. |
I could also get @knightzmc's minimal example to work with GHC 9.6.4 by:
|
@telser can you expand on that? I don't see any mention of |
My, current, understanding is that
|
I could get @knightzmc's minimal example to work with GHC 9.6.5, with:
snapshot: lts-22.17 # GHC 9.6.4
compiler: ghc-9.6.5 # Comes with Cabal-3.10.3.0
# Temporary, until GHC 9.6.5 is added to Stack's default setup-info dictionary:
setup-info:
ghc:
windows64:
9.6.5:
url: https://downloads.haskell.org/ghc/9.6.5/ghc-9.6.5-x86_64-unknown-mingw32.tar.xz |
When trying to build a project using polysemy-plugin with GHC 9.6, the build fails with a strange error.
As far as I can tell this is a Stack issue, with the build command not including the
package-db
andpackage
flags. GHC 9.4.7 works as intendedSteps to reproduce
stack build
resolver
tolts-21.12
Expected
Expected to build without errors or warnings.
Actual
The final stage of building throws an error
Stack version
Method of installation
Platform
MacOS Sonoma aarch64, also reproducible on Ubuntu 22.04.2 LTS x86_64
The text was updated successfully, but these errors were encountered: