-
-
Notifications
You must be signed in to change notification settings - Fork 577
Description
I am trying to make the AppImage binary for Electrum reproducible/deterministic.
Looking at e.g. #625, I take it this should be possible.
I am using appimagetool release 11.
I think I've managed to build almost identical binaries (only been testing on one machine for now).
Would like to request pointers/help regarding what might be missing.
If I build two binaries, and run --appimage-extract on them, the extracted folders seem identical (e.g. recursive md5sum, and then diff of that, is empty)
diff of recursive md5sum of extracted contents
cd dist/
./electrum-3.3.4-76-geb04551-dirty-x86_64.AppImage1 --appimage-extract
mv squashfs-root/ squashfs-root1/
./electrum-3.3.4-76-geb04551-dirty-x86_64.AppImage2 --appimage-extract
mv squashfs-root/ squashfs-root2/
$(cd squashfs-root1; find -type f -exec md5sum '{}' \; > ./../md5sum1)
$(cd squashfs-root2; find -type f -exec md5sum '{}' \; > ./../md5sum2)
diff md5sum1 md5sum2 # << empty
So that's good I guess :)
If I use diffoscope to compare the binaries themselves, it tells me the only difference is due to an elf section called digest_md5
:
$ diffoscope dist/electrum-3.3.4-76-geb04551-dirty-x86_64.AppImage1 dist/electrum-3.3.4-76-geb04551-dirty-x86_64.AppImage2
|############################| 100% Time: 0:00:05
--- dist/electrum-3.3.4-76-geb04551-dirty-x86_64.AppImage1
+++ dist/electrum-3.3.4-76-geb04551-dirty-x86_64.AppImage2
├── readelf --wide --decompress --hex-dump=.digest_md5 {}
│ @@ -1,4 +1,4 @@
│
│ Hex dump of section '.digest_md5':
│ - 0x00000000 77e356ea eefe1459 a40f00d9 ab5c0e00 w.V....Y.....\..
│ + 0x00000000 1dda23b5 31f9024c fe6d2755 e930a41a ..#.1..L.m'U.0..
I've found this in the appimage docs:
digest-md5
Calculates the MD5 digest used for desktop integration purposes for a given AppImage. This digest depends on the path, not on the contents.
Is that in the docs related to this elf section?
Any idea what I need to make the build deterministic?