* [PATCH v2] rust: Avoid passing host-specific information to crates Strict Version Hash
@ 2026-08-24 23:56 Alejandro Hernandez
2026-08-25 18:48 ` [OE-core] " Mathieu Dubois-Briand
0 siblings, 1 reply; 4+ messages in thread
From: Alejandro Hernandez @ 2026-08-24 23:56 UTC (permalink / raw)
To: openembedded-core
rustc computes each crate's Strict Version Hash (SVH) using inputs that include
the *stage0/stage1 bootstrap compiler* fingerprint, which in turn depends on the
build host arch.
This eventually may cause sstate matches across architectures for artifacts that
are actually different, causing autobuilder intermitent reproducibility issues.
To avoid this, pass a fixed value instead of host-specific bits to the specified
hash.
[YOCTO #15554]
Assisted-by: AI - OpenAI
Signed-off-by: Alejandro Hernandez <alhe@linux.microsoft.com>
---
...ide-cfg-version-from-stable-crate-id.patch | 20 +++++++++++++++++++
meta/recipes-devtools/rust/rust-source.inc | 1 +
2 files changed, 21 insertions(+)
create mode 100644 meta/recipes-devtools/rust/files/0003-rustc-span-add-oe-knob-to-elide-cfg-version-from-stable-crate-id.patch
diff --git a/meta/recipes-devtools/rust/files/0003-rustc-span-add-oe-knob-to-elide-cfg-version-from-stable-crate-id.patch b/meta/recipes-devtools/rust/files/0003-rustc-span-add-oe-knob-to-elide-cfg-version-from-stable-crate-id.patch
new file mode 100644
index 0000000000..8409d49bbe
--- /dev/null
+++ b/meta/recipes-devtools/rust/files/0003-rustc-span-add-oe-knob-to-elide-cfg-version-from-stable-crate-id.patch
@@ -0,0 +1,20 @@
+rust: Avoid passing host-dependent fingerprint to build artifacts
+
+To fix reproducibility issues, pass a fixed value instead of passing a
+host-dependent fingerprint to the rust build artifacts via the Strict
+Version Hash (SVH)
+
+Upstream-Status: Inappropriate [OE-specific reproducibility policy]
+Signed-off-by: Alejandro Hernandez <alhe@linux.microsoft.com>
+---
+--- a/compiler/rustc_span/src/def_id.rs
++++ b/compiler/rustc_span/src/def_id.rs
+@@ -186,5 +186,3 @@
+- if let Some(val) = std::env::var_os("RUSTC_FORCE_RUSTC_VERSION") {
+- hasher.write(val.to_string_lossy().into_owned().as_bytes())
+- } else {
+- hasher.write(cfg_version.as_bytes())
+- }
++ // OE reproducible builds use a fixed value so host-varying bootstrap
++ // fingerprints do not perturb StableCrateId.
++ hasher.write(b"oe-stable-crate-id-no-cfg-version")
diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc
index 68f3009a7b..2bff69de3d 100644
--- a/meta/recipes-devtools/rust/rust-source.inc
+++ b/meta/recipes-devtools/rust/rust-source.inc
@@ -6,6 +6,7 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n
file://repro-issue-fix-with-cc-crate-hashmap.patch;patchdir=${RUSTSRC} \
file://0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch;patchdir=${RUSTSRC} \
file://0002-Fix-rust-build-failure-with-unstable-options.patch;patchdir=${RUSTSRC} \
+ file://0003-rustc-span-add-oe-knob-to-elide-cfg-version-from-stable-crate-id.patch;patchdir=${RUSTSRC} \
"
SRC_URI[rust.sha256sum] = "0ed06fdaffd4722a7702e0b4eebfafc897ab8f513e8e1b247cdd7e5c6df6ded2"
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [OE-core] [PATCH v2] rust: Avoid passing host-specific information to crates Strict Version Hash
2026-08-24 23:56 [PATCH v2] rust: Avoid passing host-specific information to crates Strict Version Hash Alejandro Hernandez
@ 2026-08-25 18:48 ` Mathieu Dubois-Briand
2026-08-25 20:13 ` Alejandro Hernandez
[not found] ` <18CF258177A95B06.3360474@lists.openembedded.org>
0 siblings, 2 replies; 4+ messages in thread
From: Mathieu Dubois-Briand @ 2026-08-25 18:48 UTC (permalink / raw)
To: alhe, openembedded-core
On Tue Aug 25, 2026 at 1:56 AM CEST, Alejandro Hernandez Samaniego via lists.openembedded.org wrote:
> rustc computes each crate's Strict Version Hash (SVH) using inputs that include
> the *stage0/stage1 bootstrap compiler* fingerprint, which in turn depends on the
> build host arch.
>
> This eventually may cause sstate matches across architectures for artifacts that
> are actually different, causing autobuilder intermitent reproducibility issues.
>
> To avoid this, pass a fixed value instead of host-specific bits to the specified
> hash.
>
> [YOCTO #15554]
>
> Assisted-by: AI - OpenAI
> Signed-off-by: Alejandro Hernandez <alhe@linux.microsoft.com>
Hi Alejandro,
This looks broken here:
ERROR: rust-native-1.97.1-r0 do_install: Execution of '/srv/pokybuild/yocto-worker/genericx86-64/build/build/tmp/work/x86_64-linux/rust-native/1.97.1/temp/run.do_install.2682640' failed with exit code 1
...
ERROR: Logfile of failure stored in: /srv/pokybuild/yocto-worker/genericx86-64/build/build/tmp/work/x86_64-linux/rust-native/1.97.1/temp/log.do_install.2682640
...
| Building [==================> ] 275/348: object, schemars, tracing-s…
| Compiling rustc_span v0.0.0 (/srv/pokybuild/yocto-worker/genericx86-64/build/build/tmp/work-shared/rust-source-1.97.1-r0/sources/rustc-1.97.1-src/compiler/rustc_span)
| Building [==================> ] 276/348: object, schemars, tracing-s…
| error: expected `;`, found `StableCrateId`
| --> /rustc-dev/8bab26f4f68e0e26f0bb7960be334d5b520ea452/compiler/rustc_span/src/def_id.rs:200:59
| |
| 200 | hasher.write(b"
https://autobuilder.yoctoproject.org/valkyrie/#/builders/4/builds/4510
Can you have a look at the issue?
Thanks,
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [OE-core] [PATCH v2] rust: Avoid passing host-specific information to crates Strict Version Hash
2026-08-25 18:48 ` [OE-core] " Mathieu Dubois-Briand
@ 2026-08-25 20:13 ` Alejandro Hernandez
[not found] ` <18CF258177A95B06.3360474@lists.openembedded.org>
1 sibling, 0 replies; 4+ messages in thread
From: Alejandro Hernandez @ 2026-08-25 20:13 UTC (permalink / raw)
To: mathieu.dubois-briand, openembedded-core
On 8/25/2026 12:48 PM, Mathieu Dubois-Briand via lists.openembedded.org
wrote:
> On Tue Aug 25, 2026 at 1:56 AM CEST, Alejandro Hernandez Samaniego via lists.openembedded.org wrote:
>> rustc computes each crate's Strict Version Hash (SVH) using inputs that include
>> the *stage0/stage1 bootstrap compiler* fingerprint, which in turn depends on the
>> build host arch.
>>
>> This eventually may cause sstate matches across architectures for artifacts that
>> are actually different, causing autobuilder intermitent reproducibility issues.
>>
>> To avoid this, pass a fixed value instead of host-specific bits to the specified
>> hash.
>>
>> [YOCTO #15554]
>>
>> Assisted-by: AI - OpenAI
>> Signed-off-by: Alejandro Hernandez <alhe@linux.microsoft.com>
> Hi Alejandro,
>
> This looks broken here:
>
> ERROR: rust-native-1.97.1-r0 do_install: Execution of '/srv/pokybuild/yocto-worker/genericx86-64/build/build/tmp/work/x86_64-linux/rust-native/1.97.1/temp/run.do_install.2682640' failed with exit code 1
> ...
> ERROR: Logfile of failure stored in: /srv/pokybuild/yocto-worker/genericx86-64/build/build/tmp/work/x86_64-linux/rust-native/1.97.1/temp/log.do_install.2682640
> ...
> | Building [==================> ] 275/348: object, schemars, tracing-s…
> | Compiling rustc_span v0.0.0 (/srv/pokybuild/yocto-worker/genericx86-64/build/build/tmp/work-shared/rust-source-1.97.1-r0/sources/rustc-1.97.1-src/compiler/rustc_span)
> | Building [==================> ] 276/348: object, schemars, tracing-s…
> | error: expected `;`, found `StableCrateId`
> | --> /rustc-dev/8bab26f4f68e0e26f0bb7960be334d5b520ea452/compiler/rustc_span/src/def_id.rs:200:59
> | |
> | 200 | hasher.write(b"
>
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/4/builds/4510
>
> Can you have a look at the issue?
I'll take a look
> Thanks,
> Mathieu
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#244262): https://lists.openembedded.org/g/openembedded-core/message/244262
> Mute This Topic: https://lists.openembedded.org/mt/120913402/4354175
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alhe@linux.microsoft.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [OE-core] [PATCH v2] rust: Avoid passing host-specific information to crates Strict Version Hash
[not found] ` <18CF258177A95B06.3360474@lists.openembedded.org>
@ 2026-08-26 15:54 ` Alejandro Hernandez
0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Hernandez @ 2026-08-26 15:54 UTC (permalink / raw)
To: mathieu.dubois-briand, openembedded-core
On 8/25/2026 2:13 PM, Alejandro Hernandez Samaniego via
lists.openembedded.org wrote:
>
> On 8/25/2026 12:48 PM, Mathieu Dubois-Briand via
> lists.openembedded.org wrote:
>> On Tue Aug 25, 2026 at 1:56 AM CEST, Alejandro Hernandez Samaniego
>> via lists.openembedded.org wrote:
>>> rustc computes each crate's Strict Version Hash (SVH) using inputs
>>> that include
>>> the *stage0/stage1 bootstrap compiler* fingerprint, which in turn
>>> depends on the
>>> build host arch.
>>>
>>> This eventually may cause sstate matches across architectures for
>>> artifacts that
>>> are actually different, causing autobuilder intermitent
>>> reproducibility issues.
>>>
>>> To avoid this, pass a fixed value instead of host-specific bits to
>>> the specified
>>> hash.
>>>
>>> [YOCTO #15554]
>>>
>>> Assisted-by: AI - OpenAI
>>> Signed-off-by: Alejandro Hernandez <alhe@linux.microsoft.com>
>> Hi Alejandro,
>>
>> This looks broken here:
>>
>> ERROR: rust-native-1.97.1-r0 do_install: Execution of
>> '/srv/pokybuild/yocto-worker/genericx86-64/build/build/tmp/work/x86_64-linux/rust-native/1.97.1/temp/run.do_install.2682640'
>> failed with exit code 1
>> ...
>> ERROR: Logfile of failure stored in:
>> /srv/pokybuild/yocto-worker/genericx86-64/build/build/tmp/work/x86_64-linux/rust-native/1.97.1/temp/log.do_install.2682640
>> ...
>> | Building [==================> ] 275/348: object, schemars,
>> tracing-s…
>> | Compiling rustc_span v0.0.0
>> (/srv/pokybuild/yocto-worker/genericx86-64/build/build/tmp/work-shared/rust-source-1.97.1-r0/sources/rustc-1.97.1-src/compiler/rustc_span)
>> | Building [==================> ] 276/348: object, schemars,
>> tracing-s…
>> | error: expected `;`, found `StableCrateId`
>> | -->
>> /rustc-dev/8bab26f4f68e0e26f0bb7960be334d5b520ea452/compiler/rustc_span/src/def_id.rs:200:59
>> | |
>> | 200 | hasher.write(b"
>>
>> https://autobuilder.yoctoproject.org/valkyrie/#/builders/4/builds/4510
>>
>> Can you have a look at the issue?
>
> I'll take a look
>
Looks like I made some mistakes when I rebased the patch onto the latest
rust update that was just merged, sending v3
>
>
>> Thanks,
>> Mathieu
>>
>>
>>
>>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#244272): https://lists.openembedded.org/g/openembedded-core/message/244272
> Mute This Topic: https://lists.openembedded.org/mt/120913402/4354175
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alhe@linux.microsoft.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-26 15:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-24 23:56 [PATCH v2] rust: Avoid passing host-specific information to crates Strict Version Hash Alejandro Hernandez
2026-08-25 18:48 ` [OE-core] " Mathieu Dubois-Briand
2026-08-25 20:13 ` Alejandro Hernandez
[not found] ` <18CF258177A95B06.3360474@lists.openembedded.org>
2026-08-26 15:54 ` Alejandro Hernandez
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.