bootstrap: Ensure documentation is built before tarball is created#150845
bootstrap: Ensure documentation is built before tarball is created#150845alistair23 wants to merge 1 commit intorust-lang:mainfrom
Conversation
This comment has been minimized.
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 <alistair.francis@wdc.com>
e2ed364 to
2e89bf7
Compare
|
r? bootstrap |
|
@alistair23 can you say more on:
I'm trying to see if it's possible to snapshot the doc steps that |
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 srcThis is my # 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 |
|
(I meant the bootstrap config, be it |
| // FIXME: explicitly enumerate the steps that should be executed here, and gather their | ||
| // documentation, rather than running all default steps and then read their output | ||
| // from a shared directory. | ||
| builder.run_default_doc_steps(); | ||
| builder.run_host_default_doc_steps(); |
There was a problem hiding this comment.
cc @Kobzol (do you remember any more context about the default doc steps here?)
There was a problem hiding this comment.
Just that we should eventually get rid of this cursed function and explicitly enumerate the Doc steps to run.. 😆
Whoops, wrong file. If I copy these out from OE I can bootsrap Rust independently config.toml .cargo/config.toml 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 |
|
That feels a bit surprising, is OE using the same |
|
We saw a failure like this in Ferrocene and the root cause was that we had run |
|
Oh, interesting, that isn't a possibility I considered 👀 |
I would really appreciate a reproducible configuration here, it doesn't need to be minimal. I cannot reproduce this issue locally at all. The change itself feels like the wrong fix to me, because:
I would look into alternative approaches, except, I cannot validate any changes because I cannot reproduce this, at all. @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
Ok! I can reproduce it now. $ git show
commit ded5c06cf21d2b93bffd5d884aa6e96934ee4234 (HEAD, tag: 1.92.0, origin/stable)
Merge: 112a4af313b 2f2f518819d
Author: bors <bors@rust-lang.org>
Date: Mon Dec 8 12:52:32 2025 +0000
Auto merge of #149758 - BoxyUwU:stable, r=BoxyUwU
[stable] prepare Rust 1.92.0
r? `@ghost`$ cat config.toml
change-id = 116881
[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
extended = false
target = ["x86_64-unknown-linux-gnu"]
host = ["x86_64-unknown-linux-gnu"]
build = "x86_64-unknown-linux-gnu"
[install]
prefix = "/scratch/alistair/software/tier4/rust-lang/rust/tmp/usr"
bindir = "/scratch/alistair/software/tier4/rust-lang/rust/tmp/usr/bin"
libdir = "/scratch/alistair/software/tier4/rust-lang/rust/tmp/usr/lib"
datadir = "/scratch/alistair/software/tier4/rust-lang/rust/tmp/usr/share"
mandir = "/scratch/alistair/software/tier4/rust-lang/rust/tmp/usr/share/man"
sysconfdir = "/scratch/alistair/software/tier4/rust-lang/rust/tmp/etc"$ git status
HEAD detached at 1.92.0
nothing to commit, working tree clean$ python3 src/bootstrap/bootstrap.py -j 30 install --verbose
...
$ python3 src/bootstrap/bootstrap.py -j 30 install src --verbose
...
thread 'main' (1617571) panicked at src/bootstrap/src/lib.rs:1991:25:
could not read dir "/var/mnt/scratch/alistair/software/tier4/rust-lang/rust/build/x86_64-unknown-linux-gnu/doc": Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
File "/var/mnt/scratch/alistair/software/tier4/rust-lang/rust/src/bootstrap/bootstrap.py", line 1431, in <module>
main()
~~~~^^
File "/var/mnt/scratch/alistair/software/tier4/rust-lang/rust/src/bootstrap/bootstrap.py", line 1410, in main
bootstrap(args)
~~~~~~~~~^^^^^^
File "/var/mnt/scratch/alistair/software/tier4/rust-lang/rust/src/bootstrap/bootstrap.py", line 1370, in bootstrap
run(args, env=env, verbose=build.verbose, is_bootstrap=True)
~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/mnt/scratch/alistair/software/tier4/rust-lang/rust/src/bootstrap/bootstrap.py", line 237, in run
raise RuntimeError(err)
RuntimeError: failed to run: /var/mnt/scratch/alistair/software/tier4/rust-lang/rust/build/bootstrap/debug/bootstrap -j 30 install src --verbose |
|
The seems to be the cause |
|
@alistair23 in #152840 I'm adding some baseline path filter / step resolution snapshot tests This current change in this PR changes the step resolutions quite substantially (see below). The step resolutions esp. for Can you try if something way more minimal like https://github.com/jieyouxu/rust/tree/refs/heads/bootstrap-install-src-no-docs-min-fix is sufficient to get you past the failure? For context, the bootstrap team does intend to look at the step / path filter resolution situation in more detail, so I'd like to avoid substantial step resolution changes ATM as well. @rustbot author Snapshot for
|
…docs, r=clubby789
Add bootstrap snapshot tests for {`install`, `install src`}
And `install src` with `build.docs = false`.
This is mostly to get coverage for the baseline to make it easier to review rust-lang#150845.
…docs, r=clubby789
Add bootstrap snapshot tests for {`install`, `install src`}
And `install src` with `build.docs = false`.
This is mostly to get coverage for the baseline to make it easier to review rust-lang#150845.
…docs, r=clubby789
Add bootstrap snapshot tests for {`install`, `install src`}
And `install src` with `build.docs = false`.
This is mostly to get coverage for the baseline to make it easier to review rust-lang#150845.
run_default_doc_steps()is called to ensure the documentation is built byDocs::run()and it should build the documentation if it isn't already built.When running the
install srccommand I'm seeing failures as thebuilder.doc_out(host)directory does not exist. This is becausematch_paths_to_steps_and_run()doesn't actually build any documentation as thepaths.is_empty()causes an early return. This results in install failures as the*/docsrc 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.