vertexclique / tokamak

Fusion Reactor for Rust - Atom Rust IDE
https://vertexclique.github.io/tokamak/
MIT License
399 stars 13 forks source link

Failed to activate the tokamak package #68

Open ciclonite opened 7 years ago

ciclonite commented 7 years ago

I have a problem with tokamak [Enter steps to reproduce:]

Atom: 1.14.1 x64 Electron: 1.3.13 OS: Ubuntu 16.04.1 Thrown From: tokamak package 0.3.2

Stack Trace

Failed to activate the tokamak package

At Cannot read property 'path' of undefined

TypeError: Cannot read property 'path' of undefined
    at Function.module.exports.Utils.parseTokamakConfig (/packages/tokamak/lib/utils.coffee:125:62)
    at Object.tokamakProjectConfigLaunch (/packages/tokamak/lib/tokamak.coffee:112:28)
    at Object.activate (/packages/tokamak/lib/tokamak.coffee:96:10)
    at Package.module.exports.Package.activateNow (/app.asar/src/package.js:218:19)
    at /app.asar/src/package.js:190:32
    at Package.module.exports.Package.measure (/app.asar/src/package.js:96:15)
    at /app.asar/src/package.js:183:26
    at Package.module.exports.Package.activate (/app.asar/src/package.js:180:34)
    at PackageManager.module.exports.PackageManager.activatePackage (/app.asar/src/package-manager.js:550:34)
    at /app.asar/src/package-manager.js:352:19
    at /app.asar/src/config.js:635:20
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at Config.module.exports.Config.emitChangeEvent (/app.asar/src/config.js:826:29)
    at Config.module.exports.Config.setRawValue (/app.asar/src/config.js:612:19)
    at Config.module.exports.Config.set (/app.asar/src/config.js:227:14)
    at Config.module.exports.Config.removeAtKeyPath (/app.asar/src/config.js:377:12)
    at Package.module.exports.Package.enable (/app.asar/src/package.js:81:26)
    at PackageManager.module.exports.PackageManager.enablePackage (/app.asar/src/package-manager.js:173:14)
    at /app.asar/node_modules/settings-view/lib/package-card.js:348:27)
    at HTMLButtonElement.dispatch (/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
    at HTMLButtonElement.elemData.handle (/app.asar/node_modules/jquery/dist/jquery.js:4121:28)

Commands

     -8:59.9.0 core:paste (input.hidden-input)
 20x -8:54.1.0 core:backspace (input.hidden-input)
     -8:52.8.0 core:confirm (input.hidden-input)
     -8:44.3.0 core:backspace (input.hidden-input)
     -8:43.2.0 core:confirm (input.hidden-input)

Non-Core Packages

atom-beautify 0.29.17 
build 0.67.0 
build-cargo 2.0.0 
busy 0.7.0 
language-rust 0.4.9 
linter 1.11.23 
linter-rust 0.7.2 
racer 0.20.0 
rustfmt 0.1.3 
tokamak 0.3.2 
tokamak-terminal 10.0.1 
Mnenmenth commented 7 years ago

Same here. Has happened to me on both Linux Mint and Windows 10

[Enter steps to reproduce:]

  1. Install tokamak
  2. Run atom

Atom: 1.15.0 ia32 Electron: 1.3.13 OS: Microsoft Windows 10 Home Thrown From: tokamak package 0.3.2

Stack Trace

Failed to activate the tokamak package

At Cannot read property 'path' of undefined

TypeError: Cannot read property 'path' of undefined
    at Function.module.exports.Utils.parseTokamakConfig (/packages/tokamak/lib/utils.coffee:125:62)
    at Object.tokamakProjectConfigLaunch (/packages/tokamak/lib/tokamak.coffee:112:28)
    at Object.activate (/packages/tokamak/lib/tokamak.coffee:96:10)
    at Package.module.exports.Package.activateNow (/app.asar/src/package.js:218:19)
    at /app.asar/src/package.js:190:32
    at Package.module.exports.Package.measure (/app.asar/src/package.js:96:15)
    at /app.asar/src/package.js:183:26
    at Package.module.exports.Package.activate (/app.asar/src/package.js:180:34)
    at PackageManager.module.exports.PackageManager.activatePackage (/app.asar/src/package-manager.js:550:34)
    at /app.asar/src/package-manager.js:531:29
    at Config.module.exports.Config.transactAsync (/app.asar/src/config.js:337:18)
    at PackageManager.module.exports.PackageManager.activatePackages (/app.asar/src/package-manager.js:526:19)
    at PackageManager.module.exports.PackageManager.activate (/app.asar/src/package-manager.js:508:46)
    at /app.asar/src/atom-environment.js:812:28

Commands

Non-Core Packages

tokamak 0.3.2 
deimo commented 7 years ago

when I open the new folder that happened the same as @ciclonite

ciclonite commented 7 years ago

Any News? The problem appear also on Windows 10 pro. All path was setup correctly.

Mnenmenth commented 7 years ago

From what I can gather it seems that at line 125 in utils.coffee, it is trying to load a 'tokamak.toml' file that does not exist.

ciclonite commented 7 years ago

Thanks for reply, i've tried to hardcode the path of tokamak.toml config_file = "c:\\utenti\\xxxx\\tokamak.toml" Now tokamak start successfully, but whe i try to compile or run something the command it's not valid because, tokamak call run before cargo.exe Instead : cargo.exe run tokamak call : run cargo.exe!

Windows PowerShell Copyright (C) 2016 Microsoft Corporation. Tutti i diritti sono riservati.

PS C:\Users\ciclonite\Documents\Projects\exPipo> run C:\Users\ciclonite.cargo\bin\cargo.exe run : Termine 'run' non riconosciuto come nome di cmdlet, funzione, programma eseguibile o file script. >Controllare l'ortografia del nome o verificare che il percorso sia incluso e corretto, quindi riprovare. In riga:1 car:2

RobGThai commented 7 years ago

Reporting from OSX here as well.

Mnenmenth commented 7 years ago

@ciclonite So I figured out what appears to be the problem. I'm not sure what's causing the run cargo error you just reported, but tokamak seems to throw the "undefined path" error if you don't have an active project folder open. If you do File->Add Project Folder in atom, then restart atom, tokamak loads and runs completely fine as far as I can tell. So that means the undefined path problem has something to do with not finding a current rust project open in atom. Let me know if you don't understand and I'll try to explain a bit clearer

ciclonite commented 7 years ago

@Mnenmenth Thanks a lot, problem no. 1 solved. But, take a look here : Cargo Run problem

Mnenmenth commented 7 years ago

@ciclonite That's a very strange problem you have there. So from what I saw in the video, tokamak always add the extra newline after the paths on startup, and once you remove them it runs fine, right? Just try something for me. Uninstall tokamak, delete tokamak.toml from your home directory, and reinstall tokamak. When you were changing cargo_file to a hard coded directory maybe you added a newline somewhere it shouldn't be, which might be the cause of the issue.

ciclonite commented 7 years ago

Ok, finally i've found the solution to this problem. I've tried to disinstall tokamak, delete tokamak.toml and reinstall it without success. On the tokamak setting there is a flag called "Detect binaries on startup", i've removed it and deleted the space after the paths. Now all work perfectly. May be a problem with the function that detect binaries? Thanks a lot!

vertexclique commented 7 years ago

I am open to any PR that adds apm tests and also bugfixes. I don't have that much time most of the times to fix all those guys.

vertexclique commented 7 years ago

Guys, can you please upgrade to 0.4.0 ?

OvermindDL1 commented 7 years ago

Installing 0.4.0 gives this in a popup:

Uncaught Error: Failed to spawn command `$HOME/.cargo/bin/rustup`. Make sure `$HOME/.cargo/bin/rustup` is installed and on your PATH

And yet if I do:

╰─➤  $HOME/.cargo/bin/rustup 
rustup 1.6.0 (a11c01e8c 2017-08-30)
The Rust toolchain installer

USAGE:
    rustup [FLAGS] <SUBCOMMAND>
...

That works. I'm guessing that $HOME is not being expanded automatically. Might need to grab it from the environment instead as auto-expansion does not work in most javascript shell calls.

OvermindDL1 commented 7 years ago

Further testing shows the error is fixed if I fill in the option "Cargo home directory (optional)" directly.

Also, stopping and restarting the plugin duplicates the toolbar, it does not seem to clean up after itself very well?

image