Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access Denied Error when x.py tries to rebuild bootstrap #109630

Open
Teapot4195 opened this issue Mar 26, 2023 · 2 comments
Open

Access Denied Error when x.py tries to rebuild bootstrap #109630

Teapot4195 opened this issue Mar 26, 2023 · 2 comments
Labels
A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust O-windows Operating system: Windows T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Teapot4195
Copy link
Contributor

It appears that x is creating the build folder with the incorrect permissions.

Steps to reproduce

  • Clean install.
  • Run ./x.ps1 build
  • Run any command (like ./x.py test tidy) that rebuilds anything that's already been built using the other shell.
  • Observe the following error
error: failed to remove file `C:/msys64/home/siyua/rust/build/bootstrap\debug\rustc.exe`

Caused by:
  Access is denied. (os error 5)
warning: build failed, waiting for other jobs to finish...
error: failed to remove file `C:/msys64/home/siyua/rust/build/bootstrap\debug\bootstrap.exe`

Caused by:
  Access is denied. (os error 5)
failed to run: C:/msys64/home/siyua/rust/build/x86_64-pc-windows-gnu/stage0/bin/cargo.exe build --manifest-path C:/msys64/home/siyua/rust/src/bootstrap/Cargo.toml

Workaround

Navigate to the rust build folder, open properties, navigate to the security tab and make sure that the Users section has permissions for Modify

Head is at ef03fda339923e659d3d3ca3321de887316d2807.

@jyn514
Copy link
Member

jyn514 commented Mar 26, 2023

heh, this is exactly what @Mark-Simulacrum was worried about in #98373 - cargo is trying to recreate the bootstrap.exe file while another instance of bootstrap is running, because we only lock the build directory in the rust process, not in python.

I don't think PowerShell vs python is related, but MSys2 might be setting some environment variable that causes cargo to rebuild, which would explain why no one else has run into this yet.

@jyn514 jyn514 added O-windows Operating system: Windows T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 26, 2023
@Teapot4195
Copy link
Contributor Author

Teapot4195 commented Mar 26, 2023

Oddly I haven't been able to recreate it when it was built by the same shell, but it could just be me.

Edit: Or it could be that I have stumbled into two completely unrelated bugs happening at the same time.

@Teapot4195 Teapot4195 changed the title Access Denied Error when using x from both powershell and msys2 Access Denied Error when x.py tries to rebuild bootstrap Mar 26, 2023
@jyn514 jyn514 added the A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust label May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust O-windows Operating system: Windows T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

2 participants