-
Notifications
You must be signed in to change notification settings - Fork 63
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
Passing Cabal flags #423
Comments
Hi, thank you for the bug report! Currently, there is no released HLS version that allows this, iirc, since it would depend on the relatively new version I think you can specify flags in cradle:
cabal:
cabalProject: "cabal.hls.project" |
Yes, this was also something I've tried and setting the flag there also works
This looks very good and exactly like a solution to my problem. Unfortunately HLS -> GHCIDE does not support the hie-bios 0.13.0 where this was introduced, yet 😬 I guess this solution also has to wait for the next HLS, then? |
Yes, or build the PR from source and give it a spin. Compiling from source is easy with ghcup :) Otherwise, I am afraid wait for the release that incorporates hie-bios 0.13.0, I can imagine there will be a release with that version this year, but I can't promise. |
Thank you very much! I'm on a Nix setup as my project has some crazy Python, Fortran and C deps and I wasn't successful yet with building the HLS form the PR there. 😬 I will report back when the HLS with hie-bios 0.13.0 becomes available, but I'm very optimistic that it solves this problem :) |
Alright, HLS 2.6 and the hie-bios 0.13.1 made it to nixkgs (at least in the haskell-updates branch). I'm using a hie.yaml file that contains cradle:
cabal:
cabalProject: "nix-cabal.project" and starting the HLS it also gets this option passed:
But apparently the option doesn't work as expected. Indeed
Am I doing something wrong here? 🙂 |
Hm, looks like
on my cabal HEAD binary. what's the output without the |
I can not reproduce: $ cabal-3.10.2.1 exec --project-file /home/hugin/Documents/haskell/eventlog2html/cabal.project -- ghc --print-libdir
Resolving dependencies...
/home/hugin/.ghcup/ghc/9.4.8/lib/ghc-9.4.8/lib
$ cabal-3.10.1.0 exec --project-file /home/hugin/Documents/haskell/eventlog2html/cabal.project -- ghc --print-libdir
Resolving dependencies...
/home/hugin/.ghcup/ghc/9.4.8/lib/ghc-9.4.8/lib
$ cabal-3.6.2.0 exec --project-file /home/hugin/Documents/haskell/eventlog2html/cabal.project -- ghc --print-libdir
Resolving dependencies...
/home/hugin/.ghcup/ghc/9.4.8/lib/ghc-9.4.8/lib |
This cabal issue may be relevant: haskell/cabal#7695 PR that explains the warning above: haskell/cabal#8454 |
Hm, but it's not me who is generating this option. It directly comes from hie-bios/HLS, doesn't it? Even if I change my hie.yaml to cradle:
cabal:
cabalProject: ./nix-cabal.project and be explicit about being a relative path EDIT: the otuput without
|
Ah nevermind. The problem is something different. I have a monorepo with many subprojects. The |
Yeah, the behaviour of |
Indeed 😄 But easy to work around if one's aware. However, the |
Closing it for now, thanks for verifying it works (roughly) as advertised! |
I'm currently trying to deal with the problems described in haskell/haskell-language-server#365 where TemplateHaskell code with C dependencies breaks the HLS for a module. The suggested workaround (and it is not a nice one) is to use CPP magic to eliminate the problem causing code for HLS and switch it out by a stub. I'm doing so via
cpp-options
in cabal, which are themselves triggered by a cabal flag.Basically I want
cabal -fdevelop
for HLS andcabal -f-develop
for everything else. Is it somehow possible using the hie-bios to pass such flags to HLS?The text was updated successfully, but these errors were encountered: