-
Notifications
You must be signed in to change notification settings - Fork 697
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
cabal build
works, but cabal repl
has an error.
#7696
Comments
Thank you for the report. Is it the same with with |
I am not sure I understand what you want me to do. I can build the package and then run
|
I'm willing to bet the custom flags set in ghci.conf cause the code to compile differently. |
Just in case i've tried to reproduce it with cabal-3.4.0.0 and 3.6.0.0 and i was not able to do it. No ghc env files nor ghci.conf one in my side. |
Yes, if I remove Here is the file.
Should I always do |
Afaiu |
|
Thanks for the confirmation and the proposals
But your favourite set of language extensions are the ones in the ghci.conf and those made the load fail for that package, no?
Those ones will drive to unexpected behaviour and break actual workflows for users relying in Possible solution:
|
At your service!
Yes, but I only need my favourite language extensions to be present in
So, what I am saying is that ideally only one place should be a source of truth as regards language extensions. Then there could be no mistake.
Cabal already has unexpected behaviour and breaks actual workflows for users relying in
Sure, I can solve this problem for this specific case one way or another. I can figure out which language extension is causing this version of GHC to decline this version of |
@kindaro use |
@phadej Thank you Oleg for your thoughtful advice. Unfortunately, my workflows rely on there being
— This relies on the extension Aside from that, I should note that your response carries the air of talking down to me and dismissing my problem. You can greatly increase my willingness to report issues I might have with Cabal in the future by acknowledging the problem and framing your advice as an advice and not as a dismissive order. |
Then, I'm afraid, you cannot have your cake and eat it too. Settings set with The only thing |
It breaks its promises adding its language extensions to ghci.conf ones? or in other ways?
Those are compatible but it will break lot of things out there so it should be guarded by a flag or something What about set
That is an interesting argument, I guess it should apply to everything in which config.ghci and cabal could collide |
If Cabal promises that its commands will work across installations (including modules being both compiled and interpreted) then its commands should work (and fail) uniformly across installations. For example, if Nick can load some modules in the read-evaluate-print loop, then Ignat should be able to do it too, given that they run from within the two clones of the same package and with the same version of GHC. So, if Cabal promises that, then Cabal should take care of the possibility that
But Cabal has the means to tell GHC to load arbitrary scripts. For example, it can ask GHC to load a script that resets all language extensions to their default state. Even if there was no special flag for this case (and there is — |
How? AFAIK that is not possible. (Please link to GHC documentation. or give an explicit example). Note that Cabal invokes |
cabal already passes a script to ghci when invoking |
Here is an example where I reset (Recall that I have
Now it is only a matter of preparing the scripts.
Is there something to stop me from making it do that? I can even do it from the command line:
What is going on?Oleg, I get that you have a lot of experience hacking on Cabal. But I do not understand what you are trying to say. It is hard for me to believe that you find it hard to implement a solution to this issue. Surely it is easy for you.
What is making you so grim? |
That script is (AFAIK) executed after
This is not an issue which we should hack around in |
I try to say it should be "fixed" in GHC, to allow module loading before |
Agree with the analysis, i would try to not coupling even more cabal and ghc(i). How could we implement the solution without hardcoding ghci specific knowledge in cabal? Imo the |
Fortunately these "hacks" would naturally decouple&vanish when fake-package hack is removed. If Sometimes to make progress you need to take step back. However, reimplementing of package environment creation is not related to this issue: in project context there is no need to fake package, as there is a project where everything is happening. (I don't know how |
a side note: ghci will gain a multi-home-package functionality, but then See https://gitlab.haskell.org/ghc/ghc/-/issues/20889 it summarizes this problem well:
(and |
Somewhat related; #4572 |
No activity here and there's some related work in other tickets linked above. I propose closing. |
Describe the bug
I want to do something with QuickCheck. I cloned the current version from the repository. I see a strange problem:
cabal build
works, butcabal repl
has an error when compilingTest.QuickCheck.All
. This problem appears both with GHC 8.10.7 and 9.0.1.See details…
To Reproduce
Clone the repository of QuickCheck at the commit 7ff70fe. Run
cabal repl
.Expected behavior
I expect that all modules compile without error in the repl, since they compile without error when running
cabal build
.System information
The text was updated successfully, but these errors were encountered: