Skip to content

Rust reproducibility issue - Finding the proper fix #134589

Open
@sundeep-kokkonda

Description

@sundeep-kokkonda

We are building Rust for a custom target in the Yocto framework. Here we run a test called reproducibility to ensure the rust binaries are identical between the builds.
We do that by building and comparing the rust binaries & libs in two different build directories -

  1. reproducibleA &
  2. reproducibleB-extended

With every rust release we've seen a several issues which makes the rust binaries are not reproducible. The issues seen are with several reasons like -

  1. Regressions caused by rust updates (absolute path in proc-macro)
    a9a9798

  2. Incorrect/missing Rust config settings (remap-debuginfo is not set by default)
    https://lists.openembedded.org/g/openembedded-core/message/188940

  3. Compiler options and settings - rustdoc failed with codegen-units option setting
    https://lists.openembedded.org/g/openembedded-core/message/202540

  4. Regressions with Crate updates - CC crate appending a unique hash to the object files
    Fix for different hashes between different build paths cc-rs#1277
    Use relative directory for obj files hash cc-rs#1270

There are a few other failure cases we've analyzed and fixed. This issue is happening for multiple reasons and these failure are resulting in lot of debug efforts and project delays.

This can be avoided by having such a reproducibility test on rust itself.

Any comments or inputs on detecting and fixing this issue during rust development itself? (via a test case or any other ways)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-reproducibilityArea: Reproducible / deterministic buildsC-discussionCategory: Discussion or questions that doesn't represent real issues.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions