Skip to content

Conversation

@alistair23
Copy link
Contributor

run_default_doc_steps() is called to ensure the documentation is built by Docs::run() and it should build the documentation if it isn't already built.

When running the install src command I'm seeing failures as the builder.doc_out(host) directory does not exist. This is because match_paths_to_steps_and_run() doesn't actually build any documentation as the paths.is_empty() causes an early return. This results in install failures as the */doc src directory doesn't exist.

This patch passes the paths to run_step_descriptions() when building documentation to ensure it is correctly built.

This fixes installing the Rust source code in OpenEmbedded.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jan 8, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 8, 2026

r? @Zalathar

rustbot has assigned @Zalathar.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

`run_default_doc_steps()` is called to ensure the documentation is built
by `Docs::run()` and it should build the documentation if it isn't
already built.

When running the `install src` command I'm seeing failures as the
`builder.doc_out(host)` directory does not exist. This is because
`match_paths_to_steps_and_run()` doesn't actually build any
documentation as the `paths.is_empty()` causes an early return. This
results in install failures as the `*/doc` src directory doesn't exist.

This patch passes the paths to `run_host_step_descriptions()` when building
documentation to ensure it is correctly built.

This fixes installing the Rust source code in OpenEmbedded.

Signed-off-by: Alistair Francis <[email protected]>
@alistair23 alistair23 force-pushed the alistair/doc-build-fixup branch from e2ed364 to 2e89bf7 Compare January 9, 2026 00:35
@Zalathar
Copy link
Member

Zalathar commented Jan 9, 2026

r? bootstrap

@rustbot rustbot assigned jieyouxu and unassigned Zalathar Jan 9, 2026
@jieyouxu
Copy link
Member

@alistair23 can you say more on:

  • What's the cli invocation you used, and
  • What configuration you had?

I'm trying to see if it's possible to snapshot the doc steps that ./x install src triggers on default.

@alistair23
Copy link
Contributor Author

@alistair23 can you say more on:

* What's the cli invocation you used, and

* What configuration you had?

I'm trying to see if it's possible to snapshot the doc steps that ./x install src triggers on default.

It's part of the OpenEmbedded build system, so it isn't super easy to split out a simple reproducible test case.

It's calling

./x install
./x install src

This is my config.toml

# EXTRA_OECARGO_PATHS
paths = [

]

# Local mirror vendored by bitbake
[source.bitbake]
directory = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/cargo-native/1.92.0/sources/rustc-1.92.0-src/vendor"

[source.crates-io]
replace-with = "bitbake"
local-registry = "/nonexistent"

[http]
# Multiplexing can't be enabled because http2 can't be enabled
# in curl-native without dependency loops
multiplexing = false

# Ignore the hard coded and incorrect path to certificates
cainfo = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/cargo-native/1.92.0/recipe-sysroot-native/etc/ssl/certs/ca-certificates.crt"


# HOST_SYS
[target.x86_64-unknown-linux-gnu]
linker = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/cargo-native/1.92.0/wrapper/target-rust-ccld"

[build]
# Use out of tree build destination to avoid polluting the source tree
target-dir = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/cargo-native/1.92.0/build/target"

[term]
progress.when = 'always'
progress.width = 80

@jieyouxu
Copy link
Member

(I meant the bootstrap config, be it bootstrap.toml or env var / bootstrap flags, not the cargo config, should've been more clear)

@alistair23
Copy link
Contributor Author

(I meant the bootstrap config, be it bootstrap.toml or env var / bootstrap flags, not the cargo config, should've been more clear)

Whoops, wrong file.

If I copy these out from OE I can bootsrap Rust independently

config.toml

change-id = 116881

[target.x86_64-unknown-linux-gnu]
llvm-config = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/recipe-sysroot-native/usr/bin/llvm-config"
cxx = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/wrapper/target-rust-cxx"
cc = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/wrapper/target-rust-cc"
linker = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/wrapper/target-rust-ccld"

[llvm]
static-libstdcpp = false
download-ci-llvm = false

[rust]
rpath = true
remap-debuginfo = true
download-rustc = false
llvm-tools = false
lld = false
use-lld = false
channel = "stable"
optimize = true
verbose-tests = true

[build]
submodules = false
docs = false
rustc = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/rust-snapshot/bin/rustc"
cargo = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/rust-snapshot/bin/cargo"
extended = false
vendor = true
target = ["x86_64-unknown-linux-gnu"]
host = ["x86_64-unknown-linux-gnu"]
build = "x86_64-unknown-linux-gnu"

[install]
prefix = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/image/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/recipe-sysroot-native/usr"
bindir = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/image/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/recipe-sysroot-native/usr/bin"
libdir = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/image/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/recipe-sysroot-native/usr/lib"
datadir = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/image/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/recipe-sysroot-native/usr/share"
mandir = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/image/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/recipe-sysroot-native/usr/share/man"
sysconfdir = "/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/image/var/mnt/scratch/alistair/yocto/oe-master/build/tmp/work/x86_64-linux/rust-native/1.92.0/recipe-sysroot-native/etc"

.cargo/config.toml

[source.crates-io]
replace-with = "vendored-sources"

[source."git+https://github.com/rust-lang/team"]
git = "https://github.com/rust-lang/team"
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"

But that doesn't reproduce the issue. I'm not clear on what the difference is between the OE build environment and a standalone one which triggers the issue

@jieyouxu
Copy link
Member

That feels a bit surprising, is OE using the same build == host == target setup?

@jyn514
Copy link
Member

jyn514 commented Jan 15, 2026

We saw a failure like this in Ferrocene and the root cause was that we had run x dist —-host=, which disables all Steps that are marked HOST_ONLY = false. Maybe OE did the same?

@jieyouxu
Copy link
Member

Oh, interesting, that isn't a possibility I considered 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants