All of lore.kernel.org
 help / color / mirror / Atom feed
* [OE-Core][PATCH 1/2] rust: Install the Rust source
@ 2026-01-09  4:54 alistair23
  2026-01-09  4:54 ` [OE-Core][PATCH 2/2] cml1.bbclass: Support the rustavailable task alistair23
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: alistair23 @ 2026-01-09  4:54 UTC (permalink / raw)
  To: openembedded-core; +Cc: alistair23, Alistair Francis

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 when we
install the compiller as well.

Signed-off-by: Alistair Francis <alistair.francis@wdc.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     |  4 +-
 3 files changed, 64 insertions(+), 1 deletion(-)
 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..e561266d70
--- /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@wdc.com>
+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@wdc.com>
+---
+ 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..8a22d484c1 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 \
 "
 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..306661b6e4 100644
--- a/meta/recipes-devtools/rust/rust_1.92.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.92.0.bb
@@ -6,8 +6,9 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=11a3899825f4376896e438c8c753f8dc"
 
 inherit rust
 inherit cargo_common
+inherit pkgconfig
 
-DEPENDS += "llvm"
+DEPENDS += "llvm openssl"
 # native rust uses cargo/rustc from binary snapshots to bootstrap
 # but everything else should use our native builds
 DEPENDS:append:class-target = " cargo-native rust-native"
@@ -282,6 +283,7 @@ do_install () {
 
 rust_do_install() {
     rust_runx install
+    rust_runx install src
 }
 
 rust_do_install:class-nativesdk() {
-- 
2.52.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-01-12  1:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-09  4:54 [OE-Core][PATCH 1/2] rust: Install the Rust source alistair23
2026-01-09  4:54 ` [OE-Core][PATCH 2/2] cml1.bbclass: Support the rustavailable task alistair23
2026-01-09 13:56   ` Bruce Ashfield
     [not found]   ` <188914A07F2508FF.2783356@lists.openembedded.org>
2026-01-09 13:59     ` Bruce Ashfield
2026-01-12  1:06       ` Alistair Francis
2026-01-09 10:25 ` [OE-Core][PATCH 1/2] rust: Install the Rust source Mathieu Dubois-Briand
2026-01-12  0:09   ` Alistair Francis
2026-01-09 10:46 ` Yoann Congal
2026-01-12  0:08   ` Alistair Francis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.