Skip to content

Commit 97962d7

Browse files
authored
Rollup merge of rust-lang#137073 - niklaskorz:bootstrap-doc-fix-empty-no-std, r=clubby789
boostrap: skip no_std targets in Std doc step This fixes a bug that currently prevents us from adding no_std library targets to rustc in nixpkgs (NixOS/nixpkgs#382166). When running `./x.py doc`, the `Std` doc step generally fails for no_std targets, logs: https://gist.github.com/niklaskorz/fb83f9503ce19b75e8b1af02cdebd592 Skipping no_std targets in this step will allow using no_std targets such as `bpfel-unknown-none` together with other targets in the same config without blocking the doc generator for them, e.g. ``` ./configure --release-channel=stable --tools=rustc,rustdoc,rust-analyzer-proc-macro-srv --build=aarch64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin,bpfel-unknown-none ./x.py doc ``` Logs with this fix applied: https://gist.github.com/niklaskorz/cdd50aaea33ede579f737434286d800b
2 parents 48543dd + ea10f8e commit 97962d7

File tree

1 file changed

+4
-0
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+4
-0
lines changed

Diff for: src/bootstrap/src/core/build_steps/doc.rs

+4
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,10 @@ impl Step for Std {
577577

578578
fn make_run(run: RunConfig<'_>) {
579579
let crates = compile::std_crates_for_run_make(&run);
580+
let target_is_no_std = run.builder.no_std(run.target).unwrap_or(false);
581+
if crates.is_empty() && target_is_no_std {
582+
return;
583+
}
580584
run.builder.ensure(Std {
581585
stage: run.builder.top_stage,
582586
target: run.target,

0 commit comments

Comments
 (0)