Skip to content

build: bootstrap fails when using --enable-local-rust option #109103

New issue

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

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

Already on GitHub? # to your account

Closed
filnet opened this issue Mar 13, 2023 · 7 comments · Fixed by #109111
Closed

build: bootstrap fails when using --enable-local-rust option #109103

filnet opened this issue Mar 13, 2023 · 7 comments · Fixed by #109111
Assignees
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. requires-custom-config This issue requires custom config/build for rustc in some way T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Milestone

Comments

@filnet
Copy link

filnet commented Mar 13, 2023

Issue

Building rust with the --enable-local-rust option fails with a symbolic link creation error.

Reverting 6f0fc2f fixes the issue.

Version it worked on

It most recently worked on: Rust 1.67.1

Version with regression

Rust 1.68.0

Backtrace

Backtrace

thread 'main' panicked at 'symlink_dir(C:\M\mingw-w64-rust\src\MINGW64\build\host => C:\M\mingw-w64-rust\src\MINGW64\build\x86_64-pc-windows-gnu) failed with Le fichier spécifié est introuvable. (os error 2)', lib.rs:599:17
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: bootstrap::Build::new
             at C:\M\mingw-w64-rust\src\rustc-1.68.0-src\src\bootstrap\lib.rs:599:17
   3: bootstrap::main
             at C:\M\mingw-w64-rust\src\rustc-1.68.0-src\src\bootstrap\bin\main.rs:50:5
   4: core::ops::function::FnOnce::call_once
             at C:\M\mingw-w64-rust\src\rustc-1.67.1-src\library\core\src\ops\function.rs:507:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Build completed unsuccessfully in 0:00:32

@filnet filnet added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Mar 13, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Mar 13, 2023
@Teapot4195
Copy link
Contributor

Teapot4195 commented Mar 13, 2023

@rustbot label +t-bootstrap

Edit: how very convenient, wasn't even aware there was limitations on label, either way, does this issue occur with x86_64-windows-msvc.

@rustbot
Copy link
Collaborator

rustbot commented Mar 13, 2023

Error: Label t-bootstrap can only be set by Rust team members

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@jyn514 jyn514 added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Mar 13, 2023
@filnet
Copy link
Author

filnet commented Mar 13, 2023

does this issue occur with x86_64-windows-msvc.

I am one of the maintainers of the Rust build at https://www.msys2.org/.

The upgrade from 1.67.1 to 1.68.0 broke the aarch64 build (which uses the --enable-local-rust option).
We can also reproduce it on other architectures and tool chains.

@jyn514
Copy link
Member

jyn514 commented Mar 13, 2023

I ... don't see how this could be related to --enable-local-rust? we're not modifying anything in the stage 0 directory, only in the build directory. do you still see this issue if you remove that option?

@jyn514
Copy link
Member

jyn514 commented Mar 13, 2023

oh I see, when that option is enabled bootstrap.py doesn't download the toolchain and so there's no x86_64-pc-windows-gnu folder yet. the correct fix is to add create_dir_all(&build_triple) just after

let build_triple = build.out.join(&build.build.triple);

@jyn514 jyn514 added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. and removed regression-untriaged Untriaged performance or correctness regression. labels Mar 13, 2023
@jyn514 jyn514 added this to the 1.68.0 milestone Mar 13, 2023
@filnet
Copy link
Author

filnet commented Mar 13, 2023

I ... don't see how this could be related to --enable-local-rust? we're not modifying anything in the stage 0 directory, only in the build directory. do you still see this issue if you remove that option?

Using --enable-local-rust will skip downloading and extracting the previous Rust version.
The new code tries to create a symlink from host to a directory that was supposedly extracted (but was not).

There is the same issue with --local-rust-root btw.

@jyn514 jyn514 added the requires-custom-config This issue requires custom config/build for rustc in some way label Mar 13, 2023
@mu001999
Copy link
Contributor

@rustbot claim

@bors bors closed this as completed in d133c36 Mar 15, 2023
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Mar 15, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. requires-custom-config This issue requires custom config/build for rustc in some way T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants