Closed
Description
Rustbuild fails to delete itself when cleaning on Windows and panics:
PS D:\code\rust> python x.py clean
Updating only changed submodules
Submodules updated in 0.13 seconds
thread 'main' panicked at 'failed to remove file D:\code\rust\build\bootstrap\debug\bootstrap.exe: Access is denied. (os error
5)', src\bootstrap\clean.rs:80:17
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/05b6023675d77979637b04a350c85903fbf59257\/library\std\src\panicking.rs:493
1: std::panicking::begin_panic_fmt
at /rustc/05b6023675d77979637b04a350c85903fbf59257\/library\std\src\panicking.rs:435
2: bootstrap::clean::do_op::{{closure}}<closure-0>
at .\src\bootstrap\clean.rs:80
3: core::result::Result<tuple<>, std::io::error::Error>::unwrap_or_else<tuple<>,std::io::error::Error,closure-0>
at /rustc/05b6023675d77979637b04a350c85903fbf59257\library\core\src\result.rs:825
4: bootstrap::clean::do_op<closure-0>
at .\src\bootstrap\clean.rs:79
5: bootstrap::clean::rm_rf
at .\src\bootstrap\clean.rs:54
6: bootstrap::clean::rm_rf
at .\src\bootstrap\clean.rs:59
7: bootstrap::clean::rm_rf
at .\src\bootstrap\clean.rs:59
8: bootstrap::clean::clean
at .\src\bootstrap\clean.rs:24
9: bootstrap::Build::build
at .\src\bootstrap\lib.rs:486
10: bootstrap::main
at .\src\bootstrap\bin\main.rs:30
11: core::ops::function::FnOnce::call_once<fn(),tuple<>>
at /rustc/05b6023675d77979637b04a350c85903fbf59257\library\core\src\ops\function.rs:227
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
failed to run: D:\code\rust\build\bootstrap\debug\bootstrap clean
Build completed unsuccessfully in 0:00:28