Skip to content

stuck initializing in atom on mac osx #416

Closed
@eflister

Description

@eflister

Subject of the issue

a little blinking orange light along the bottom of atom says "hie initializing" indefinitely. i don't see any ide features.

Your environment

atom 1.51.0
stack 2.3.3
osx 10.15.6

  • stack is on my path, set for lts-16.13 (ghc-8.8.4)

  • i manually installed a system ghc 8.8.4 from https://www.haskell.org/ghcup/ to hide an older one on the path. can you use the local one in the stack project instead of the system one? i'm worried that the path to this correct ghc is only added by .bashrc, which atom may not see, if only bash shells load that... how do i check/fix?

[1] https://github.com/haskell/haskell-language-server/releases/download/0.4.0/haskell-language-server-macOS-8.8.4.gz
[2] https://github.com/haskell/haskell-language-server/releases/download/0.4.0/haskell-language-server-wrapper-macOS.gz

  • unzipped [1] + [2] to ~/.local/bin (which is on my path) and chmod to 755. in the finder, the wrapper icon changed to an exe, but the other one remained a generic document, if that is a clue?

  • had to remove macOS from the exe cuz manually running the wrapper shows it wasn't expecting the macOS part

  • osx security tries to block both exe's, have to go either to Security & Privacy preferences or Control-click the app icon, then choose Open from the shortcut menu. then the app is saved as an exception to your security settings

  • install instructions should include the chmod and renaming and security instructions (or wrapper should try including the macOS part)

[3] https://atom.io/packages/atom-ide-ui
[4] https://atom.io/packages/ide-haskell-hie
[5] https://atom.io/packages/language-haskell

  • added [3] [4] [5] to atom, set absolute path to exe ~/.local/bin/haskell-language-server-wrapper-macOS, hie wrapper and debugging output are checked

[6] https://github.com/Avi-D-coder/implicit-hie

  • in a project dir i had previously set up with stack new, stack setup, used [6]: gen-hie > hie.yaml
  • Output of haskell-language-server --probe-tools
$ haskell-language-server-8.8.4 --probe-tools
haskell-language-server version: 0.4.0.0 (GHC: 8.8.4) (PATH: /Users/eflister/.local/bin/haskell-language-server-8.8.4) (GIT hash: 0a18edde24923251a148cbbc0ae993a6aac83b9c)
Tool versions found on the $PATH
cabal:		3.2.0.0
stack:		2.3.3
ghc:		8.8.4

or haskell-language-server-wrapper --probe-tools

$ haskell-language-server-wrapper-macOS --probe-tools
haskell-language-server version: 0.4.0.0 (GHC: 8.10.1) (PATH: /Users/eflister/.local/bin/haskell-language-server-wrapper-macOS) (GIT hash: 0a18edde24923251a148cbbc0ae993a6aac83b9c)
Tool versions found on the $PATH
cabal:		3.2.0.0
stack:		2.3.3
ghc:		8.8.4

-why does this one mention ghc 8.10.1? i don't have it...

  • Which lsp-client do you use
    atom

  • Describe your project (alternative: link to the project)

    • Include stack.yaml
resolver: lts-16.13
packages:
- .
  • Include package.yaml
    standard from stack new, stack setup, added some dependencies

  • Include *.cabal files
    standard from stack new, stack setup

  • Include cabal.project
    none

  • Contents of hie.yaml
    used gen-hie > hie.yaml

cradle:
  stack:
    - path: "./src"
      component: "covid:lib"

    - path: "./app/Main.hs"
      component: "covid:exe:covid-exe"

    - path: "./app/Paths_covid.hs"
      component: "covid:exe:covid-exe"

    - path: "./test"
      component: "covid:test:covid-test"

Include debug information

Execute in the root of your project the command haskell-language-server --debug . and paste the logs here:

is it supposed to be called that? the download unzips to haskell-language-server-macOS-8.8.4, which i renamed to haskell-language-server-8.8.4 because haskell-language-server-wrapper-macOS doesn't expect the macOS part.

Debug output:
$ haskell-language-server-wrapper-macOS 
Found "/Users/eflister/covid/covid/hie.yaml" for "/Users/eflister/covid/covid/a"
Module "/Users/eflister/covid/covid/a" is loaded by Cradle: Cradle {cradleRootDir = "/Users/eflister/covid/covid", cradleOptsProg = CradleAction: Stack}
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper-macOS) Version 0.4.0.0, Git revision 0a18edde24923251a148cbbc0ae993a6aac83b9c (dirty) x86_64 ghc-8.10.1
Current directory: /Users/eflister/covid/covid
Operating system: darwin
Arguments: []
Cradle directory: /Users/eflister/covid/covid
Cradle type: Stack

Tool versions found on the $PATH
cabal:		3.2.0.0
stack:		2.3.3
ghc:		8.8.4


Consulting the cradle to get project GHC version...
Project GHC version: 8.8.4
haskell-language-server exe candidates: ["haskell-language-server-8.8.4","haskell-language-server-8.8","haskell-language-server"]
Launching haskell-language-server exe at:/Users/eflister/.local/bin/haskell-language-server-8.8.4
haskell-language-server version: 0.4.0.0 (GHC: 8.8.4) (PATH: /Users/eflister/.local/bin/haskell-language-server-8.8.4) (GIT hash: 0a18edde24923251a148cbbc0ae993a6aac83b9c)
(haskell-language-server)Ghcide setup tester in /Users/eflister/covid/covid.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Tool versions found on the $PATH
cabal:		3.2.0.0
stack:		2.3.3
ghc:		8.8.4


Step 1/4: Finding files to test in /Users/eflister/covid/covid
Found 69 files

Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle

Step 3/4: Initializing the IDE

Step 4/4: Type checking the files
[INFO] Consulting the cradle for "/Users/eflister/covid/covid/pdf-toolbox-content/test/Test/FontDescriptor.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/Users/eflister/covid/covid", cradleOptsProg = CradleAction: Stack}
File:     /Users/eflister/covid/covid/pdf-toolbox-content/test/Test/FontDescriptor.hs
Hidden:   no
Range:    1:0-2:0
Source:   cradle
Severity: DsError
Message: 
  Multi Cradle: No prefixes matched
  pwd: /Users/eflister/covid/covid
  filepath: /Users/eflister/covid/covid/pdf-toolbox-content/test/Test/FontDescriptor.hs
  prefixes:
  ("./src",Stack {component = Just "covid:lib"})
  ("./app/Main.hs",Stack {component = Just "covid:exe:covid-exe"})
  ("./app/Paths_covid.hs",Stack {component = Just "covid:exe:covid-exe"})
  ("./test",Stack {component = Just "covid:test:covid-test"})

...same error repeats many times

Completed (3 files worked, 66 files failed)
haskell-language-server-wrapper-macOS: callProcess: /Users/eflister/.local/bin/haskell-language-server-8.8.4 (exit 66): failed

the failing files are all from this project's local copy of https://github.com/Yuras/pdf-toolbox. the project works fine with stack.

Paste the logs from the lsp-client, e.g. for VS Code

is this supposed to be /tmp/hie.log? cuz i only have /tmp/hie-wrapper.log. no idea why it is mentioning ghc 8.4...
i don't see anything when filtering for hie in atom's console except one warning:

Haskell (hie) rpc.onClose The RPC connection closed unexpectedly
/Users/eflister/.atom/packages/ide-haskell-hie/node_modules/atom-languageclient/build/lib/logger.js @9
LSP logs:
$ cat /tmp/hie-wrapper.log 
Launching HIE for project located at /Users/eflister/covid/covid
  Using stack GHC and HIE
  The Glorious Glasgow Haskell Compilation System, version 8.8.4
  Project is using GHC 8.4.*
... same block repeated several times

Metadata

Metadata

Assignees

No one assigned

    Labels

    build tool: stackos: macosstatus: blockedNot actionable, because blocked by upstream/GHC etc.type: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions