prefix-dev / rattler-build

rattler-build is a universal package builder for Windows, macOS and Linux
https://prefix-dev.github.io/rattler-build
BSD 3-Clause "New" or "Revised" License
185 stars 38 forks source link

Crashreporting issues and code signing around tooling to make binaries relocatable #970

Open zbowling opened 1 month ago

zbowling commented 1 month ago

Tooling that touches binaries after building is done generally is not a great idea for a couple of reasons.

It's a bit of an odd issue but on MacOS, if you codesign (and sometimes you have to use codesigning even when using an anonymous identity if you want certain privileges that things like debuggers need) then install_name_tool will make your codesigning invalid and prevent the executable from running without resigning the binary again. Since there isn't a hook for after the relocation logic in rattler-build it's a bit wonky.

A similar issue also occurs when build and you strip debug symbols and upload them for crash reporting services like crashpad/breakpad. Patchelf and install_name_tool can muck up that match that occurs for minidumps if the image has changed after you upload your symbols.

I think the binary relocation is important but it might be better to instead of actually rewrite binaries, warn when they are not right and leave it to build systems to fix their output at more optune times.