-
Notifications
You must be signed in to change notification settings - Fork 964
Description
The cargo doc --open
command is currently broken on nightly Cargo on Windows. The implementation of this command recently changed in Cargo. This new implementation is affected by a bug in rustup's job object code on Windows. Job objects are a Windows feature that rustup uses to implement the behavior such that when ctrl-c is pressed, child processes are also killed. The existing job object code was copied from Cargo. I recently fixed the job code in Cargo, which was also causing issues.
I intended on sending a pull request to rustup to apply the same fix, but I ran into a problem: The fix relies on a destructor to run when rustup exits, but rustup uses std::process::exit
, which doesn't run destructors. I can think of two solutions; either move the std::process::exit
call(s) outwards so that the calls can run after the destructors, or use a mechanism other than a destructor to run the necessary code.
Links
My branch with the fixed job code: https://github.com/Seeker14491/rustup.rs/tree/job
Line in rustup where the object whose destructor needs to run is created: https://github.com/rust-lang-nursery/rustup.rs/blob/22b6cdb8b000f9217af1dd5dd4e73ce032bdb25d/src/rustup-cli/proxy_mode.rs#L14