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

Implicit HIE handles Cabal descriptions poorly? #2012

Closed
Ptival opened this issue Jul 12, 2021 · 6 comments · Fixed by #2020
Closed

Implicit HIE handles Cabal descriptions poorly? #2012

Ptival opened this issue Jul 12, 2021 · 6 comments · Fixed by #2020
Labels
component: implicit-hie status: blocked Not actionable, because blocked by upstream/GHC etc. type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Milestone

Comments

@Ptival
Copy link

Ptival commented Jul 12, 2021

So, we have a cabal file with a field:

Description:
  <... many lines of text ending with the following lines: ...>
  blah blah blah blah blah blah blah blah blah blah and generate
  benchmark results.

When loading this in VSCode without a hie.yaml, it seems like the implicit HIE generator is a little too zealous, and considers that last line as part of the configuration. We get the following message:

[client] run command: "haskell-language-server --lsp -l /tmp/hls.log"
[client] debug command: "haskell-language-server --lsp -l /tmp/hls.log"
[client] server cwd: undefined
haskell-language-server version: 1.2.0.0 (GHC: 8.10.4) (PATH: /nix/store/984mvf5yqwp0b8s78f7316wbg8hmdfq6-haskell-language-server-exe-haskell-language-server-1.2.0.0/bin/haskell-language-server)
Starting (haskell-language-server)LSP server...
  with arguments: GhcideArguments {argsCommand = LSP, argsCwd = Nothing, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = False, argsLogFile = Just "/tmp/hls.log", argsThreads = 0, argsProjectGhcVersion = False}
  with plugins: [PluginId "pragmas",PluginId "floskell",PluginId "fourmolu",PluginId "tactics",PluginId "ormolu",PluginId "stylish-haskell",PluginId "retrie",PluginId "brittany",PluginId "class",PluginId "haddockComments",PluginId "eval",PluginId "importLens",PluginId "refineImports",PluginId "moduleName",PluginId "hlint",PluginId "splice",PluginId "ghcide-hover-and-symbols",PluginId "ghcide-code-actions-imports-exports",PluginId "ghcide-code-actions-type-signatures",PluginId "ghcide-code-actions-bindings",PluginId "ghcide-code-actions-fill-holes",PluginId "ghcide-completions",PluginId "ghcide-type-lenses",PluginId "ghcide-core"]
  in directory: /Users/val/galois/crucible
 Starting LSP server...
If you are seeing this in a terminal, you probably should have run WITHOUT the --lsp option!
Started LSP server in 0.00s
setInitialDynFlags cradle: Cradle {cradleRootDir = "/Users/val/galois/crucible", cradleOptsProg = CradleAction: Cabal}
Output from setting up the cradle Cradle {cradleRootDir = "/Users/val/galois/crucible", cradleOptsProg = CradleAction: Cabal}
> cabal: Unknown target 'crux-llvm:bench:results.'.
> The package crux-llvm has no benchmark component 'results.'

And indeed, the package has no such benchmark components, since this was just an English sentence! 😄

@Ptival
Copy link
Author

Ptival commented Jul 12, 2021

Hmm, is this something I should have posted in hie-bios?

@jneira jneira added component: implicit-hie type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Jul 12, 2021
@jneira
Copy link
Member

jneira commented Jul 12, 2021

@Ptival thanks for the bug report. In this case the component responsible is implicit-hie (which, as you suspected, uses hie-bios uderneath).
The library uses a simple parser for the .cabal file and it fails for some corner (?) cases. So we should open an issue in the library. It creates automatically a implicit hie-bios configuration so we dont have to write a hie-yaml for, hopefully, most cases.

@Ptival
Copy link
Author

Ptival commented Jul 12, 2021

So we should open an issue in the library.

To be clear, "the library" is hie-bios? :)

@jneira
Copy link
Member

jneira commented Jul 13, 2021

@Ptival oh sorry, i forgot to add the link to the library: https://github.com/Avi-D-coder/implicit-hie/issues/new

@jneira jneira added the status: blocked Not actionable, because blocked by upstream/GHC etc. label Jul 13, 2021
@jneira
Copy link
Member

jneira commented Jul 13, 2021

@Ptival thanks for fixing this upstream, only left add the lower bound in the .cabal file and update the hackage index in the cabal.project to include the new version for cabal, and update stack.yaml's for stack

@jneira
Copy link
Member

jneira commented Jul 14, 2021

Avi-D-coder/implicit-hie-cradle#9 to propague the minor bound over implicit-hie

@mergify mergify bot closed this as completed in #2020 Jul 15, 2021
@jneira jneira added this to the 1.3.0 milestone Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: implicit-hie status: blocked Not actionable, because blocked by upstream/GHC etc. type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants