Skip to content

Bootstrap fails to wipe the sysroot directory on Windows if proc-macro-server is being used #107018

Closed
@jyn514

Description

@jyn514

I tried this:

x build

I expected to see this happen: Bootstrap rebuilds the compiler.

Instead, this happened:

PS C:\Users\Joshua Nelson\src\rust> x b clippy --stage 1
Traceback (most recent call last):
  File "C:\Users\Joshua Nelson\src\rust\x.py", line 28, in <module>
    bootstrap.main()
  File "C:\Users\Joshua Nelson\src\rust\src\bootstrap\bootstrap.py", line 937, in main
    bootstrap(help_triggered)
  File "C:\Users\Joshua Nelson\src\rust\src\bootstrap\bootstrap.py", line 912, in bootstrap
    build.download_toolchain()
  File "C:\Users\Joshua Nelson\src\rust\src\bootstrap\bootstrap.py", line 428, in download_toolchain
    shutil.rmtree(bin_root)
  File "C:\Users\Joshua Nelson\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 749, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Users\Joshua Nelson\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 614, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Users\Joshua Nelson\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 619, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Users\Joshua Nelson\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 617, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\Joshua Nelson\\src\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\libexec\\rust-analyzer-proc-macro-srv.exe'

Meta

git merge-base origin/master HEAD is 9709a43

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