Login
You're viewing the discuss.systems public feed.
  • Mar 19, 2026, 4:49 PM

    @manpacket First of all, no it doesn't. Running both files through strip reduced both by a meg+. Second of all, the filesizes were still 800KB different after that, and still 35KB different after I told Cargo to use codegen_units=1. Third of all, the binaries are less than six megs unstripped, but lastly and most importantly, I want my builds to be reproducible, and if possible I want Cargo and crate2nix to produce identical files so I can know for sure that if something weird happens and I get a bug report, the method the person used to build it isn't at fault.

    💬 1🔄 0⭐ 0

Replies

  • Mar 19, 2026, 5:27 PM

    @AVincentInSpace Hmm... I think nix strips them by default and you have to disable it, at least that's how it behaves here.

    One other source of the discrepancy might be a feature unification or lack of it in crate2nix. But I would expect this will make the resulting binary bigger, not smaller.

    Are you linking in any external libraries? This can be a source of the difference. I'd run `cargo build -vvv` or something similar and compare all the rustc invocations, possibly with a script.

    💬 0🔄 0⭐ 0