edubkendo / atom-racer

Intelligent code completion for Rust in the Atom Editor. Requires Racer.
MIT License
115 stars 24 forks source link

Uncaught Error: spawn ENOTDIR #17

Closed leshow closed 9 years ago

leshow commented 9 years ago

[Enter steps to reproduce below:]

i installed the racer package (racer-git from AUR) I have the rust-nightly-bin package, which I don't believe includes a copy of the src so I cloned rust-lang and pointed racer to the src directory from the rust-lang repo

Can't seem to get the autocomplete to work.

Atom Version: 0.177.0 System: linux 3.18.5-1-ARCH Thrown From: racer package, v0.9.1

Stack Trace

Uncaught Error: spawn ENOTDIR

At child_process.js:1160

Error: spawn ENOTDIR
  at exports._errnoException (util.js:753:11)
  at ChildProcess.spawn (child_process.js:1160:11)
  at Object.exports.spawn (child_process.js:993:9)
  at new BufferedProcess (/usr/share/atom/resources/app/src/buffered-process.js:51:37)
  at /home/leshow/.atom/packages/racer/lib/racer-client.coffee:41:21
  at /home/leshow/.atom/packages/racer/node_modules/temp/lib/temp.js:252:7
  at FSReqWrap.oncomplete (fs.js:100:15)

Commands

     -4:15.0 core:select-down (atom-text-editor.editor.is-focused)
  2x -4:14.6 core:backspace (atom-text-editor.editor.is-focused)
     -4:11.7 core:cut (atom-text-editor.editor.is-focused)
     -4:10.2 core:save (atom-text-editor.editor.is-focused)
  3x -1:50.9 core:backspace (atom-text-editor.editor.mini)
     -0:01.2 editor:newline (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "seti-ui",
      "base16-tomorrow-dark-theme"
    ],
    "autoHideMenuBar": true
  },
  "racer": {
    "racerBinPath": "/usr/bin/racer/",
    "rustSrcPath": "/home/leshow/Development/rust/rust/src/"
  }
}

Installed Packages

# User
angularjs, v0.1.0
autocomplete-haskell, v0.2.0
autocomplete-plus, v2.1.3
color-picker, v1.4.4
highlight-line, v0.9.3
language-haskell, v1.0.0
language-rust, v0.3.5
linter-rust, v0.0.3
minimap, v4.1.2
racer, v0.9.1
remember-session, v0.5.1
seti-ui, v0.6.3

# Dev
No dev packages

/cc @atom/core

alkama commented 9 years ago

Hello @leshow

Oh, the path to the racer has to link to the binary file, not to the directory that contains it :)

So in:

"racerBinPath": "/usr/bin/racer/",

There is a / that shouldn't be there. You probably should put /usr/bin/racer in the settings.

Note: I already took some note to work on safety improvements to check that the paths are correctly setup before trying to call the executable, that would ease user's setup and provide better feedback that something in the path is not correctly set

alkama commented 9 years ago

@leshow tell us if it solved your issue :)

leshow commented 9 years ago

ah yes, that removes the error. however the suggestions are still not coming up as I type and I don't know why

alkama commented 9 years ago

@leshow good !

About the lack of suggestions, maybe it's the path to your src of rust that is wrong? you could probably confirm or infirm that by calling racer by hand.

You could try to trigger racer using a terminal and entering:

RUST_SRC_PATH=/home/leshow/Development/rust/rust/src/ /usr/bin/racer complete std::co

if it works, it should return some lines starting with MATCH ... (4 of those here)

if it doesn't work, then it's your source path that is wrong and racer cant use it.

Note: If it was indeed a source path problem, dont forget to update your atom settings with the right one, and close and reopen atom for the change to propagate, or force a reload using the command palette and looking for "Windows:Reload". Our module doesn't track config changes automatically (once they've been set) for the moment

alkama commented 9 years ago

@leshow did it work?

leshow commented 9 years ago

~ ❯❯❯ racer complete std::co
[1]    15968 illegal hardware instruction (core dumped)  racer complete std::co

(I have RUST_SRC_PATH exported as the same dir as the one configured in atom)

No it did not, so I imagine you're correct and my src path is messed up.

To get the rust src I cloned the rust-lang repo and pointed racer to that src directory, because I'm installing the rust-nightly from a bin. Was there something else I should've done?

alkama commented 9 years ago

@leshow Hum, I dont know. I dont really use the rust master. What I usually do is download the nightly src at https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz and put it somewhere in my home, then point the RUST_SRC_PATH to the src subfolder and it works. As for "racer" itself, this, I git and cargo build --release myself, since it tends to follow the nightly and I might patch it at times :) You might want to try that ! Hope you'll have it working.

Do you mind if I close the issue, since it's not a atom-racer concern ?

leshow commented 9 years ago

of course, thank you very much for your help

alkama commented 9 years ago

@leshow my pleasure :)