From 706d600232f783c41ece4a0f368ed806cbc57582 Mon Sep 17 00:00:00 2001 From: Jynn Nelson Date: Tue, 28 Oct 2025 13:04:02 -0400 Subject: [PATCH] bootstrap: `ensure(doc::Std)` no longer opens a browser In general, the rationale for `--open` is to only open HTML files if they were "explicitly" invoked from the CLI (e.g. `x doc --open library/core`). The existing logic did not do that. Instead it opened the docs unconditionally when a subset of the crates was requested. This is unfortunate for other Steps in bootstrap, which may wish to `ensure()` the standard library docs without opening them. Change `Std` to check if it was explicitly invoked, rather than assuming it's the case. --- src/bootstrap/src/core/build_steps/doc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index 70a9bcf38c0f7..6622aae069d5c 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -709,12 +709,12 @@ impl Step for Std { if builder.paths.iter().any(|path| path.ends_with("library")) { // For `x.py doc library --open`, open `std` by default. let index = out.join("std").join("index.html"); - builder.open_in_browser(index); + builder.maybe_open_in_browser::(index); } else { for requested_crate in crates { if STD_PUBLIC_CRATES.iter().any(|&k| k == requested_crate) { let index = out.join(requested_crate).join("index.html"); - builder.open_in_browser(index); + builder.maybe_open_in_browser::(index); break; } }