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 nightly no longer working #4189

Closed
sophiajt opened this issue Jun 19, 2017 · 11 comments
Closed

Cargo nightly no longer working #4189

sophiajt opened this issue Jun 19, 2017 · 11 comments

Comments

@sophiajt
Copy link

This was with the most recent rustup'ing of nightly:

image

It seems like cargo just hangs there, showing no status. It does "finish" but I don't see the build artefact I'd expect. "cargo run" also doesn't work correctly, returning to the cmd line with no message instead of running the application.

@sophiajt
Copy link
Author

I tried uninstalling and reinstalling rustup to see if there was something that got goofed there, but seeing the same issue.

@K-Finlay
Copy link

I'm getting the same thing here.
"cargo new" is also broken. It just hangs for a bit then returns to the cmd, failing to create a new project.

@pravic
Copy link

pravic commented Jun 19, 2017

I am not sure about the new issue, may be all these problems caused by single bug.

Cargo messages are broken too on nightly (messed newlines):

  Compiling utf8-ranges v1.0.0
  num-traits v0.1.39
   Compiling libc v0.2   Compiling regex-syntax v0.4.1
   Compiling gcc v0.3


   Compiling thread-id v3.1.0

@alexcrichton
Copy link
Member

It looks like Cargo's doing things it's just not printing to the console, probably related to #4162. When run directly (not through rustup) I see messages getting printed out.

@K-Finlay I can't confirm that cargo new fails to create a new project. Can you confirm versions of what you're using and also confirm that it fails to create a new project.

@pravic I cannot reproduce the interleaving you're seeing, can you provide details on the versions used and how to reproduce?

@pravic
Copy link

pravic commented Jun 19, 2017

cargo 0.21.0-nightly (e53e2f8d5 2017-06-17)

Windows 7 x64 SP1, ConEmu 170118 (without ConEmu almost the same behavior).

t:\tamp>cd weird_nightly\

t:\tamp\weird_nightly>tail -n +6 Cargo.toml
[dependencies]
getopts = "*"
rustc-serialize = "*"
log = "*"
env_logger = "*"
rust-crypto = "*"
flate2 = "*"
byteorder = "*"
widestring = "*"
chrono = "*"

Nightly:

t:\tamp\weird_nightly>cargo +nightly build
  Compiling byteorder v1.0.   Compiling log v0.3.8
   Compiling num-traits v039
   Compiling utf8-ranges v1.0.0
   getopts v014
   Compiling libc v0.2.24
   Compiling winapi v v0.6.3
.2.36

Stable:

t:\tamp\weird_nightly>cargo +stable build
   Compiling winapi v0.2.8
   Compiling gcc v0.3.51
   Compiling num-traits v0.1.39
   Compiling getopts v0.2.14
   Compiling log v0.3.8
   Compiling utf8-ranges v1.0.0
   Compiling void v1.0.2
   Compiling widestring v0.2.2
   Compiling unreachable v0.1.1
   Compiling rustc-serialize v0.3.24
   Compiling regex-syntax v0.4.1
   Compiling winapi-build v0.1.1
   Compiling libc v0.2.24
   Compiling kernel32-sys v0.2.2
   Compiling num-integer v0.1.34
   Compiling rand v0.3.15
   Compiling memchr v1.0.1
   Compiling byteorder v1.0.0
   Compiling num-iter v0.1.33
   Compiling aho-corasick v0.6.3
   Compiling num v0.1.39
   Compiling miniz-sys v0.1.9
   Compiling rust-crypto v0.2.36
   Compiling flate2 v0.2.19
   Compiling thread-id v3.1.0
   Compiling time v0.1.37
   Compiling thread_local v0.3.3
   Compiling regex v0.2.2
   Compiling chrono v0.3.1
   Compiling env_logger v0.4.3
   Compiling weird_nightly v0.1.0 (file:///T:/tamp/weird_nightly)
    Finished dev [unoptimized + debuginfo] target(s) in 34.78 secs

Direct (no output at all):

t:\tamp\weird_nightly>%RUSTUP_HOME%\toolchains\nightly-i686-pc-windows-msvc\bin\cargo.exe build -v

t:\tamp\weird_nightly>

@alexcrichton
Copy link
Member

@pravic for the direct invocation was that with with a removed target directory? If not, is cargo compiling things in the background?

alexcrichton added a commit to alexcrichton/ripgrep that referenced this issue Jun 19, 2017
The primary motivation for this commit was rust-lang/cargo#4189 where dropping a
`wincolor::Console` would call `CloseHandle` to close the console handle. Cargo
creates a few `Console` instances so it ended up closing stdout a little
earlier as intended!

The `GetStdHandle` function returns handles I believe aren't intended to be
closed (as there's no refcounting). I believe libstd doesn't close these
handles.

This commit also moves to calling `GetStdHandle` on demand which libstd changed
to doing so recently as well, preventing caching of stale handles that change
over time with calls to `SetStdHandle`.
@alexcrichton
Copy link
Member

I believe this is fixed by BurntSushi/ripgrep#523 after looking into it a bit, or at least it fixes a number of issues for me locally. I think rustup was a red herring.

@pravic
Copy link

pravic commented Jun 19, 2017

for the direct invocation was that with with a removed target directory?

Yes, it was after cargo clean. It was compiled successfully, just without any messages.

BurntSushi pushed a commit to BurntSushi/ripgrep that referenced this issue Jun 19, 2017
The primary motivation for this commit was rust-lang/cargo#4189 where dropping a
`wincolor::Console` would call `CloseHandle` to close the console handle. Cargo
creates a few `Console` instances so it ended up closing stdout a little
earlier as intended!

The `GetStdHandle` function returns handles I believe aren't intended to be
closed (as there's no refcounting). I believe libstd doesn't close these
handles.

This commit also moves to calling `GetStdHandle` on demand which libstd changed
to doing so recently as well, preventing caching of stale handles that change
over time with calls to `SetStdHandle`.
alexcrichton added a commit to alexcrichton/cargo that referenced this issue Jun 19, 2017
bors added a commit that referenced this issue Jun 19, 2017
alexcrichton added a commit to alexcrichton/rust that referenced this issue Jun 19, 2017
@LLBlumire
Copy link

PS C:\Users\Lucille\Documents\Code\Rust\hellotest> cargo clean
PS C:\Users\Lucille\Documents\Code\Rust\hellotest> cargo build
   Compiling hellotest v0.1.0 (file:///C:/Users/Lucille/Documents/Code/Rust/hellotest)
    Finished dev [unoptimized + debuginfo] target(s) in 0.24 secs
PS C:\Users\Lucille\Documents\Code\Rust\hellotest> cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target\debug\hellotest.exe`
Hello, world!
PS C:\Users\Lucille\Documents\Code\Rust\hellotest> rustup default nightly
info: using existing install for 'nightly-x86_64-pc-windows-msvc'
info: default toolchain set to 'nightly-x86_64-pc-windows-msvc'

  nightly-x86_64-pc-windows-msvc unchanged - rustc 1.19.0-nightly (10d7cb44c 2017-06-18)

PS C:\Users\Lucille\Documents\Code\Rust\hellotest> cargo clean
PS C:\Users\Lucille\Documents\Code\Rust\hellotest> cargo build
PS C:\Users\Lucille\Documents\Code\Rust\hellotest> cargo run
PS C:\Users\Lucille\Documents\Code\Rust\hellotest> cargo -V
cargo 0.21.0-nightly (50b1c24d1 2017-06-17)

I'm getting what appears to be similar issues with nightly right now.

@K-Finlay
Copy link

@alexcrichton "cargo new" failing seems to be an error on my end.
I was trying to create a project named "test" which I forgot is not allowed by cargo, and due to there being no output, I assumed it was broken.

bors added a commit to rust-lang/rust that referenced this issue Jun 20, 2017
@EPashkin
Copy link
Contributor

On windows it same with nightly. Piping errors to file helps: cargo build 2>_

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

6 participants