Skip to content

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

Open
jneira opened this issue May 17, 2020 · 7 comments
Open

stack cradle fails to load private lib #114

jneira opened this issue May 17, 2020 · 7 comments
Labels
build tool: stack component: hie-bios status: blocked Not actionable, because blocked by upstream/GHC etc. type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@jneira jneira added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. component: hie-bios labels May 17, 2020
@Avi-D-coder
Copy link
Collaborator

Does anyone know if cabal-helper works with this?

@fendor
Copy link
Collaborator

fendor commented May 17, 2020

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.

@Avi-D-coder
Copy link
Collaborator

Avi-D-coder commented May 17, 2020

Can confirm cabal-helper is able to load this.
Test repo

jneira added a commit that referenced this issue May 27, 2020
Convert private lib in common stanza:
* To workaround the issues involving the stack based cradle: #114 and #121
* Build info of the previous private lib has not been changed, in the hope we will restore it
@jneira jneira added build tool: stack status: blocked Not actionable, because blocked by upstream/GHC etc. labels Nov 9, 2020
pepeiborra pushed a commit that referenced this issue Dec 27, 2020
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.
@jneira jneira changed the title Explicit stack cradle fails to load private lib stack cradle fails to load private lib Oct 16, 2021
@michaelpj
Copy link
Collaborator

It's an upstream issue, so you'll have to ask the stack maintainers.

@majkrzak
Copy link

majkrzak commented Mar 1, 2023

Can confirm cabal-helper is able to load this. Test repo

Any tip how exactly can it be bypassed with cabal helper?

@fendor
Copy link
Collaborator

fendor commented Mar 1, 2023

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 :)

@majkrzak
Copy link

majkrzak commented Mar 1, 2023

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 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build tool: stack component: hie-bios status: blocked Not actionable, because blocked by upstream/GHC etc. type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

5 participants