Minimizing OTP release size while keeping type documentation

I’d recently was asked why you couldn’t get help on types via the IEx t helper with Nerves. The reason is that the type docs are in the BEAM debug information ("Dbgi") chunk and that chunk is stripped to reduce firmware image size. The fix is to keep it by modifying the mix.exs. E.g., strip_beams: [keep: ["Docs", "Dbgi"]] in the release section.

I was going to make this the default, but it increases firmware size by over 30%. I assume this is due to all of the other debug information coming along with the "Dbgi" chunk.

30% is a pretty big bump in firmware size and makes firmware updates even slower.

I was wondering if there were any other ways to make this work. Perhaps a partial strip of the "Dbgi" section if that’s even possible? Has anyone gone down this path before?

3 Likes