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

Smaller binaries #20

Closed
arteme opened this issue Dec 28, 2022 · 2 comments
Closed

Smaller binaries #20

arteme opened this issue Dec 28, 2022 · 2 comments
Milestone

Comments

@arteme
Copy link
Owner

arteme commented Dec 28, 2022

Currently, packaged pod-ui binaries are huge because they contain debugging info. Debugging info can be split off and packages only with debug build (needed?).

Needs testing, especially with sentry.

Resources:

@arteme arteme added this to the v1.1.0 milestone Dec 28, 2022
@arteme
Copy link
Owner Author

arteme commented Jan 2, 2023

A combination of split-debuginfo = "packed" and lto = "thin" is blocked until rust 1.67 by rust-lang/rust#103932

@arteme
Copy link
Owner Author

arteme commented Feb 4, 2023

For the purpose of producing smaller release images, yet having the option of getting useful stack dumps (symbolicated, matched with source in sentry), this proved to work after much swearing and trying different approaches:

  • build release profile with debug info and thin LTO;
  • split-debuginfo=packed does not do much in Linux or mingw64 builds (rust updated to 1.67), so splitting debug info from executables on these platforms is accomplished using objcopy);
  • split-debuginfo=packed is mandatory in macOS to actually get debug symbols;
  • link-arg=-Wl,--build-id is needed in mingw64 for it does not automatically include build id;
  • sentry needs debug-images feature flag to be able to match stack traces to uploaded debug symbols;
  • sentry has problems recognizing split debug symbols in mingw64;
  • upload the executable, split debug symbols (.dSYM in macOS, .debug in Linux) and sources to sentry;
  • mingw64: upload the unstripped executable and sources to sentry, then strip debug symbols for release;
  • phew, done!

@arteme arteme closed this as completed Feb 4, 2023
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

No branches or pull requests

1 participant