indygreg / python-build-standalone

Produce redistributable builds of Python
BSD 3-Clause "New" or "Revised" License
1.71k stars 107 forks source link

FR: remove debug symbols from Windows `install_only` builds #174

Open ofek opened 1 year ago

ofek commented 1 year ago

To save space and bandwidth

ofek commented 1 year ago

Should be as simple as removing *.pdb

mitsuhiko commented 1 year ago

I don't think it's a good idea to not ship debug symbols.

ofek commented 1 year ago

Okay, why?

indygreg commented 11 months ago

I believe that debug symbols should be available for any pre-built binary that is distributed. Full stop.

If debug symbols aren't available, debugging crashes becomes much harder. Lack of symbols can also hamper some forms of performance profiling. That's why I feel anyone distributing [open source] software has an obligation to make symbols available.

Since I'm not aware of an easy/cheap way to run a debug symbol server, that means making symbols available as GitHub release artifacts. Right now that occurs implicitly since we distribute unstripped binaries.

While it is possible to ship symbols as separate artifacts (the tooling for this is more polished on Windows / PDBs than it is on Linux), I'm more inclined to ship an install_only_stripped artifact variant. That way end-users can pick which variant to use without having to worry about joining the detached symbols.

Another idea that's been floating around in my head is shipping various scripts/binaries in the distributions that can post-process the distribution. One could imagine shipping an executable that is capable of stripping the binaries. Then downstream consumers could repackage stripped binaries.

Adding this to the backlog.

axel-kah commented 10 months ago

@indygreg: +1 for shipping install_only_stripped artifacts because that eliminates the need for downstream postprocessing.

ofek commented 4 months ago

It will be excellent to have these stripped builds. I would like to offer my assistance to various projects to start building with or migrate to PyApp but currently if one were to opt-in for the embedded Python configuration it would be impossible to come close to the current size of, for example, binaries like this: https://github.com/yt-dlp/yt-dlp/releases/tag/2023.12.30 (~13.4 MB)