wende / autocomplete-elixir

Intelligent Elixir autocompletion provider for Atom autocomplete-plus
MIT License
42 stars 11 forks source link

Uncaught Error: spawn ENAMETOOLONG #11

Open Hades32 opened 9 years ago

Hades32 commented 9 years ago

[Enter steps to reproduce below:]

  1. happens directly after installing
  2. ...

Atom Version: 0.201.0 System: C415M5CB3410TQN Thrown From: autocomplete-elixir package, v1.2.6

Stack Trace

Uncaught Error: spawn ENAMETOOLONG

At C:\Users\MRAUSC\AppData\Local\atom\app-0.201.0\resources\app.asar\src\buffered-process.js:260

Error: spawn ENAMETOOLONG
    at exports._errnoException (util.js:734:11)
    at ChildProcess.spawn (child_process.js:1145:11)
    at Object.exports.spawn (child_process.js:977:9)
    at BufferedProcess.module.exports.BufferedProcess.spawn (C:\Users\MRAUSC\AppData\Local\atom\app-0.201.0\resources\app.asar\src\buffered-process.js:188:44)
    at new BufferedProcess (C:\Users\MRAUSC\AppData\Local\atom\app-0.201.0\resources\app.asar\src\buffered-process.js:50:14)
    at Object.exports.init (C:\Users\MRAUSC\.atom\packages\autocomplete-elixir\lib\alchemide\wrapper.coffee:30:10)
    at exit (C:\Users\MRAUSC\.atom\packages\autocomplete-elixir\lib\alchemide\wrapper.coffee:27:22)
    at triggerExitCallback (C:\Users\MRAUSC\AppData\Local\atom\app-0.201.0\resources\app.asar\src\buffered-process.js:213:47)
    at ChildProcess.<anonymous> (C:\Users\MRAUSC\AppData\Local\atom\app-0.201.0\resources\app.asar\src\buffered-process.js:235:18)
    at emitTwo (events.js:87:13)

Commands

Config

{
  "core": {}
}

Installed Packages

# User
atomatigit, v1.5.1
autocomplete-elixir, v1.2.6
go-plus, v3.3.11
language-elixir, v0.4.0

# Dev
No dev packages
wende commented 9 years ago

Your project is too deep in directories for the spawn. I remember running onto it back in a day. I'll check out if there's any way to fix it

Hades32 commented 9 years ago

As this is still Happening with Atom 1.0.0 I debugged a little bit. The ENAMETOLONG is a wrong error code. I truth there is a bug in Node.js where child_process.spawn somehow NULLs an object which leads to an unexpected crash when the command gives some unexpected exit code.

What autocomplete-elixir is doing is this call on Windows:

{ "file" : "C:\Windows\system32\cmd.exe", "args" : ["C:\Windows\system32\cmd.exe", "/s", "/c", "\"elixir\elixir \"C:\Users\marti.atom\packages\autocomplete-elixir\lib\alchemide\autocompleter\autocomplete.exs\" \"D:\Projekte\2048squared\"\""], "windowsVerbatimArguments" : true, "detached" : false, "envPairs" : ["ALLUSERSPROFILE=C:\ProgramData", "APPDATA=C:\Users\marti\AppData\Roaming", "ATOM_HOME=C:\Users\marti.atom", "CommonProgramFiles=C:\Program Files (x86)\Common Files", "CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files", "CommonProgramW6432=C:\Program Files\Common Files", "COMPUTERNAME=WIN-SJ0A7GO32DV", "ComSpec=C:\Windows\system32\cmd.exe", "FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer", "FPS_BROWSER_USER_PROFILE_STRING=Default", "GOOGLE_API_KEY=AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q", "HOMEDRIVE=C:", "HOMEPATH=\Users\marti", "LOCALAPPDATA=C:\Users\marti\AppData\Local", "LOGONSERVER=\MicrosoftAccount", "NODE_ENV=production", "NODE_PATH=C:\Users\marti\AppData\Local\atom\app-1.0.0\resources\app.asar\exports", "NUMBER_OF_PROCESSORS=4", "OS=Windows_NT", "Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\erl6.4\bin;C:\Program Files (x86)\Elixir\bin;C:\Program Files\Git\cmd;C:\OtherProgs\Vagrant\bin;C:\Users\marti\AppData\Local\atom\bin;C:\Program Files\Boot2Docker for Windows", "PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC", "PROCESSOR_ARCHITECTURE=x86", "PROCESSOR_ARCHITEW6432=AMD64", "PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel", "PROCESSOR_LEVEL=6", "PROCESSOR_REVISION=3a09", "ProgramData=C:\ProgramData", "ProgramFiles=C:\Program Files (x86)", "ProgramFiles(x86)=C:\Program Files (x86)", "ProgramW6432=C:\Program Files", "PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\", "PUBLIC=C:\Users\Public", "SESSIONNAME=Console", "SystemDrive=C:", "SystemRoot=C:\Windows", "TEMP=C:\Users\marti\AppData\Local\Temp", "TMP=C:\Users\marti\AppData\Local\Temp", "USERDOMAIN=WIN-SJ0A7GO32DV", "USERDOMAIN_ROAMINGPROFILE=WIN-SJ0A7GO32DV", "USERNAME=marti", "USERPROFILE=C:\Users\marti", "VBOX_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\", "windir=C:\Windows"], "stdio" : [{ "type" : "pipe", "readable" : true, "writable" : false, "handle" : { "fd" : -1, "writeQueueSize" : 0 } }, { "type" : "pipe", "readable" : false, "writable" : true, "handle" : { "fd" : -1, "writeQueueSize" : 0 } }, { "type" : "pipe", "readable" : false, "writable" : true, "handle" : { "fd" : -1, "writeQueueSize" : 0 } } ] }

You notice the "elixir\elixir" part? As it looked wrong I replaced it with "elixir" in the debug, and voila it works!

I hope this helps fixing this issue...

wende commented 9 years ago

Oh I know what's the problem. I gave default value for "elixirPath" equal to "elixir". Which is dumb because it's used to be a folder so it adds up to "elixir/elixir". In newest version I changed it to always remove word elixir from the setting so it will work either when path provided or when folder provided. Try it our with the newest version v1.3.7 if i remember well

wende commented 9 years ago

1.3.8*