diff mbox series

rust: rustdoc reproducibility issue fix

Message ID 20231220104020.1837836-1-sundeep.kokkonda@windriver.com
State New
Headers show
Series rust: rustdoc reproducibility issue fix | expand

Commit Message

Sundeep KOKKONDA Dec. 20, 2023, 10:40 a.m. UTC
From: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>

The PGO (Profile-guided Optimization) collect data about the typical execution of a program and then use this data to inform optimizations such as inlining, machine-code layout, register allocation, etc.
This optimization is by default disabled in rust sources but enabled in Yocto and causing the issue in rustdoc binary. To fix the issue this optimization is set to it's default 'false'.
More about the optimization: https://doc.rust-lang.org/rustc/profile-guided-optimization.html

Reverted commit #3e50e45917 "rust: Split rustdoc into a separate package"

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
---
 meta/lib/oeqa/selftest/cases/reproducible.py | 2 --
 meta/recipes-devtools/rust/rust_1.71.1.bb    | 7 +++----
 2 files changed, 3 insertions(+), 6 deletions(-)

Comments

Sundeep KOKKONDA Dec. 20, 2023, 10:42 a.m. UTC | #1
Testing done with arm, arm64, x86 & x86_64 arch's.
Below combinations are tested.
- Tested the issue by reproducing and fixing it with the patch,
- with oe-selftest,
- Builds b/w different commits,
- with shared sstate b/w the builds.
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index 14ccb0b24d..80e830136f 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -16,8 +16,6 @@  import os
 import datetime
 
 exclude_packages = [
-	'rust-rustdoc',
-	'rust-dbg'
 	]
 
 def is_excluded(package):
diff --git a/meta/recipes-devtools/rust/rust_1.71.1.bb b/meta/recipes-devtools/rust/rust_1.71.1.bb
index 3d176e54c1..a0e9316cfd 100644
--- a/meta/recipes-devtools/rust/rust_1.71.1.bb
+++ b/meta/recipes-devtools/rust/rust_1.71.1.bb
@@ -141,13 +141,14 @@  python do_configure() {
     config.add_section("build")
     config.set("build", "submodules", e(False))
     config.set("build", "docs", e(False))
+    config.set("build", "tools", ["rust-demangler",])
 
     rustc = d.expand("${WORKDIR}/rust-snapshot/bin/rustc")
     config.set("build", "rustc", e(rustc))
 
     # Support for the profiler runtime to generate e.g. coverage report,
     # PGO etc.
-    config.set("build", "profiler", e(True))
+    config.set("build", "profiler", e(False))
 
     cargo = d.expand("${WORKDIR}/rust-snapshot/bin/cargo")
     config.set("build", "cargo", e(cargo))
@@ -225,11 +226,9 @@  do_test_compile () {
 
 ALLOW_EMPTY:${PN} = "1"
 
-PACKAGES =+ "${PN}-rustdoc ${PN}-tools-clippy ${PN}-tools-rustfmt"
-FILES:${PN}-rustdoc = "${bindir}/rustdoc"
+PACKAGES =+ "${PN}-tools-clippy ${PN}-tools-rustfmt"
 FILES:${PN}-tools-clippy = "${bindir}/cargo-clippy ${bindir}/clippy-driver"
 FILES:${PN}-tools-rustfmt = "${bindir}/rustfmt"
-RDEPENDS:${PN}-rustdoc = "${PN}"
 RDEPENDS:${PN}-tools-clippy = "${PN}"
 RDEPENDS:${PN}-tools-rustfmt = "${PN}"