Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic strip = "debuginfo" in release mode does not work when using --target flag #13617

Closed
kamulos opened this issue Mar 21, 2024 · 2 comments · Fixed by #13618
Closed

Automatic strip = "debuginfo" in release mode does not work when using --target flag #13617

kamulos opened this issue Mar 21, 2024 · 2 comments · Fixed by #13618
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@kamulos
Copy link

kamulos commented Mar 21, 2024

Problem

I am on glibc based linux and I installed the target x86_64-unknown-linux-musl additionally using rustup.

Rust intends to strip the debuginfo from release binaries, which seems to work fine for x86_64-unknown-linux-gnu, but not for x86_64-unknown-linux-musl.

These are the sizes I get for cargo build --release and a fresh Cargo.toml from cargo new (hello world) compared to what I get, when explicitly configuring strip = "debuginfo":

Configuration Size
gnu 407K
musl 3.8M
gnu + strip 407K
musl + strip 510K

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.79.0-nightly (d438c80c4 2024-03-19)
release: 1.79.0-nightly
commit-hash: d438c80c45c24be676ef5867edc79d0a14910efe
commit-date: 2024-03-19
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Arch Linux [64-bit]
@kamulos kamulos added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Mar 21, 2024
@ehuss
Copy link
Contributor

ehuss commented Mar 21, 2024

Thanks for the report! Can you confirm whether are you using the --target flag for both commands? I can see that the --target flag is indeed not working.

@kamulos
Copy link
Author

kamulos commented Mar 21, 2024

Indeed, I was not using --target for my default x86_64-unknown-linux-gnu. If I do, it will also omit to strip the binary.

So this seems purely related to the --target flag.

@kamulos kamulos changed the title Automatic strip = "debuginfo" in release mode does not work when using --target x86_64-unknown-linux-musl Automatic strip = "debuginfo" in release mode does not work when using --target flag Mar 21, 2024
@bors bors closed this as completed in 8bcecfe Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants