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 matches only exposed-modules to component #164

Closed
fendor opened this issue Mar 29, 2020 · 3 comments
Closed

Cabal cradle matches only exposed-modules to component #164

fendor opened this issue Mar 29, 2020 · 3 comments
Assignees
Labels

Comments

@fendor
Copy link
Collaborator

fendor commented Mar 29, 2020

Upstream issue haskell/cabal#6622

Explanation in hie-bios:

Assume project setup:

$ cabal init -p example --libandexe --tests --main-is=Main.hs --source-dir=src --application-dir=app --test-dir=test

and hie.yaml:

cradle:
  cabal:

then we can observe the following behaviour:

$ hie-bios flags src/MyLib.hs
Options: [...]
Dependencies: [...]

$ hie-bios flags app/Main.hs
Failed to show flags for "./app/Main.hs": ["Failed to parse result of calling cabal","","cabal.exe: Unknown target './app/Main.hs'.\nThe package example has no file target 'app/Main.hs'.\n\n\n",""]

However, the invocation hie-bios flags app/Main.hs should work just as well.

@fendor fendor self-assigned this Mar 29, 2020
@fendor fendor added the type: bug Something isn't working label Mar 29, 2020
@expipiplus1
Copy link
Contributor

Adding Main to other-modules seems to allow hie to work, however it's complained about by hie and probably breaks other tools

2020-04-02 14:08:32.123114596 [ThreadId 14] - Warning: Enabling workaround for Main module 'Main' listed in 'other-modules'
2020-04-02 14:08:32.12318556 [ThreadId 14] - illegally!

@expipiplus1
Copy link
Contributor

I have no idea why, but this configuration allows src/Main.hs to work

cradle:
  multi:
    - path: "./src"
      config:
        cradle:
          cabal:
    - path: "./src/Main.hs"
      config:
        cradle:
          none:

@fendor
Copy link
Collaborator Author

fendor commented Jul 20, 2021

Closing as upstream ticket is fixed.

@fendor fendor closed this as completed Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants