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

1.6.1.0 cli execution doesn't work #2672

Closed
googleson78 opened this issue Feb 1, 2022 · 10 comments
Closed

1.6.1.0 cli execution doesn't work #2672

googleson78 opened this issue Feb 1, 2022 · 10 comments
Labels
component: cli About the pure command line interface of the hls executable type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@googleson78
Copy link
Contributor

Your environment

Which OS do you use:
Debian testing
Which LSP client (editor/plugin) do you use:
Raw invocation
Describe your project (alternative: link to the project):
https://github.com/polysemy-research/polysemy

HLS 1.6.1.0 from ghcup

> haskell-language-server-wrapper --version
haskell-language-server version: 1.6.1.0 (GHC: 8.10.7) (PATH: /home/googleson78/.ghcup/bin/haskell-language-server-wrapper-1.6.1.0) (GIT hash: f4022c5bb8530cd306c53b941878244bf27a5d41)

Steps to reproduce

Clone the project and run haskell-language-server-wrapper

Expected behaviour

Loads the project.

Actual behaviour

Fails with multiple instances of something like

  Maybe.fromJust: Nothing
  CallStack (from HasCallStack):
  error, called at libraries/base/Data/Maybe.hs:148:21 in base:Data.Maybe
  fromJust, called at src/Development/IDE/Core/Rules.hs:842:51 in
  ghcide-1.6.0.0-inplace:Development.IDE.Core.Rules

Include debug information

hls.log
hls-stderr.log

@googleson78 googleson78 added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Feb 1, 2022
@fendor
Copy link
Collaborator

fendor commented Feb 1, 2022

I can reproduce it on the cli as described, but in VSCode everything seems to be fine 0.o.

@googleson78
Copy link
Contributor Author

Has calling the cli perhaps gotten more complicated in some way? (some env needs to be provided etc)

@jneira jneira added component: cli About the pure command line interface of the hls executable type: setup and removed status: needs triage labels Feb 1, 2022
@jneira
Copy link
Member

jneira commented Feb 1, 2022

@googleson78 does it work for you in the editor?

@googleson78
Copy link
Contributor Author

googleson78 commented Feb 1, 2022

Yup, thanks. I didn't even try it in an editor when I saw the cli invocation doesn't work tbh.

I rely on the cli invocation to provide debug info and to also troubleshoot issues if something isn't working from inside my editor. What do I need to do to be able to use it?

@fendor
Copy link
Collaborator

fendor commented Feb 1, 2022

It should work, so there is at least one bug somewhere.

I can trigger the same error on the hie-bios code-base, but everything seems to load fine, so this is likely to be a bug in the cli loader.

@jneira jneira changed the title 1.6.1.0 Doesn't work on polysemy 1.6.1.0 cli execution doesn't work on polysemy Feb 1, 2022
@solomon-b
Copy link

FYI I also am hitting this bug and am not using polysemy:

Hidden:   no
Range:    1:1-2:1
Source:   compiler
Severity: DsError
Message: 
  Maybe.fromJust: Nothing
  CallStack (from HasCallStack):
  error, called at libraries/base/Data/Maybe.hs:148:21 in base:Data.Maybe
  fromJust, called at src/Development/IDE/Core/Rules.hs:842:51 in
  ghcide-1.6.0.0-7wqffKHWPjBDdiU2g7XF1:Development.IDE.Core.Rules
2022-02-10 13:05:16.955923575 [ThreadId 57] INFO hls:	finish: User TypeCheck (took 0.12s)
2022-02-10 13:05:16.956033454 [ThreadId 114] DEBUG hls:	LOOKUP UP PERSISTENT FOR: GetModSummaryWithoutTimestamps
2022-02-10 13:05:16.956072025 [ThreadId 114] DEBUG hls:	LOOKUP UP PERSISTENT FOR: False
2022-02-10 13:05:16.956123559 [ThreadId 111] INFO hls:	finish: GetHie (took 0.00s)
2022-02-10 13:05:16.956229608 [ThreadId 116] INFO hls:	finish: GenerateCore (took 0.00s)
Files that failed:
 * /home/solomon/Development/hasura/graphql-engine-mono/pro/server/src/HasuraPro/App.hs

Completed (0 files worked, 1 file failed)
haskell-language-server-wrapper: callProcess: /nix/store/sznd4vbnba0iyl08p3wqp9k4jj3db9li-haskell-language-server-1.6.1.0/bin/haskell-language-server-8.10.7 "pro/server/src/HasuraPro/App.hs" "--debug" (exit 1): failed

@dschrempf
Copy link

I am also getting this error message independent of polysemy.

2022-02-15 10:58:09.561056426 [ThreadId 463] INFO hls:	File:     /home/dominik/Shared/haskell/circular/src/Data/Stack/Circular.hs
Hidden:   no
Range:    1:1-2:1
Source:   compiler
Severity: DsError
Message:
  Maybe.fromJust: Nothing
  CallStack (from HasCallStack):
  error, called at libraries/base/Data/Maybe.hs:148:21 in base:Data.Maybe
  fromJust, called at src/Development/IDE/Core/Rules.hs:842:51 in
  ghcide-1.6.0.0-7wqffKHWPjBDdiU2g7XF1:Development.IDE.Core.Rules

@googleson78 googleson78 changed the title 1.6.1.0 cli execution doesn't work on polysemy 1.6.1.0 cli execution doesn't work Feb 15, 2022
@googleson78
Copy link
Contributor Author

I amended the title to represent the fact that this seems independent of polysemy.

@kamek-pf
Copy link

kamek-pf commented Feb 17, 2022

Same here, no Polysemy either, although in my case I can no longer get it to work with any editor.

Edit:
Looks like my problem was caused by the static binaries downloaded by GHCUP (as explained here).
So I uninstalled HLS and ran ghcup compile hls -v 1.6.1.0 --ghc 8.10.7 to compile from source.
Now HLS works again from my text editor, the issues reported by OP remain, but at least it works.

@hasufell
Copy link
Member

hasufell commented Feb 18, 2022

This bug happens only if you don't run in lsp mode.

The reason is here:

displayItOnce <- liftIO $ once $ LSP.runLspT (fromJust env) displayTHWarning

lspEnv/env is Nothing for non-lsp initializations:


Fix is here: #2719

You can build and fix locally via ghcup:

ghcup compile hls -v 1.6.1.0 -j10 --ghc 8.10.7 \
    --cabal-project-local https://gist.githubusercontent.com/hasufell/8409effe97d33c36369e4d9906556c1e/raw/0751ccd38339113017f9733ff72a165f288e126d/gistfile1.txt \
    --patch https://patch-diff.githubusercontent.com/raw/haskell/haskell-language-server/pull/2719.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: cli About the pure command line interface of the hls executable type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

7 participants