-
-
Notifications
You must be signed in to change notification settings - Fork 389
stack cradle fails to load private lib #114
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
Comments
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 |
Can confirm cabal-helper is able to load this. |
This only matters for the DAML codebase (so I’ll add a test on that side) where we use relative paths: Previously, we would produce the include dir "." for moduleImportPath "./A.daml" and "" for moduleImportPath "./A/B.daml". This resulted in us ending up with ./A.daml and A.daml in the Shake graph which resulted in issues like digital-asset/daml#2929. We should move this logic completely over to the DAML repo at some point but I’ll leave that for a separate PR.
It's an upstream issue, so you'll have to ask the stack maintainers. |
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 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 🤷 |
The text was updated successfully, but these errors were encountered: