Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo hangs for 20 more seconds after showing the compilation errors, for apparently no reason #2079

Closed
ghost opened this issue Oct 25, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 25, 2015

When there are compilation errors, cargo hangs for 20 more seconds after showing them:

$ time cargo run -v
   Compiling phrases v0.0.1 (file:///home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases)
     Running `rustc src/main.rs --crate-name phrases --crate-type bin -g --out-dir /home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug --emit=dep-info,link -L dependency=/home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug -L dependency=/home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug/deps --extern phrases=/home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug/libphrases.rlib`
src/main.rs:8:5: 8:12 error: expected one of `.`, `;`, `}`, or an operator, found `println`
src/main.rs:8     println!("Hello in English: {}", greetings::hello());
                  ^~~~~~~
Could not compile `phrases`.

Caused by:
  Process didn't exit successfully: `rustc src/main.rs --crate-name phrases --crate-type bin -g --out-dir /home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug --emit=dep-info,link -L dependency=/home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug -L dependency=/home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug/deps --extern phrases=/home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug/libphrases.rlib` (exit code: 101)

real    0m23.901s
user    0m23.303s
sys 0m0.290s

It hangs right on the line before displaying Could not compile phrases.

vs no errors:

$ time cargo run -v
   Compiling phrases v0.0.1 (file:///home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases)
     Running `rustc src/main.rs --crate-name phrases --crate-type bin -g --out-dir /home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug --emit=dep-info,link -L dependency=/home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug -L dependency=/home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug/deps --extern phrases=/home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug/libphrases.rlib`
     Running `target/debug/phrases`
Hello in English: Hello!
Goodbye in English: Goodbye.
Hello in Japanese: こんにちは
Goodbye in Japanese(日本語): さようなら

real    0m1.729s
user    0m1.200s
sys 0m0.333s

The tested project is here: https://github.com/zazdxscf/rustLearnage/tree/cd3ade8eae6f6cde99e7e750490b2672a1247b54/rust_book/phrases
But works on any, even simpler main.rs ones.

@ghost
Copy link
Author

ghost commented Oct 25, 2015

Nevermind, it's actually rustc which hangs!

$ time rustc src/main.rs --crate-name phrases --crate-type bin -g --out-dir /home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug --emit=dep-info,link -L dependency=/home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug -L dependency=/home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug/deps --extern phrases=/home/zazdxscf/build/1nonpkgs/rustLearnage/rust_book/phrases/target/debug/libphrases.rlib
src/main.rs:8:5: 8:12 error: expected one of `.`, `;`, `}`, or an operator, found `println`
src/main.rs:8     println!("Hello in English: {}", greetings::hello());
                  ^~~~~~~

real    0m23.389s
user    0m23.000s
sys 0m0.213s

EDIT: even simple, hangs:

$ time rustc src/main.rs
src/main.rs:8:5: 8:12 error: expected one of `.`, `;`, `}`, or an operator, found `println`
src/main.rs:8     println!("Hello in English: {}", greetings::hello());
                  ^~~~~~~

real    0m23.481s
user    0m23.103s
sys 0m0.193s

$ rustc --version --verbose
rustc 1.5.0-dev (04e497c00 2015-10-24)
binary: rustc
commit-hash: 04e497c0056aed899cd6edbc98e7a68a9b391c5c
commit-date: 2015-10-24
host: x86_64-unknown-linux-gnu
release: 1.5.0-dev

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants