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

Operate on cabal project files not called cabal.project #49

Open
lf- opened this issue Oct 13, 2022 · 2 comments
Open

Operate on cabal project files not called cabal.project #49

lf- opened this issue Oct 13, 2022 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@lf-
Copy link

lf- commented Oct 13, 2022

Cabal has a flag --project, but it seems that there's not any way of using that with implicit-hie.

The practical use case of --project is when you may have a nix vs non-nix dependency setup, for instance.

@fendor
Copy link
Collaborator

fendor commented Oct 14, 2022

You might be interested in the feature haskell/hie-bios#357

With that feature, it'd be enough to have a hie.yaml:

cradle:
  cabal:
    project-file: cabal.project.8.8.4

and stuff like that.
Leave a comment if you think that feature would help you.

@lf-
Copy link
Author

lf- commented Oct 14, 2022

It wouldn't, surprisingly. Long story, marred by my own cursed workflows on top of a codebase that needs to be weird to be usable.

The reason is that there's overlapping cabal targets in the work project due to test-dev (https://jade.fyi/blog/cabal-test-dev-trick/). This is used to paper over multiple home units' absence on a codebase that is extremely marginal HLS perf wise (Well-Typed has worked on it specifically in the past) by sticking test and lib into one cabal target. So I need to delete some of those rules and thus a manual hie.yaml is necessary.

The thing I use gen-hie for is when I'm doing hacks (see "yolo method" of https://jade.fyi/blog/nix-hls-for-deps/) to work on dependencies in-situ, replacing the nix versions, and don't want to write the hie.yaml rules for the stuff I just added by hand. So I run it and copy the appropriate prefix rules for the dependency I just stuck into nix-shell.cabal.project.local

N.B. the reason there are two cabal project files is that the not nix-shell one has source-repository-package to make git deps build on non nix systems.

@Avi-D-coder Avi-D-coder added enhancement New feature or request good first issue Good for newcomers labels Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants