atom-haskell / ide-haskell

Haskell IDE plugin for Atom editor

Home Page:https://atom.io/packages/ide-haskell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ghc-mod crashed - not finding a dependency

andrewufrank opened this issue · comments

[Enter steps to reproduce below:]

  1. compile (save) a change in a subpackage
  2. error pops up (repeatedly, anoying at the point to make work impossible)

the project builds (with compile error) outside of atom. - i ran stack solver before, ok. thus: the dependency is installed.

i see that i have in .stack-work both
.stack-work/install/x86_64-linux-nopie
and
.stack-work/install/x86_64-linux

i fear one is produce by stack build, the other by ghc-mod build?

Atom Version: 1.13.1
Electron Version: 1.3.13
System: Debian GNU/Linux
Thrown From: haskell-ghc-mod package, v1.19.7

Stack Trace

Haskell-ghc-mod: ghc-mod interactive command type failed with error ghc-modi crashed

At caps: {"version":[5,7,0,0],"fileMap":true,"quoteArgs":true,"optparse":true,"typeConstraints":true,"browseParents":true,"interactiveCaseSplit":true,"importedFrom":false}
URI: /home/frank/Workspace8/repo8/litNLP/LitNLP/Defs0.hs
Args: -c,--,52,43
message: 
log:
-1.161s: "Trying to run ghc-modi in /home/frank/Workspace8/repo8/litNLP"
-1.161s: "Checking for ghc-modi in /home/frank/Workspace8/repo8/litNLP"
-1.16s: "Spawning new ghc-modi instance for /home/frank/Workspace8/repo8/litNLP with",{"cwd":"/home/frank/Workspace8/repo8/litNLP","env":{"ATOM_HOME":"/home/frank/.atom","NODE_PATH":"/usr/share/atom/resources/app.asar/exports","NODE_ENV":"production","LS_COLORS":"","XDG_MENU_PREFIX":"xfce-","LANG":"en_US.utf8","DISPLAY":":0.0","XDG_VTNR":"7","SSH_AUTH_SOCK":"/tmp/ssh-mns3zaLrh7Xc/agent.1508","CLASSPATH":"pikes-tintop-1.0-SNAPSHOT-jar-with-dependencies.jar:Semafor-3.0-alpha-04.jar:models/stanford-corenlp-3.5.2-models.jar","GLADE_CATALOG_PATH":":","XDG_SESSION_ID":"2","XDG_GREETER_DATA_DIR":"/var/lib/lightdm/data/frank","USER":"frank","GLADE_MODULE_PATH":":","DESKTOP_SESSION":"lightdm-xsession","PWD":"/home/frank","HOME":"/home/frank","SSH_AGENT_PID":"1549","QT_ACCESSIBILITY":"1","XDG_SESSION_TYPE":"x11","XDG_DATA_DIRS":"/usr/share/xfce4:/usr/local/share/:/usr/share/:/usr/share","XDG_SESSION_DESKTOP":"lightdm-xsession","GLADE_PIXMAP_PATH":":","DESKTOP_STARTUP_ID":"wrapper-1.0/|usr|share|atom|atom/1613-3-santafe_TIME13189838","GTK_MODULES":"gail:atk-bridge","SHELL":"/bin/bash","XDG_SEAT_PATH":"/org/freedesktop/DisplayManager/Seat0","XDG_CURRENT_DESKTOP":"XFCE","QT_LINUX_ACCESSIBILITY_ALWAYS_ON":"1","SHLVL":"1","XDG_SEAT":"seat0","LANGUAGE":"en_US:en","GDMSESSION":"lightdm-xsession","LOGNAME":"frank","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1010/bus","XDG_RUNTIME_DIR":"/run/user/1010","XAUTHORITY":"/home/frank/.Xauthority","XDG_SESSION_PATH":"/org/freedesktop/DisplayManager/Session0","XDG_CONFIG_DIRS":"/etc/xdg","GOOGLE_API_KEY":"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q","PATH":"/home/frank/.stack/global-project/.stack-work/install/x86_64-linux-nopie/lts-7.18/8.0.1/bin:/home/frank/.stack/snapshots/x86_64-linux-nopie/lts-7.18/8.0.1/bin:/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.1/bin:/home/frank/.local/bin:/home/frank/.local/bin/:/home/frank/ghc-mod-sandbox/bin/:/home/frank/.cabal/bin:/home/frank/Debinstall83/deb9/amd9.bin:/home/frank/.bin:/home/frank/.bin/corenlp:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games","SESSION_MANAGER":"local/santafe:@/tmp/.ICE-unix/1559,unix/santafe:/tmp/.ICE-unix/1559","_":"/usr/bin/env"},"encoding":"utf-8","maxBuffer":null}
-1.16s: "Spawning new ghc-modi instance for /home/frank/Workspace8/repo8/litNLP with options = ",{"cwd":"/home/frank/Workspace8/repo8/litNLP","env":{"ATOM_HOME":"/home/frank/.atom","NODE_PATH":"/usr/share/atom/resources/app.asar/exports","NODE_ENV":"production","LS_COLORS":"","XDG_MENU_PREFIX":"xfce-","LANG":"en_US.utf8","DISPLAY":":0.0","XDG_VTNR":"7","SSH_AUTH_SOCK":"/tmp/ssh-mns3zaLrh7Xc/agent.1508","CLASSPATH":"pikes-tintop-1.0-SNAPSHOT-jar-with-dependencies.jar:Semafor-3.0-alpha-04.jar:models/stanford-corenlp-3.5.2-models.jar","GLADE_CATALOG_PATH":":","XDG_SESSION_ID":"2","XDG_GREETER_DATA_DIR":"/var/lib/lightdm/data/frank","USER":"frank","GLADE_MODULE_PATH":":","DESKTOP_SESSION":"lightdm-xsession","PWD":"/home/frank","HOME":"/home/frank","SSH_AGENT_PID":"1549","QT_ACCESSIBILITY":"1","XDG_SESSION_TYPE":"x11","XDG_DATA_DIRS":"/usr/share/xfce4:/usr/local/share/:/usr/share/:/usr/share","XDG_SESSION_DESKTOP":"lightdm-xsession","GLADE_PIXMAP_PATH":":","DESKTOP_STARTUP_ID":"wrapper-1.0/|usr|share|atom|atom/1613-3-santafe_TIME13189838","GTK_MODULES":"gail:atk-bridge","SHELL":"/bin/bash","XDG_SEAT_PATH":"/org/freedesktop/DisplayManager/Seat0","XDG_CURRENT_DESKTOP":"XFCE","QT_LINUX_ACCESSIBILITY_ALWAYS_ON":"1","SHLVL":"1","XDG_SEAT":"seat0","LANGUAGE":"en_US:en","GDMSESSION":"lightdm-xsession","LOGNAME":"frank","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1010/bus","XDG_RUNTIME_DIR":"/run/user/1010","XAUTHORITY":"/home/frank/.Xauthority","XDG_SESSION_PATH":"/org/freedesktop/DisplayManager/Session0","XDG_CONFIG_DIRS":"/etc/xdg","GOOGLE_API_KEY":"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q","PATH":"/home/frank/.stack/global-project/.stack-work/install/x86_64-linux-nopie/lts-7.18/8.0.1/bin:/home/frank/.stack/snapshots/x86_64-linux-nopie/lts-7.18/8.0.1/bin:/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.1/bin:/home/frank/.local/bin:/home/frank/.local/bin/:/home/frank/ghc-mod-sandbox/bin/:/home/frank/.cabal/bin:/home/frank/Debinstall83/deb9/amd9.bin:/home/frank/.bin:/home/frank/.bin/corenlp:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games","SESSION_MANAGER":"local/santafe:@/tmp/.ICE-unix/1559,unix/santafe:/tmp/.ICE-unix/1559","_":"/usr/bin/env"},"encoding":"utf-8","maxBuffer":null}
-1.144s: "Started interactive action block in /home/frank/Workspace8/repo8/litNLP"
-1.143s: "Running ghc-modi command type","/home/frank/Workspace8/repo8/litNLP/LitNLP/Defs0.hs","-c","--",52,43
-0.434s: "ghc-modi said: Warning: solver failed to find a solution:"
-0.434s: "ghc-modi said: Could not resolve dependencies:"
-0.434s: "ghc-modi said: trying: litNLP-0.0.4 (user goal)"
-0.433s: "ghc-modi said: next goal: split (dependency of litNLP-0.0.4)"
-0.433s: "ghc-modi said: Dependency tree exhaustively searched."
-0.433s: "ghc-modi said: Trying configure anyway."
-0.019s: "ghc-modi said: cabal: Encountered missing dependencies:"
-0.019s: "ghc-modi said: chatter -any, littext -any, split -any"
-0.004s: "ghc-modi said: ghc-mod: readCreateProcess: cabal \"configure\" \"--with-ghc=ghc\" \"--flags\" \"\" (exit 1): failed"
0s: "ghc-modi for /home/frank/Workspace8/repo8/litNLP ended with 1"
0s: "ghc-modi for /home/frank/Workspace8/repo8/litNLP ended with 1"
0s: "Running ghc-modi command unmap-file","/home/frank/Workspace8/repo8/litNLP/LitNLP/Defs0.hs"
0s: {"name":"ghc-modi crashed"}

ghc-modi crashed
    at mkError (/home/frank/.atom/packages/haskell-ghc-mod/lib/util.coffee:228:15)
    at ChildProcess.exitCallback (/home/frank/.atom/packages/haskell-ghc-mod/lib/ghc-mod/interactive-process.coffee:78:20)
    at emitTwo (events.js:111:20)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

Commands

     -9:55.7.0 ide-haskell:close-tooltip (input.hidden-input)
     -9:55.7.0 autocomplete-haskell:conceal-hint-panel (input.hidden-input)
     -9:55.7.0 editor:consolidate-selections (input.hidden-input)
     -9:55.7.0 core:cancel (input.hidden-input)
     -9:08.4.0 editor:consolidate-selections (input.hidden-input)
     -9:08.4.0 core:cancel (input.hidden-input)
     -8:55.4.0 ide-haskell-cabal:build (ide-haskell-panel-items.native-key-bindings)
  4x -8:30 core:backspace (input.hidden-input)
     -1:54 core:cancel (a.btn-copy-report.icon.icon-clippy)
     -1:48.7.0 settings-view:open (atom-workspace.workspace.scrollbars-visible-always.theme-atom-light-syntax.theme-atom-light-ui.ide-haskell)
     -0:34.6.0 ide-haskell-cabal:build (input.hidden-input)

Config

{
  "core": {
    "automaticallyUpdate": false,
    "closeEmptyWindows": false,
    "destroyEmptyPanes": false,
    "packagesWithKeymapsDisabled": [],
    "projectHome": "ssh://ascona/stFolder/AF/ServerOnly/repo8.git",
    "telemetryConsent": "no",
    "themes": [
      "atom-light-ui",
      "atom-light-syntax"
    ]
  },
  "haskell-ghc-mod": {
    "additionalPathDirectories": [
      "/home/frank/.local/bin"
    ],
    "ghcModPath": "/home/frank/.local/bin/ghc-mod",
    "onSaveLint": false
  }
}

Installed Packages

# User
autocomplete-haskell, v0.7.2 (active)
busy, v0.7.0 (active)
git-plus, v7.3.3 (active)
haskell-ghc-mod, v1.19.7 (active)
ide-haskell, v1.9.4 (active)
ide-haskell-cabal, v1.8.1 (active)
language-haskell, v1.12.1 (active)
atom-dark-syntax, v0.28.0 (inactive)
atom-dark-ui, v0.53.0 (inactive)
atom-light-syntax, v0.29.0 (active)
atom-light-ui, v0.46.0 (active)
base16-tomorrow-dark-theme, v1.4.0 (inactive)
base16-tomorrow-light-theme, v1.4.0 (inactive)
one-dark-ui, v1.8.2 (inactive)
one-light-ui, v1.8.2 (inactive)
one-dark-syntax, v1.6.0 (inactive)
one-light-syntax, v1.6.0 (inactive)
solarized-dark-syntax, v1.1.1 (inactive)
solarized-light-syntax, v1.1.1 (inactive)
about, v1.7.2 (active)
archive-view, v0.62.0 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.14.1 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.33.1 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.29.0 (inactive)
autosave, v0.23.2 (active)
background-tips, v0.26.1 (active)
bookmarks, v0.43.2 (active)
bracket-matcher, v0.85.1 (active)
command-palette, v0.39.1 (inactive)
deprecation-cop, v0.55.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.40.0 (active)
find-and-replace, v0.204.5 (active)
fuzzy-finder, v1.4.0 (active)
git-diff, v1.2.0 (active)
go-to-line, v0.31.2 (inactive)
grammar-selector, v0.48.2 (active)
image-view, v0.60.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.1 (active)
link, v0.31.2 (inactive)
markdown-preview, v0.159.3 (active)
metrics, v1.1.3 (active)
notifications, v0.65.1 (active)
open-on-github, v1.2.1 (inactive)
package-generator, v1.0.2 (inactive)
settings-view, v0.244.0 (active)
snippets, v1.0.4 (active)
spell-check, v0.68.5 (active)
status-bar, v1.6.0 (active)
styleguide, v0.48.0 (active)
symbols-view, v0.113.1 (inactive)
tabs, v0.103.1 (active)
timecop, v0.33.2 (active)
tree-view, v0.211.1 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.35.1 (active)
whitespace, v0.35.0 (active)
wrap-guide, v0.39.0 (active)
language-c, v0.54.0 (active)
language-clojure, v0.22.1 (active)
language-coffee-script, v0.48.1 (active)
language-csharp, v0.13.0 (active)
language-css, v0.40.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.43.0 (active)
language-html, v0.47.1 (active)
language-hyperlink, v0.16.1 (active)
language-java, v0.24.0 (active)
language-javascript, v0.122.0 (active)
language-json, v0.18.3 (active)
language-less, v0.29.6 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.37.0 (active)
language-php, v0.37.3 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.1 (active)
language-ruby, v0.70.2 (active)
language-ruby-on-rails, v0.25.1 (active)
language-sass, v0.57.0 (active)
language-shellscript, v0.23.0 (active)
language-source, v0.9.0 (active)
language-sql, v0.25.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.29.1 (active)
language-toml, v0.18.1 (active)
language-xml, v0.34.12 (active)
language-yaml, v0.27.1 (active)

# Dev
No dev packages

I feel like at this point, you'd be better off running stack build --only-configure --file-watch in superproject and then run Atom with env STACK_EXE=/bin/true (so that ghc-mod doesn't try to touch stack configuration)...

thank you for the hint. can i then still run build in atom or should i do it in the subproject folder in a terminal (what i am currently doing).
i downloaded your example project and will study it. i also saw, that you use lts 8.2 and i saw that i had again some issue with ghc-mod compiled with 8.0.1 while i use 8.0.2 -- too many things which can go wrong.

Building in Atom shouldn't be a problem, build package (i.e. ide-haskell-cabal) doesn't honor STACK_EXE (which could be considered an oversight, but it's usually fine), and stack itself resets it. Although I think you might occasionally run into SQLite database locked problem (which happens on some stack versions during parallel operations) -- it'll just cause build to fail immediately, and rebuilding should work, so it's a minor annoyance. Bear in mind this is untested, so I might be wrong on some accounts. I shouldn't be off the mark completely though.

slightly off topic, but wouldn't it be possible to avoid issues related to ghc by using intero with ide-haskell? I tried intero with haskero on vscode and for a project that young, the performance of type lookup was incredible compared to what i get with ghc-mode in ide-haskell.

@xavier83, intero is just GHCI basically. Possible? Yes. Is it as feature-complete as ghc-mod? Not by a long shot. One particular thing to note is ∀-types aren't handled by either intero or ghci properly. Please avoid hijacking issues in the future though. It's easy enough to create a new one with a reference.