-
Notifications
You must be signed in to change notification settings - Fork 206
Conversation
Stack should provide its own cabal, so I don't think the system cabal is relevant here. This worked for me despite the check failing.
Cabal is regarded a runtime dependency of hie and that has nothing to do with the functionality of stack. I can try to reproduce the issue when installing hie without having a cabal binary. Until then, this pr should not me merged. |
If so, it seems like it makes more sense to perform that check at runtime, since the installed version of cabal could change after installing hie, and since you shouldn't need it to compile hie with stack. The problem that I ran into that this fixed for me was that hie reported my system's cabal version, 2.4.0.0, as insufficient when I tried to compile it. |
Mmm, some context: that was added in #1344 to close #1327, if i am not wrong. Before that, installing hie triggered installing globally the cabal version it needed, overwriting the old one. In #1327 we discussed that maybe we could make hie use a private version of cabal, even downloading it at runtime when needed. But i am afraid that we can't simply remove it without some additional work. @ollef have you considered upgrade your default cabal to |
Cheers for providing context. Is cabal necessary for using hie with stack projects? It seems to be working here without the correct version. Again, I think runtime dependencies, especially when optional, are better checked at runtime. I could upgrade, yeah. |
The hie runtime is very tricky. I work on getting the correct checks that hie is able to perform a self test. However, I had little success so far. As far as I know, cabal is indeed reqired, even for stack based projects. |
Well, i've tested to open a stack based project removing cabal entirely from path and hie seems to work (open the project without errors), emitting a warning about not finding the cabal executable. @ollef have you tested that main features continue working with your cabal version? I guess that being a minor version mismatch ( Maybe we could add a flag to avoid/force the cabal installation ( |
Ah, interesting, so there's something looking for cabal even in stack based projects. I didn't notice any warnings about my specific version of cabal, however. As far as I can tell hie works with my cabal version, but I've only tested some of the basics. A warning at compile-time on encountering the wrong version seems like a sensible approach to me. |
I have no idea why |
I've tried stack without cabal in path a little bit more and hie seems to behave identically for stack based projects.
I guess that some features will be not present. So i am for mimic the runtime behavior in the build and keep the warn in the build if cabal is not present or the version is not adequate. At least there would be a flag to avoid the install. |
If others have no objection to this, I'm fine with dropping the check and merge this PR. |
Stack should provide its own cabal, so I don't think the system cabal is
relevant here. This worked for me despite the check failing.