Skip to content
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 cradle doesn't recognize foreign-library sections #341

Closed
cdsmith opened this issue Mar 24, 2022 · 6 comments
Closed

Cabal cradle doesn't recognize foreign-library sections #341

cdsmith opened this issue Mar 24, 2022 · 6 comments

Comments

@cdsmith
Copy link

cdsmith commented Mar 24, 2022

I was attempting to follow the tutorial at https://nokomprendo.gitlab.io/posts/tuto_075/2021-09-12-fr-README.html

HLS is flagging the Binding module with Multi Cradle: no prefixes matched. The module is listed in the other-modules section of a foreign-library section in the cabal file, as follows:

foreign-library fibohs
    type:               native-shared
    cc-options:         -std=c++17
    c-sources:          cbits/binding.cpp
    install-includes:   cbits/binding.hpp
    hs-source-dirs:     ffi
    build-depends:      ffi, base
    other-modules:      Binding
@fendor
Copy link
Collaborator

fendor commented Mar 24, 2022

Does it work if you have a hie.yaml with

cradle:
  cabal:

in the root of your project?

@cdsmith
Copy link
Author

cdsmith commented Mar 24, 2022

Yes, it does work in that case!

@fendor
Copy link
Collaborator

fendor commented Mar 25, 2022

Then that's a bug in https://github.com/Avi-D-coder/implicit-hie which is used by HLS when you don't have a hie.yaml

@hasufell
Copy link
Member

Then that's a bug in https://github.com/Avi-D-coder/implicit-hie which is used by HLS when you don't have a hie.yaml

I'm creating the above minimal cradle for every new project, because implicit-hie has never worked for me.

@fendor
Copy link
Collaborator

fendor commented Mar 25, 2022

Yeah, it is right in the most trivial cases, but unfortunately, not even in this repo it works for the tests.
This PR haskell/haskell-language-server#2342 defaults to the equivalent of cradle: {cabal: }, but it was never finished.

@cdsmith
Copy link
Author

cdsmith commented Mar 25, 2022

Filed Avi-D-coder/implicit-hie#44 over there. I'll close this now.

@cdsmith cdsmith closed this as completed Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants