From: Harish.Sadineni@windriver.com
To: openembedded-core@lists.openembedded.org
Cc: Randy.MacLeod@windriver.com, alistair.francis@wdc.com,
Sundeep.Kokkonda@windriver.com, bruce.ashfield@gmail.com,
richard.purdie@linuxfoundation.org, yoann.congal@smile.fr,
elmehdi.younes@smile.fr
Subject: [PATCH v3 02/16] rust: Install the Rust source
Date: Tue, 20 Jan 2026 09:52:32 -0800 [thread overview]
Message-ID: <20260120175246.2052341-3-Harish.Sadineni@windriver.com> (raw)
In-Reply-To: <20260120175246.2052341-1-Harish.Sadineni@windriver.com>
From: Alistair Francis <alistair.francis@wdc.com>
When building the Linux kernel with Rust support enabled the kernel
expects to find the Rust source as the kernel build system will cross
compile the core library.
This patch uses the Rust tooling to install the Rust source (of size ~50MB)
when we install the compiller as well.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
...-host-documentation-is-built-before-.patch | 60 +++++++++++++++++++
meta/recipes-devtools/rust/rust-source.inc | 1 +
meta/recipes-devtools/rust/rust_1.92.0.bb | 2 +
3 files changed, 63 insertions(+)
create mode 100644 meta/recipes-devtools/rust/files/0001-bootstrap-Ensure-host-documentation-is-built-before-.patch
diff --git a/meta/recipes-devtools/rust/files/0001-bootstrap-Ensure-host-documentation-is-built-before-.patch b/meta/recipes-devtools/rust/files/0001-bootstrap-Ensure-host-documentation-is-built-before-.patch
new file mode 100644
index 0000000000..3638e6078a
--- /dev/null
+++ b/meta/recipes-devtools/rust/files/0001-bootstrap-Ensure-host-documentation-is-built-before-.patch
@@ -0,0 +1,60 @@
+From 2e89bf7969ac6d77b7c6a38265b1eabc8ec6df7a Mon Sep 17 00:00:00 2001
+From: Alistair Francis <alistair.francis@...>
+Date: Fri, 9 Jan 2026 08:35:43 +1000
+Subject: [PATCH] bootstrap: Ensure host documentation is built before tarball
+ is created
+
+`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.
+
+Upstream-Status: Submitted [https://github.com/rust-lang/rust/pull/150845]
+Signed-off-by: Alistair Francis <alistair.francis@...>
+---
+ src/bootstrap/src/core/build_steps/dist.rs | 2 +-
+ src/bootstrap/src/core/builder/mod.rs | 5 +++++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
+index f47b0c0b007..2fbb068632e 100644
+--- a/src/bootstrap/src/core/build_steps/dist.rs
++++ b/src/bootstrap/src/core/build_steps/dist.rs
+@@ -83,7 +83,7 @@ fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
+ // 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();
+
+ let dest = "share/doc/rust/html";
+
+diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs
+index 4a04b97c549..16c1c324be0 100644
+--- a/src/bootstrap/src/core/builder/mod.rs
++++ b/src/bootstrap/src/core/builder/mod.rs
+@@ -1117,6 +1117,11 @@ pub fn execute_cli(&self) {
+ self.run_step_descriptions(&Builder::get_step_descriptions(self.kind), &self.paths);
+ }
+
++ /// Run all default documentation steps to build documentation.
++ pub fn run_host_default_doc_steps(&self) {
++ self.run_step_descriptions(&Builder::get_step_descriptions(Kind::Doc), &self.paths);
++ }
++
+ /// Run all default documentation steps to build documentation.
+ pub fn run_default_doc_steps(&self) {
+ self.run_step_descriptions(&Builder::get_step_descriptions(Kind::Doc), &[]);
+--
+2.52.0
+
diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc
index d7d44510e4..2c1caed858 100644
--- a/meta/recipes-devtools/rust/rust-source.inc
+++ b/meta/recipes-devtools/rust/rust-source.inc
@@ -8,6 +8,7 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n
file://0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch;patchdir=${RUSTSRC} \
file://revert-link-std-statically-in-rustc_driver-feature.patch;patchdir=${RUSTSRC} \
file://0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch;patchdir=${RUSTSRC} \
+ file://0001-bootstrap-Ensure-host-documentation-is-built-before-.patch;patchdir=${RUSTSRC} \
"
SRC_URI[rust.sha256sum] = "ebee170bfe4c4dfc59521a101de651e5534f4dae889756a5c97ca9ea40d0c307"
diff --git a/meta/recipes-devtools/rust/rust_1.92.0.bb b/meta/recipes-devtools/rust/rust_1.92.0.bb
index a25f65f674..af739df88a 100644
--- a/meta/recipes-devtools/rust/rust_1.92.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.92.0.bb
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=11a3899825f4376896e438c8c753f8dc"
inherit rust
inherit cargo_common
+inherit pkgconfig
DEPENDS += "llvm"
# native rust uses cargo/rustc from binary snapshots to bootstrap
@@ -282,6 +283,7 @@ do_install () {
rust_do_install() {
rust_runx install
+ rust_runx install src
}
rust_do_install:class-nativesdk() {
--
2.49.0
next prev parent reply other threads:[~2026-01-20 17:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 17:52 [PATCH v3 00/16] Enable rust support for linux kernel Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 01/16] linux-yocto: conditionally add clang/rust/bindgen-cli-native to DEPENDS Harish.Sadineni
2026-01-20 17:52 ` Harish.Sadineni [this message]
2026-01-20 18:01 ` Patchtest results for [PATCH v3 02/16] rust: Install the Rust source patchtest
2026-01-20 17:52 ` [PATCH v3 03/16] rust: install Rust library sources for target & sdk Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 04/16] kernel-yocto: enable Rust kernel support via 'make rustavailable' Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 05/16] linux-yocto: enable Rust support in kernel configuration Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 06/16] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 07/16] make-mod-scripts: split `HOSTCC` flag to align with to linux-yocto Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 08/16] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 09/16] kernel-devsrc: copying rust-kernel source to $kerneldir/build Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 10/16] selftest/cases/runtime_test: Add test for Linux Rust sample Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 11/16] kernel.bbclass: Copy include/config/auto.conf in STAGING_KERNEL_BUILDDIR Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 12/16] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 13/16] module.bbclass: Prepare out-of-tree rust module compilation Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 14/16] meta-skeleton: Add rust-out-of-tree-module recipe Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 15/16] make-mod-scripts: fix for buildpath issues with rust-out-of-tree compilation Harish.Sadineni
2026-01-20 17:52 ` [PATCH v3 16/16] runtime_test: Add rust-out-of-tree selftest Harish.Sadineni
2026-01-20 18:00 ` [PATCH v3 00/16] Enable rust support for linux kernel Sadineni, Harish
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260120175246.2052341-3-Harish.Sadineni@windriver.com \
--to=harish.sadineni@windriver.com \
--cc=Randy.MacLeod@windriver.com \
--cc=Sundeep.Kokkonda@windriver.com \
--cc=alistair.francis@wdc.com \
--cc=bruce.ashfield@gmail.com \
--cc=elmehdi.younes@smile.fr \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.org \
--cc=yoann.congal@smile.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox