* [PATCH v2] rust: Install the Rust source
@ 2026-03-05 5:36 alistair23
2026-03-05 19:34 ` Varatharajan, Deepesh
0 siblings, 1 reply; 2+ messages in thread
From: alistair23 @ 2026-03-05 5:36 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>
---
v2:
- Update patch with new upstream submission
...l-fix-for-.-x-install-src-with-build.patch | 45 +++++++++++++++++++
meta/recipes-devtools/rust/rust-source.inc | 1 +
meta/recipes-devtools/rust/rust_1.93.0.bb | 4 +-
3 files changed, 49 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-devtools/rust/files/0001-bootstrap-minimal-fix-for-.-x-install-src-with-build.patch
diff --git a/meta/recipes-devtools/rust/files/0001-bootstrap-minimal-fix-for-.-x-install-src-with-build.patch b/meta/recipes-devtools/rust/files/0001-bootstrap-minimal-fix-for-.-x-install-src-with-build.patch
new file mode 100644
index 0000000000..aeb59ff567
--- /dev/null
+++ b/meta/recipes-devtools/rust/files/0001-bootstrap-minimal-fix-for-.-x-install-src-with-build.patch
@@ -0,0 +1,45 @@
+From e26974ca33aa322bbc60db5d1010899e40f6d624 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: minimal fix for ./x install src with build.docs =
+ false
+
+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 ensures that the builder.doc_out(host) directory exists.
+
+This fixes installing the Rust source when `build.docs = false`.
+
+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>
+Signed-off-by: Jieyou Xu <jieyouxu@outlook.com>
+---
+ src/bootstrap/src/core/build_steps/dist.rs | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
+index 2e291f7c2c3..28a7afd6c61 100644
+--- a/src/bootstrap/src/core/build_steps/dist.rs
++++ b/src/bootstrap/src/core/build_steps/dist.rs
+@@ -87,6 +87,12 @@ fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
+ // from a shared directory.
+ builder.run_default_doc_steps();
+
++ // In case no default doc steps are run for host, it is possible that `<host>/doc` directory
++ // is never created.
++ if !builder.config.dry_run() {
++ t!(fs::create_dir_all(builder.doc_out(host)));
++ }
++
+ let dest = "share/doc/rust/html";
+
+ let mut tarball = Tarball::new(builder, "rust-docs", &host.triple);
+--
+2.53.0
+
diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc
index 514f3fec1e..65c6dc2857 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-minimal-fix-for-.-x-install-src-with-build.patch;patchdir=${RUSTSRC} \
"
SRC_URI[rust.sha256sum] = "e30d898272c587a22f77679f03c5e8192b5645c7c9ccc3407ad1106761507cea"
diff --git a/meta/recipes-devtools/rust/rust_1.93.0.bb b/meta/recipes-devtools/rust/rust_1.93.0.bb
index 2be0bd8d89..9c3efc7453 100644
--- a/meta/recipes-devtools/rust/rust_1.93.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.93.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"
@@ -284,6 +285,7 @@ do_install () {
rust_do_install() {
rust_runx install
+ rust_runx install src
}
rust_do_install:class-nativesdk() {
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] rust: Install the Rust source
2026-03-05 5:36 [PATCH v2] rust: Install the Rust source alistair23
@ 2026-03-05 19:34 ` Varatharajan, Deepesh
0 siblings, 0 replies; 2+ messages in thread
From: Varatharajan, Deepesh @ 2026-03-05 19:34 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 657 bytes --]
On Thu, Mar 5, 2026 at 11:06 AM, Alistair Francis wrote:
>
> +inherit pkgconfig
>
> -DEPENDS += "llvm"
> +DEPENDS += "llvm openssl"
Hi Alistair,
As you already know, there is an ongoing series of patches to enable Rust
support in the kernel. The latest version of this series can be found here:
https://lists.openembedded.org/g/openembedded-core/topic/patch_v7_00_14_enable_rust/118136908
With the newest version, the relevant changes are now controlled via the
KERNEL_RUST_SUPPORT variable. Therefore, instead of introducing additional
dependencies directly, Can you make it optional by using the same variable.
Regards,
Deepesh
[-- Attachment #2: Type: text/html, Size: 919 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-05 19:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05 5:36 [PATCH v2] rust: Install the Rust source alistair23
2026-03-05 19:34 ` Varatharajan, Deepesh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox