nguyenchr / atom-cargo-test-runner

Cargo test runner for Atom Editor
https://atom.io/packages/cargo-test-runner
MIT License
5 stars 3 forks source link

Compiler error when test is run #1

Closed alexschneider closed 9 years ago

alexschneider commented 9 years ago

Output with all debug options enabled.

Cargo binary:   /usr/local/bin/cargo
Root folder:    /home/alex/git/matasano-crypto/src
Test file:      fixed_xor.rs
       Fresh unsafe-any v0.2.2
       Fresh rustc-serialize v0.2.15
       Fresh matches v0.1.2
       Fresh gcc v0.2.1
       Fresh pkg-config v0.2.2
       Fresh gcc v0.1.7
       Fresh libc v0.1.2
       Fresh log v0.2.4
       Fresh rustc-serialize v0.3.0
       Fresh unicase v0.0.5
       Fresh url v0.2.21
       Fresh mime v0.0.8
       Fresh openssl-sys v0.4.3
       Fresh time v0.1.17
       Fresh openssl v0.4.3
       Fresh cookie v0.1.12
       Fresh hyper v0.2.0
   Compiling matasano v0.0.1 (file:///home/alex/git/matasano-crypto)
     Running `rustc lib.rs --crate-name matasano --crate-type lib -g --test -C metadata=6b887a824b8552d7 -C extra-filename=-6b887a824b8552d7 --out-dir /home/alex/git/matasano-crypto/target --emit=dep-info,link -L dependency=/home/alex/git/matasano-crypto/target -L dependency=/home/alex/git/matasano-crypto/target/deps --extern hyper=/home/alex/git/matasano-crypto/target/deps/libhyper-ab3f9d88ab41aa5e.rlib -L native=/usr/lib -L native=/home/alex/git/matesano-crypto/target/build/openssl-sys-26edf94d95ec3590/out -L native=/home/alex/git/matesano-crypto/target/build/time-3fdd29c1b6f5cc42/out`
     Running `rustc lib.rs --crate-name matasano --crate-type lib -g -C metadata=a04da09eb629d9b2 -C extra-filename=-a04da09eb629d9b2 --out-dir /home/alex/git/matasano-crypto/target --emit=dep-info,link -L dependency=/home/alex/git/matasano-crypto/target -L dependency=/home/alex/git/matasano-crypto/target/deps --extern hyper=/home/alex/git/matasano-crypto/target/deps/libhyper-ab3f9d88ab41aa5e.rlib -L native=/usr/lib -L native=/home/alex/git/matesano-crypto/target/build/openssl-sys-26edf94d95ec3590/out -L native=/home/alex/git/matesano-crypto/target/build/time-3fdd29c1b6f5cc42/out`
error: could not exec the linker `cc`: no such file or directory
error: aborting due to previous error
Build failed, waiting for other jobs to finish...
error: could not exec `ar`: no such file or directory
error: aborting due to previous error
Could not compile `matasano`.

Caused by:
  Process didn't exit successfully: `rustc lib.rs --crate-name matasano --crate-type lib -g --test -C metadata=6b887a824b8552d7 -C extra-filename=-6b887a824b8552d7 --out-dir /home/alex/git/matasano-crypto/target --emit=dep-info,link -L dependency=/home/alex/git/matasano-crypto/target -L dependency=/home/alex/git/matasano-crypto/target/deps --extern hyper=/home/alex/git/matasano-crypto/target/deps/libhyper-ab3f9d88ab41aa5e.rlib -L native=/usr/lib -L native=/home/alex/git/matesano-crypto/target/build/openssl-sys-26edf94d95ec3590/out -L native=/home/alex/git/matesano-crypto/target/build/time-3fdd29c1b6f5cc42/out` (status=101)

In the terminal:

$ which cc
/usr/bin/cc
$ which ar
/usr/bin/ar
nguyenchr commented 9 years ago

thanks for that, I will look into this out of curiosity do you open atom from the command line or with finder? Opening atom via finder will not take into account your environment, so things like $PATH will not exist

alexschneider commented 9 years ago

I use Atom on Linux, and I open it up through a launcher (similar to Finder).

Could you perhaps have have cargo be executed through a shell environment?

nguyenchr commented 9 years ago

Try opening it from the shell, I believe that should preserve your $PATH see https://github.com/atom/atom-shell/issues/550 for more context

I discovered a similar error where the test runner doesn't seem to kill cargo properly on an unsuccessful test, so I will look into that as well

nguyenchr commented 9 years ago

@alexschneider I just published v0.0.3 it will use the entire path when spawning the cargo process if it exists, it will also print the path in the context information to debug whether it is a problem with the path

I think you will still need to open atom from the shell please give this a try and let me know how you go

nguyenchr commented 9 years ago

@alexschneider did this end up fixing your problem?

alexschneider commented 9 years ago

Sorry, yes.