Open jneira opened 4 years ago
Does anyone know if cabal-helper works with this?
I think it does. IIRC, when the Cradle.hs was written in HIE, I made sure that certain real world test-cases succeed. Since cabal-helper doesnt use stack repl
for finding the component options, it has a higher probability of succeeding, imo.
However, this needs to be fixed in stack, eventually.
Can confirm cabal-helper is able to load this. Test repo
It's an upstream issue, so you'll have to ask the stack maintainers.
Can confirm cabal-helper is able to load this. Test repo
Any tip how exactly can it be bypassed with cabal helper?
In a previous life of HLS, cabal-helper was used to figure out project compilation options, alongside implicit-hie. Nowadays, we only use implicit-hie, and cabal-helper is no longer part of this project.
I think, it would be really difficult to use cabal-helper today. You'd need to port the code from haskell-ide-engine (https://github.com/haskell/haskell-ide-engine/blob/master/hie-plugin-api/Haskell/Ide/Engine/Cradle.hs) and port it to HLS (there have been a number of attempts, I think), or wrap cabal-helper as a bios cradle script and then try to make the correct invocations... In short, I don't think it is feasible to do either, unless you are ready to throw a lot of resources on it. And if that's the case, you'd rather should invest these resources into stack fixing the bug :)
I just tricked to work by manually typing the hie.yaml
where i did someting liek this:
cradle:
stack:
- path: ./src
component: "foo:lib"
- path: ./lib/bar
component: "foo:lib"
instead of
cradle:
stack:
- path: ./src
component: "foo:lib"
- path: ./lib/bar
component: "foo:lib:bar"
as it was probably was implicitly.
Not sure how big side effect it have, but it seems to be fine at this point for me :shrug: