Skip to content

Bootstrap cannot remove host symlink on Windows if created from WSL2 #112544

@ChrisDenton

Description

@ChrisDenton

If I use ./x in WSL2 it will create a host symlink in the build directory. If I then switch to the Windows host using the same build directory I get this error:

thread 'main' panicked at 'fs::remove_dir(&host) failed with The directory name is invalid. (os error 267)', lib.rs:516:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The simplest solution here would be to detect ERROR_DIRECTORY (aka os error 267) and fallback to fs::remove_file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-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