Skip to content

x.py clean fails to delete the rustbuild executable on Windows and panics #82520

Closed
@wesleywiser

Description

@wesleywiser

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustC-bugCategory: This is a bug.O-windowsOperating system: WindowsT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions