rust: reproducibility issue fix

The '--remap-path-prefix' option removes all references to build directory
structure in the debug information within the compiled output for Cargo
dependencies and the project's binary.

However, some references to build directories remains in the final binary
in .rustc section in the form of compressed metadata and this makes the
build output dependent on the folder structure of the computer it's compiled on.

So, for reproducible builds, use the configuration option
'remap-debuginfo = true' along with the '--remap-path-prefix'.

[YOCTO# 14875]

(From OE-Core rev: 6ae62259afbbe861ed74211dab18a27b8c8d8b7a)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Sundeep KOKKONDA
2023-10-10 21:05:50 -07:00
committed by Richard Purdie
parent c2e094ddfd
commit b36cbd3f2b
2 changed files with 1 additions and 2 deletions

View File

@@ -16,8 +16,6 @@ import os
import datetime
exclude_packages = [
'rust',
'rust-dbg'
]
def is_excluded(package):

View File

@@ -130,6 +130,7 @@ python do_configure() {
# [rust]
config.add_section("rust")
config.set("rust", "rpath", e(True))
config.set("rust", "remap-debuginfo", e(True))
config.set("rust", "channel", e(d.expand("${RUST_CHANNEL}")))
# Whether or not to optimize the compiler and standard library