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

Add ability to retain debuginfo before stripping binaries #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brancz
Copy link

@brancz brancz commented Jul 17, 2023

Resolves #48

@taiki-e
Copy link
Owner

taiki-e commented Jul 17, 2023

Thanks for the PR!

How do you plan to distribute the .debug file? Currently it is not included in the archive. (Here is code to include binary to archive.)

Also, is there any reason to prefer the objcopy command over the cargo profile option? I don't think that would work well with cross-compilation. (like #8)

@brancz
Copy link
Author

brancz commented Jul 17, 2023

How do you plan to distribute the .debug file? Currently it is not included in the archive. (Here is code to include binary to archive.)

Right, I was thinking people could use the include functionality if they wanted them in the release tarball. My use case is actually a little different though, I want to build the binary, extract debuginfos, strip the binary, publish the binary as usual, and then publish the debuginfos separately on a debuginfod server.

Also, is there any reason to prefer the objcopy command over the cargo profile option? I don't think that would work well with cross-compilation. (like #8)

Great question! The issue with the cargo profile option is that it doesn't produce the same data. It produces DWARF packages, which are nowhere near as well supported by tooling as regular DWARF.

I've used objcopy on various platforms and architectures and have never had issues with not being able to use the same objcopy for other platform/architecture binaries, but do you have a suggestion for how I could test this to make extra sure? (For example how could I reproduce what was described in #8?)

@VorpalBlade
Copy link

VorpalBlade commented Feb 23, 2024

Any progress on this PR? Being able to upload a separate debug info archive would be great.

@taiki-e
Copy link
Owner

taiki-e commented Mar 1, 2024

Any progress on this PR? Being able to upload a separate debug info archive would be great.

If you use the cargo profile mentioned in #59 and one of the include or asset options, you should be able to use this functionally without the specific option.

The main issue with this PR is that it is implemented in a way other than the cargo profile. We know from experience that that fact causes issue. Also it may not work correctly if strip option in cargo profile is specified. And in that case, it means that this will no longer work by default on 1.77+ (rust-lang/cargo#13257).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split debuginfos in addition to stripping
3 participants