Skip to content

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

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.

Activity

  1. added
    O-windowsOperating system: Windows
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    C-bugCategory: This is a bug.
    on Jun 12, 2023
  2. added 2 commits that reference this issue on Aug 17, 2024
    e73eaeb
    ca401c6
  3. added 2 commits that reference this issue on Aug 18, 2024
    9ad3e3f
    fe94f19
  4. added 2 commits that reference this issue on Aug 18, 2024
    ed934b2
    cba68a6
  5. added 2 commits that reference this issue on Aug 20, 2024
    8832eae
    d4cf9f0
  6. added 2 commits that reference this issue on Aug 21, 2024
    f9fc459
    6e7889d
  7. added a commit that references this issue on Aug 21, 2024
    9fd8a2c
  8. added a commit that references this issue on Aug 22, 2024
    0e92667
  9. added a commit that references this issue on Aug 22, 2024
    726f362
  10. jieyouxu commented on Aug 22, 2024

    @jieyouxu
    Member

    Re-opening due to revert #129413.

  11. self-assigned this
    on Aug 22, 2024
  12. removed their assignment
    on Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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