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

Configuration for multiple cabal packages #14

Closed
robrix opened this issue Aug 12, 2019 · 6 comments
Closed

Configuration for multiple cabal packages #14

robrix opened this issue Aug 12, 2019 · 6 comments

Comments

@robrix
Copy link

robrix commented Aug 12, 2019

We build https://github.com/github/semantic with cabal, and have two different cabal packages defined in the repo (semantic and semantic-core), with disjoint sets of source files for each.

Is there any way to tell hie-bios that I want to use cabal: {component: "lib:semantic"} in src, and cabal: {component: "lib:semantic-core"} in semantic-core/src? I’ve tried adding separate hie.yaml files in the root of the repo & the semantic-core dir, but it doesn’t seem to notice the latter, and so I only get results (using hie-core) shown for modules belonging to semantic. (On the other hand, if I add a hie.yaml containing cradle: {cabal: {component: "lib:semantic-core"}} to the root of the project, then I only get results shown for modules belonging to semantic-core.)

I assume that I could do this via a .hie-bios program & the appropriate bios cradle, but I’m not clear on how to generate the list of arguments it should return—I really do want cabal to generate them for me.

@mpickering
Copy link
Collaborator

Which branch of haskell-ide-engine are you using? You need to use my branch for anything to work so best to establish that first. I would think adding hie.yaml files in the right sub directories should work but I will try it myself.

@robrix
Copy link
Author

robrix commented Aug 12, 2019

Ah, I’m not presently using haskell-ide-engine, but rather hie-core.

@mpickering
Copy link
Collaborator

I don't think hie-core supports multiple components currently.

@cocreature
Copy link
Contributor

@mpickering is right. At the moment, one instance of hie-core works with one GHC session. So you either have to spawn multiple instances of hie-core, one per component (the details of how you do that probably depend on your editor) or you need to write a .hie-bios file that does something like calling cabal v2-repl on each component and then merges the flags.

@robrix
Copy link
Author

robrix commented Aug 12, 2019

Ahhh, I see! Thanks very kindly for the explanation 👍

@robrix robrix closed this as completed Aug 12, 2019
@mpickering
Copy link
Collaborator

mpickering commented Aug 13, 2019

I tried semantic on my fork of HIE and it ran into two problems.

  1. The RTS options in the cabal file are not ignored properly by HIE. It would be good to pass some
    similar options to HIE by default anyway.
  2. The multi-component loading doesn't work properly as the project root is assumed to be where the hie.yaml file is. In this case semantic-core still loads but the options in the cabal.project file are ignored.

After that, you get IDE feedback for both components. The main problem with this is still that
if you edit semantic-core then the changes aren't propagated to the semantic session, it's like having two cabal new-repl open at once.

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