atom-haskell-archive / haskell-ghc-mod

haskell-ghc-mod atom package
https://atom.io/packages/haskell-ghc-mod
MIT License
69 stars 20 forks source link

ghc-mode crash when trying to force rebuilding a package #203

Open andrewufrank opened 7 years ago

andrewufrank commented 7 years ago

I have a multi-package project structured as recommended. it works usually, but a change in a subproject resulted in another subproject in a persistent error message (var not defined in Defs0.hs). the error message was clearly wrong, buidling the package as a whole worked. i then removed the stack-works folder of the subproject litNLP. the next build produced the crash.

i hope this ultimately helps to improve ghc-mod and its integration in atom! thank you for your efforts!

Atom: 1.14.3 x64 Electron: 1.3.13 OS: Debian GNU/Linux Thrown From: haskell-ghc-mod package 1.19.7

Stack Trace

Haskell-ghc-mod: ghc-mod command check failed with error Error

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: --
message: Command failed: /home/frank/.local/bin/ghc-mod check /home/frank/Workspace8/repo8/litNLP/LitNLP/Defs0.hs --
uniform-fileio-0.0.9: configure (lib)
uniform-fileio-0.0.9: build (lib)
uniform-fileio-0.0.9: copy/register
rdf4hextension-0.0.8: build (lib)
rdf4hextension-0.0.8: copy/register
rdf4store-0.1.5: configure (lib)
rdf4store-0.1.5: build (lib)
rdf4store-0.1.5: copy/register
littext-0.1.5: build (lib + exe)
Completed 4 action(s).

--  While building package littext-0.1.5 using:
      /home/frank/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 build lib:littext exe:lit2nt --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/frank/Workspace8/repo8/.stack-work/logs/littext-0.1.5.log

    ghc-pkg: cannot create: .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/package.conf.inplace already exists
ghc-mod: readCreateProcess: stack "build" "--only-dependencies" "." (exit 1): failed

log:
-27.404s: "Trying to run ghc-modi in /home/frank/Workspace8/repo8/litNLP"
-27.404s: "Checking for ghc-modi in /home/frank/Workspace8/repo8/litNLP"
-27.404s: "Found running ghc-modi instance for /home/frank/Workspace8/repo8/litNLP"
-27.403s: "Started interactive action block in /home/frank/Workspace8/repo8/litNLP"
-27.403s: "Running ghc-modi command type","/home/frank/Workspace8/repo8/litNLP/LitNLP/Defs0.hs","-c","--",75,37
-26.928s: "ghc-modi said: litNLP-0.0.4: unregistering (missing dependencies: littext, rdf4hextension, uniform-convenience, uniform-error, uniform-fileio, uniform-strings)"
-26.908s: "ghc-modi said: littext-0.1.5: unregistering (missing dependencies: rdf4hextension, rdf4store, uniform-convenience, uniform-error, uniform-fileio, uniform-strings)"
-26.89s: "ghc-modi said: rdf4hextension-0.0.8: unregistering (missing dependencies: uniform-error, uniform-fileio, uniform-strings)"
-26.871s: "ghc-modi said: rdf4store-0.1.5: unregistering (missing dependencies: rdf4hextension, uniform-error, uniform-fileio, uniform-strings, uniform-time)"
-26.853s: "ghc-modi said: uniform-convenience-0.0.8: unregistering (missing dependencies: uniform-error, uniform-strings)"
-26.834s: "ghc-modi said: uniform-error-0.0.8: unregistering (missing dependencies: uniform-strings)"
-26.817s: "ghc-modi said: uniform-fileio-0.0.9: unregistering (missing dependencies: uniform-error, uniform-strings)"
-26.8s: "ghc-modi said: uniform-strings-0.0.9: unregistering (local file changes: Uniform/StringUtilities.hs Uniform/Strings.hs)"
-26.783s: "ghc-modi said: uniform-time-0.0.8: unregistering (missing dependencies: uniform-error, uniform-strings)"
-26.766s: "ghc-modi said: uniform-strings-0.0.9: configure (lib)"
-26.168s: "ghc-modi said: uniform-strings-0.0.9: build (lib)"
-19.804s: "ghc-modi said: uniform-strings-0.0.9: copy/register"
-19.558s: "ghc-modi said: uniform-error-0.0.8: build (lib)"
-17.909s: "ghc-modi said: uniform-error-0.0.8: copy/register"
-17.703s: "ghc-modi said: uniform-convenience-0.0.8: configure (lib)"
-17.702s: "ghc-modi said: uniform-fileio-0.0.9: build (lib)"
-17.701s: "ghc-modi said: uniform-time-0.0.8: build (lib)"
-17.07s: "ghc-modi said: uniform-convenience-0.0.8: build (lib)"
-16.27s: "ghc-modi said: uniform-time-0.0.8: copy/register"
-16.029s: "ghc-modi said: uniform-convenience-0.0.8: copy/register"
-14.038s: "Running /home/frank/.local/bin/ghc-mod check,/home/frank/Workspace8/repo8/litNLP/LitNLP/Defs0.hs,-- with opts = ",{"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-qfT0DCWyLCQm/agent.1631","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":"4","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":"1672","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/1736-0-santafe_TIME5170043","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/Workspace8/repo8/.stack-work/install/x86_64-linux-nopie/lts-8.2/8.0.2/bin:/home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.2/8.0.2/bin:/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/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/1682,unix/santafe:/tmp/.ICE-unix/1682","_":"/usr/bin/env"},"encoding":"utf-8","maxBuffer":null}
-14.019s: "Running /home/frank/.local/bin/ghc-mod check,/home/frank/Workspace8/repo8/litNLP/LitNLP/Defs0.hs,-- with opts = ",{"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-qfT0DCWyLCQm/agent.1631","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":"4","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":"1672","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/1736-0-santafe_TIME5170043","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/Workspace8/repo8/.stack-work/install/x86_64-linux-nopie/lts-8.2/8.0.2/bin:/home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.2/8.0.2/bin:/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/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/1682,unix/santafe:/tmp/.ICE-unix/1682","_":"/usr/bin/env"},"encoding":"utf-8","maxBuffer":null}
-11.975s: "ghc-modi said: uniform-fileio-0.0.9: copy/register"
-11.624s: "ghc-modi said: rdf4hextension-0.0.8: build (lib)"
-6.571s: "ghc-modi said: rdf4hextension-0.0.8: copy/register"
-6.289s: "ghc-modi said: rdf4store-0.1.5: configure (lib)"
-5.605s: "ghc-modi said: rdf4store-0.1.5: build (lib)"
-0.6s: "ghc-modi said: rdf4store-0.1.5: copy/register"
-0.166s: "ghc-modi said: littext-0.1.5: build (lib + exe)"
-0.029s: "uniform-fileio-0.0.9: configure (lib)\nuniform-fileio-0.0.9: build (lib)\nuniform-fileio-0.0.9: copy/register\nrdf4hextension-0.0.8: build (lib)\nrdf4hextension-0.0.8: copy/register\nrdf4store-0.1.5: configure (lib)\nrdf4store-0.1.5: build (lib)\nrdf4store-0.1.5: copy/register\nlittext-0.1.5: build (lib + exe)\nCompleted 4 action(s).\n\n--  While building package littext-0.1.5 using:\n      /home/frank/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 build lib:littext exe:lit2nt --ghc-options \" -ddump-hi -ddump-to-file\"\n    Process exited with code: ExitFailure 1\n    Logs have been written to: /home/frank/Workspace8/repo8/.stack-work/logs/littext-0.1.5.log\n\n    ghc-pkg: cannot create: .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/package.conf.inplace already exists\nghc-mod: readCreateProcess: stack \"build\" \"--only-dependencies\" \".\" (exit 1): failed\n"
-0.029s: "Running /home/frank/.local/bin/ghc-mod check,/home/frank/Workspace8/repo8/litNLP/LitNLP/Defs0.hs,-- failed with ",{"killed":false,"code":1,"signal":null,"cmd":"/home/frank/.local/bin/ghc-mod check /home/frank/Workspace8/repo8/litNLP/LitNLP/Defs0.hs --"}
0s: {"killed":false,"code":1,"signal":null,"cmd":"/home/frank/.local/bin/ghc-mod check /home/frank/Workspace8/repo8/litNLP/LitNLP/Defs0.hs --"}

Error
    at /packages/haskell-ghc-mod/lib/util.coffee:60:26
    at ChildProcess.exithandler (child_process.js:225:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)

Commands

  6x -2:16.8.0 core:backspace (input.hidden-input)
     -2:12.1.0 core:save (input.hidden-input)
  2x -2:12.1.0 ide-haskell:prettify-file (atom-text-editor.editor)
  2x -0:33.5.0 core:backspace (input.hidden-input)
     -0:23.9.0 core:save (input.hidden-input)
  2x -0:23.9.0 ide-haskell:prettify-file (atom-text-editor.editor)
     -0:15.3.0 ide-haskell-cabal:build (input.hidden-input)

Non-Core Packages

autocomplete-haskell 0.7.2 
busy 0.7.0 
git-plus 7.3.3 
haskell-ghc-mod 1.19.7 
ide-haskell 1.9.4 
ide-haskell-cabal 1.8.1 
language-haskell 1.12.1 
andrewufrank commented 7 years ago

i sense this (or a similar) problem occurs when in a multipack project a change in one project is compiled (after save). a build then builds only the subproject (and the build target remains set). i i change then another subproject, the crash occurs (because the compilation target and the build target seem not to agree -- just a conjecture, i did not study the code! i will try with the example project