Skip to content

Non-deterministic builds with parallel-frontend-threads option #154259

@sundeep-kokkonda

Description

@sundeep-kokkonda

While enabling parallel-frontend-threads option in our build env (Yocto), the build outputs are not reproducible.
The difference is in the librustc_driver***.so file .gnu_debuglink section. Further analysis on debug data shows the .strtab section is differed and there I found the debug symbols are generated with changed *.llvm.{hash} between the builds. For e.g.,

BuildA has: _RINvNtCskNcDw7Prru3_4core3ptr13drop_in_placeINtNtNtNtCsc9RSozNcmFu_3std4sync6poison5mutex10MutexGuarduEECsi7rQHRWG1Yr_12rustc_middle.llvm.12271321240562639378

BuildB has: _RINvNtCskNcDw7Prru3_4core3ptr13drop_in_placeINtNtNtNtCsc9RSozNcmFu_3std4sync6poison5mutex10MutexGuarduEECsi7rQHRWG1Yr_12rustc_middle.llvm.16648798016096118002

In above lines the *.llvm.{hash} is changed. Is there a way or an option to make this hash generation is unique? I tried by setting CGU to 1 but still the same issue is seen.

The same observation is made on rust upstream sources w/o Yocto build env.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parallel-compilerArea: parallel compilerA-reproducibilityArea: Reproducible / deterministic buildsC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions