Skip to content

rlibs are not bit-identical when building the same crate in different directories with -Zremap-path-prefix #48019

Closed
@luser

Description

@luser

I was trying to determine if sccache could cache crates built as dependencies of different root crates. When I looked into it I found that the rlibs were not bit-identical despite being built from the same source. Most of the differences were in the debug info because the current directory winds up encoded there. I tried using -Zremap-path-prefix-from=... -Zremap-path-prefix-to=... which removed most of the differences but not all. A small difference in the metadata remains, which from looking at the diff of the serialized metadata @eddyb said was the SVH. @michaelwoerister: do you know why this would be?

I built this test crate twice in different directories using the test-build.sh script. The diff of the itoa rlib from each build looks like this (I generated that using diffoscope.)

Presumably this would block #34902 and also #38322.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-metadataArea: Crate metadataC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions