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

Split debuginfos in addition to stripping #48

Open
brancz opened this issue Jul 5, 2023 · 6 comments · May be fixed by #49
Open

Split debuginfos in addition to stripping #48

brancz opened this issue Jul 5, 2023 · 6 comments · May be fixed by #49
Labels
enhancement New feature or request

Comments

@brancz
Copy link

brancz commented Jul 5, 2023

Since this action does all: compiling, stripping, and uploading, it's currently not possible to retain debuginfos in a separate file, since they're just stripped away immediately after building. Debuginfos are important for debuggers and profilers to work though so it would be nice if there was some way to enable keeping them.

Would you be open to in addition to stripping adding an object copy that first extracts debuginfos? For example here:

objcopy --only-keep-debug "${target_dir}/${bin_exe}" "${target_dir}/${bin_exe}.debug"
@taiki-e
Copy link
Owner

taiki-e commented Jul 7, 2023

Is the actual request here to add an option to support split-debuginfo? Or is it to add an option to not strip?

In the former case, specifying split-debuginfo in the profile and using the include/asset option would probably already work.
In the latter case, this action should already respect it if you explicitly set strip to false in the profile.

In any case, I'm open to adding an option to make it easier. However, as for split-debuginfo, considering cross that doesn't propagate environment variables to cargo by default, users will probably need to specify the option in the profile anyway.

@taiki-e taiki-e added the enhancement New feature or request label Jul 7, 2023
@brancz
Copy link
Author

brancz commented Jul 7, 2023

The problem with split-debuginfo is that the format of debuginfos it produces is very different from those that are included in the binary. This is because split-debuginfo produces dwp dwarf package files which are easy to produce but not supported by many tools. Whereas when including debuginfos in the binary with debug = true they are produced the same way as Linux distributions publish on debuginfod servers.

@taiki-e
Copy link
Owner

taiki-e commented Jul 7, 2023

So the actual request is the latter (add an option to not strip)?

@brancz
Copy link
Author

brancz commented Jul 7, 2023

I think that's generally a useful thing to have, but often people want minimal production binaries but still keep the debuginfos somehow for using with profiling or debugging (I happen to need them for profiling). So I think both an option to not stripping at all, and an option that when stripping to retain the debuginfos in a separate file.

@brancz
Copy link
Author

brancz commented Jul 13, 2023

If you're generally open to this, I'd be happy to draft something up.

@taiki-e
Copy link
Owner

taiki-e commented Jul 14, 2023

I would accept PRs to implement them.

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

Successfully merging a pull request may close this issue.

2 participants