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

Intero fails to load and gives no error message #156

Open
mgajda opened this issue Aug 5, 2018 · 11 comments
Open

Intero fails to load and gives no error message #156

mgajda opened this issue Aug 5, 2018 · 11 comments

Comments

@mgajda
Copy link

mgajda commented Aug 5, 2018

Intero fails to start due to being taken from ~/.local/bin/intero or due to having multiple executables in the package, but it gives no error message. Any attempt to use intero command gives message 'Intero is still compilingor worseIntero is still starting`.
Can we have user variable that keeps intero compilation/startup log, and shows when 'still compiling' happens?

Current commit is 02289201c9b8316169fe5d54cf9c95fe6e563e7e.
NeoVim version is:

NVIM v0.3.2-dev
Build type: RelWithDebInfo
Lua 5.1
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-cHq2Qe/neovim-0.3.0~ubuntu1+git201807292033-a225374-479a1d0=. -fstack-protector-strong -Wformat -Werror=format-security -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-cHq2Qe/neovim-0.3.0~ubuntu1+git201807292033-a225374-479a1d0/build/config -I/build/neovim-cHq2Qe/neovim-0.3.0~ubuntu1+git201807292033-a225374-479a1d0/src -I/build/neovim-cHq2Qe/neovim-0.3.0~ubuntu1+git201807292033-a225374-479a1d0/.deps/usr/include -I/usr/include -I/build/neovim-cHq2Qe/neovim-0.3.0~ubuntu1+git201807292033-a225374-479a1d0/build/src/nvim/auto -I/build/neovim-cHq2Qe/neovim-0.3.0~ubuntu1+git201807292033-a225374-479a1d0/build/include
Compiled by buildd@lgw01-amd64-036

Features: +acl +iconv +jemalloc +tui 
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
@ain2108
Copy link

ain2108 commented Jul 18, 2019

I am getting the same error! @mgajda Were you able to get intero to work with Neovim? I am very new to Haskell and its toolchain, so I am not sure how to prevent intero from "being taken from ~/.local/bin/intero". The way your post is worded makes me think that there is a way to get it to work. Thanks!

@jmcclell
Copy link

I have the similar issues.

If I simply stack build intero and thus don't have intero on my PATH, I am stuck with the following error:

  Note: No local targets specified, so a plain ghci will be started with no package hiding or package options.

        You are using snapshot: lts-13.27

        If you want to use package hiding and options, then you can try one of the following:

        * If you want to start a different project configuration
          than /Users/xxx/.stack/global-project/stack.yaml, then you can use stack init to create a new stack.yaml for the
          packages in the current directory.

        * If you want to use the project configuration
          at /Users/xxx/.stack/global-project/stack.yaml, then you can add to its 'packages' field.

  Configuring GHCi with the following packages:
  Executable named intero not found on path: ["/Users/xxx/.stack/global-project/.stack-work/install/x86_64-osx/c86de29a567b768096
  170638cc1215cdb26d83e7d03090cd41c6b73f1f843c35/8.6.5/bin","/Users/xxx/.stack/snapshots/x86_64-osx/c86de29a567b768096170638cc121
  5cdb26d83e7d03090cd41c6b73f1f843c35/8.6.5/bin","/Users/xxx/.stack/compiler-tools/x86_64-osx/ghc-8.6.5/bin","/Users/xxx/.stack
  /programs/x86_64-osx/ghc-8.6.5/bin","/Users/xxx/.local/bin","/Users/xxx/go/bin","/usr/local/sbin","/Users/xxx/.local/bin","
  /Users/xxx/go/bin","/usr/local/sbin","/Users/xxx/.cargo/bin","/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin","/Library
  /TeX/texbin","/usr/local/MacGPG2/bin","/Users/xxx/go/bin","/usr/local/sbin","/Users/xxx/.cargo/bin"]

  [Process exited 1]

If I stack install intero which puts it in my PATH, I get

Intero is installed in your PATH, which may cause problems when using different resolvers.
This usually happens if you run `stack install intero` instead of `stack build intero`.
Aborting.
Intero is still compiling
Press ENTER or type command to continue

the first time I try to open it. Any subsequent :InteroOpen commands during the same vim session garner a simple Intero is still compiling compiling and nothing more.

So, should intero be installed via stack? If so, should it or should it not be on the PATH?

@johnmendonca
Copy link

@jmcclell I have the same issue and was looking for clues here. I don't have a solution but I am pretty sure you are not supposed to install intero or have it existing anywhere on your normal path. What I remember is that when you run this plugin for the first time in a project, it will compile intero specifically for the project.

In the error it can't find intero on the path, but the first items on the path listed in the error are inside the .stack-work folder of your project. So, this issue comes from perhaps intero not compiling properly or the executable not getting placed in .stack-work properly.

Personally, I wasn't going to dig into it too much more. I want to try using this plugin using plain ghci as the backend instead of intero, and failing that probably move to a plain ghci/ghcid workflow (which the author of this plugin and others recommend for simplicity).

@ain2108
Copy link

ain2108 commented Jul 23, 2019

If you guys are on macOS, the Haskell compiler config is busted, resulting in an incorrect install. Using stack version 1.9 fixed the problem for me, and this plugin started working out of the box.

More details here:
commercialhaskell/stack#4926
@jmcclell
@johnmendonca

@jmcclell
Copy link

Ah! Thank you @ain2108! I'm still pretty new to the whole ecosystem so when things break I'm a bit left out to dry. Really appreciate the tip.

@Quintasan
Copy link

I'm not running macOS but I get the same thing as @jmcclell in #156 (comment)

I tried removing ~/.stack and .stack-work but none of them helped.

@mgajda
Copy link
Author

mgajda commented Aug 2, 2019

This time I managed to first run stack and find the issue.
But it is not always this simple without error message.

@Quintasan
Copy link

So I removed everything Stack-related, removed .local/bin/intero and opened my Haskell file.

build.log

and my Intero buffer

Using main module: 1. Package `haskell' component haskell:exe:haskell-exe with main-is file: /home/quintasan/sauce/haskell/app/Main.hs
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
Configuring GHCi with the following packages: haskell
Executable named intero not found on path: ["/home/quintasan/sauce/haskell/.stack-work/install/x86_64-linux/c07acc1c86584cf66f3eb21aa3c3c3b37bc6d71f19197fd5187b9b38307375
d6/8.6.5/bin","/home/quintasan/.stack/snapshots/x86_64-linux/c07acc1c86584cf66f3eb21aa3c3c3b37bc6d71f19197fd5187b9b38307375d6/8.6.5/bin","/home/quintasan/.stack/compiler-
tools/x86_64-linux/ghc-8.6.5/bin","/home/quintasan/.stack/programs/x86_64-linux/ghc-8.6.5/bin","/home/quintasan/.rbenv/shims","/home/quintasan/.asdf/shims","/home/quintas
an/.asdf/shims","/home/quintasan/.asdf/bin","/home/quintasan/.fzf/bin","/home/quintasan/.rbenv/bin","/home/quintasan/.local/bin","/home/quintasan/bin","/usr/local/sbin","
/usr/local/bin","/usr/sbin","/usr/bin","/sbin","/bin","/usr/games","/usr/local/games"]

[Process exited 1]

I have no clue why this doesn't work. It looks for Intero in my .stack-work where it doesn't exist and then looks in ~/.stack/snapshots where it exists but under a different path

╭─quintasan@tyria ~/.stack ‹2.6.3› 
╰─$ find . -type f | grep intero
./snapshots/x86_64-linux/5dc1e27c649062bc6151c505f41e139b34aa3b665d3e934a0880187f85230cac/8.6.5/bin/intero

@mgajda
Copy link
Author

mgajda commented Aug 15, 2019

@Quintasan Looks like you do not have intero on your path. Need to install it?
(Message about incompatible options is a warning, and can be safely ignored.)

@Quintasan
Copy link

@mgajda See what I have written about, it's installed but to a different directory (I did not install it manually, I just opened up my Haskell file in vim) and neovim is looking in a different directory. I do not modify my PATH.

@ryandv
Copy link

ryandv commented Oct 19, 2019

Experienced the same thing.

What worked on my end: stack build intero --copy-compiler-tool from the stack project root.

stack build intero leads to "intero not found on path" errors (as noted above).
stack install intero leads to "intero is installed in your PATH, which may cause problems..." errors (also noted above).

It seems that the --copy-compiler-tool flag allows intero-neovim to stack exec -- intero while having intero live off the PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants