Skip to content

CentOS 7's rpmbuild can't handle debuginfo generated by Rust 1.50.0 #82006

Closed
@Arnavion

Description

@Arnavion

Full repro and steps in rust-150-centos7.tar.gz. It's just a minimal bin crate with an RPM specfile that can be used with rpmbuild

To summarize, when CentOS 7's rpmbuild tries to extract the debuginfo from the binary to build the debuginfo package, it fails with:

...

cargo build --release
   Compiling foo v0.1.0 (/root/rpmbuild/BUILD/foo-1.0.0)
    Finished release [optimized] target(s) in 0.42s
install -D target/release/foo /root/rpmbuild/BUILDROOT/foo-1.0.0-1.x86_64/usr/bin/foo
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /root/rpmbuild/BUILD/foo-1.0.0
extracting debug info from /root/rpmbuild/BUILDROOT/foo-1.0.0-1.x86_64/usr/bin/foo
/usr/lib/rpm/debugedit: canonicalization unexpectedly shrank by one character
error: Bad exit status from /var/tmp/rpm-tmp.y1gaix (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.y1gaix (%install)

This is new with 1.50.0. It works fine with 1.49.0. Web search reveals https://bugzilla.redhat.com/show_bug.cgi?id=304121 as an example of where a source file path had an extra / that triggered this. I'm not sure what the reason is here.

Meta

Happens with both stable:

rustc 1.50.0 (cb75ad5db 2021-02-10)
binary: rustc
commit-hash: cb75ad5db02783e8b0222fee363c5f63f7e2cf5b
commit-date: 2021-02-10
host: x86_64-unknown-linux-gnu
release: 1.50.0

... and latest nightly:

rustc 1.52.0-nightly (07194ffcd 2021-02-10)
binary: rustc
commit-hash: 07194ffcd25b0871ce560b9f702e52db27ac9f77
commit-date: 2021-02-10
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 11.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.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