Skip to content

1.6.1.0 cli execution doesn't work #2672

Closed

Description

@googleson78

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

Activity

  1. added
    type: bug
    on Feb 1, 2022
  2. fendor commented on Feb 1, 2022

    @fendor
    Collaborator

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

  3. googleson78 commented on Feb 1, 2022

    @googleson78
    ContributorAuthor

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

  4. added
    component: cli
    and removed on Feb 1, 2022
  5. jneira commented on Feb 1, 2022

    @jneira
    Member

    @googleson78 does it work for you in the editor?

  6. googleson78 commented on Feb 1, 2022

    @googleson78
    ContributorAuthor

    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?

  7. fendor commented on Feb 1, 2022

    @fendor
    Collaborator

    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.

  8. changed the title [-]1.6.1.0 Doesn't work on polysemy[/-] [+]1.6.1.0 cli execution doesn't work on polysemy[/+] on Feb 1, 2022
  9. solomon-b commented on Feb 10, 2022

    @solomon-b

    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
    
  10. dschrempf commented on Feb 15, 2022

    @dschrempf
    Collaborator

    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
    
  11. changed the title [-]1.6.1.0 cli execution doesn't work on polysemy[/-] [+]1.6.1.0 cli execution doesn't work[/+] on Feb 15, 2022
  12. googleson78 commented on Feb 15, 2022

    @googleson78
    ContributorAuthor

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

  13. kamek-pf commented on Feb 17, 2022

    @kamek-pf

    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.

  14. hasufell commented on Feb 18, 2022

    @hasufell
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: clitype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions