Skip to content

Commit

Permalink
Rollup merge of rust-lang#137119 - onur-ozkan:fix-broken-core, r=jiey…
Browse files Browse the repository at this point in the history
…ouxu

fix broken `x {doc, build} core`

Fixes rust-lang#137115
  • Loading branch information
GuillaumeGomez authored Feb 16, 2025
2 parents 0c3dcae + 56f8f48 commit 0a867e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Step for Std {
const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.crate_or_deps("sysroot").path("library").alias("core")
run.crate_or_deps("sysroot").path("library")
}

#[cfg_attr(feature = "tracing", instrument(level = "trace", name = "Std::make_run", skip_all))]
Expand Down
5 changes: 1 addition & 4 deletions src/bootstrap/src/core/build_steps/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,7 @@ impl Step for Std {

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
run.crate_or_deps("sysroot")
.path("library")
.alias("core")
.default_condition(builder.config.docs)
run.crate_or_deps("sysroot").path("library").default_condition(builder.config.docs)
}

fn make_run(run: RunConfig<'_>) {
Expand Down
12 changes: 8 additions & 4 deletions src/bootstrap/src/core/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,14 @@ impl RunConfig<'_> {
pub fn cargo_crates_in_set(&self) -> Vec<String> {
let mut crates = Vec::new();
for krate in &self.paths {
let path = krate.assert_single_path();
let Some(crate_name) = self.builder.crate_paths.get(&path.path) else {
panic!("missing crate for path {}", path.path.display())
};
let path = &krate.assert_single_path().path;

let crate_name = self
.builder
.crate_paths
.get(path)
.unwrap_or_else(|| panic!("missing crate for path {}", path.display()));

crates.push(crate_name.to_string());
}
crates
Expand Down

0 comments on commit 0a867e6

Please sign in to comment.