build: fix cross-arch macOS M1 build reproducibility #25817

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:m1_arm_nondeterminism changing 1 files +3 −0
  1. fanquake commented at 3:46 pm on August 10, 2022: member

    Building the macOS M1 bitcoin-qt binary at a optimisation level higher than -O1 causes reproducibility issues when building on different architectures.

    Proposing somewhat of a hammer.

    This would fix 1 of the 2 remaining HOSTS in #21194.

    Guix Build (x86_64):

    01b58b5109b32dca2509499c93347148e6bab5dca835081f8cbd3123bed72cce1  guix-build-08bd3382777b/output/arm64-apple-darwin/SHA256SUMS.part
    10e0d063d3832fad7c5116dabb2ac33c919f40bda04759aad4523c6247295bc9e  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin-unsigned.dmg
    21feb301245f2c664edcfd9ac528fe1543fc7b183b3b42637db77d57658bc2b5e  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin-unsigned.tar.gz
    3641eb100d0a281203f9d6e36e45dc0ffc772c680d6aec462434f106b4c44e295  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin.tar.gz
    49d89920626e35939aa6cf506fc85861179f3c0e18d4ef1954750cf81336a851a  guix-build-08bd3382777b/output/dist-archive/bitcoin-08bd3382777b.tar.gz
    5e7697d30084270d0b5843b3baf0d752e240c2f708f728bc2f6896f153276ca6b  guix-build-08bd3382777b/output/x86_64-apple-darwin/SHA256SUMS.part
    6dd77acee082dbfd3cdad2c564bbd3bdace8df9bf32f92cf4a2debd5a996ace49  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin-unsigned.dmg
    785e63fccb7af12468a04a678034c42dcd775d243b2d194a52e1086a6ffbdbe84  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin-unsigned.tar.gz
    8ff2629957608898d76a42025985e3ec4bf5dc8572794e32b4182ba6f8babb828  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin.tar.gz
    

    Guix Build (arm64):

    01b58b5109b32dca2509499c93347148e6bab5dca835081f8cbd3123bed72cce1  guix-build-08bd3382777b/output/arm64-apple-darwin/SHA256SUMS.part
    10e0d063d3832fad7c5116dabb2ac33c919f40bda04759aad4523c6247295bc9e  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin-unsigned.dmg
    21feb301245f2c664edcfd9ac528fe1543fc7b183b3b42637db77d57658bc2b5e  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin-unsigned.tar.gz
    3641eb100d0a281203f9d6e36e45dc0ffc772c680d6aec462434f106b4c44e295  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin.tar.gz
    49d89920626e35939aa6cf506fc85861179f3c0e18d4ef1954750cf81336a851a  guix-build-08bd3382777b/output/dist-archive/bitcoin-08bd3382777b.tar.gz
    5e7697d30084270d0b5843b3baf0d752e240c2f708f728bc2f6896f153276ca6b  guix-build-08bd3382777b/output/x86_64-apple-darwin/SHA256SUMS.part
    6dd77acee082dbfd3cdad2c564bbd3bdace8df9bf32f92cf4a2debd5a996ace49  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin-unsigned.dmg
    785e63fccb7af12468a04a678034c42dcd775d243b2d194a52e1086a6ffbdbe84  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin-unsigned.tar.gz
    8ff2629957608898d76a42025985e3ec4bf5dc8572794e32b4182ba6f8babb828  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin.tar.gz
    
  2. fanquake added the label Brainstorming on Aug 10, 2022
  3. fanquake added the label macOS on Aug 10, 2022
  4. fanquake added the label Build system on Aug 10, 2022
  5. fanquake added the label DrahtBot Guix build requested on Aug 10, 2022
  6. hebasto commented at 3:51 pm on August 10, 2022: member

    Proposing somewhat of a hammer.

    Indeed :smile:

  7. achow101 commented at 7:58 pm on August 10, 2022: member

    x86_64 build:

    0a6c5bc5af6992935ad4a547f471e18dbf5419b3284f95a78e65fc3a0c491cfe4  guix-build-849a1f5c7b77/output/arm64-apple-darwin/bitcoin-849a1f5c7b77-arm64-apple-darwin-unsigned.dmg
    1bf4f3cbb5ea2559251c6cca95205599456b6e597f32ccdf2a1d93a4384a932e0  guix-build-849a1f5c7b77/output/arm64-apple-darwin/bitcoin-849a1f5c7b77-arm64-apple-darwin-unsigned.tar.gz
    2f5118d115371a361c24d42af3b4be97d1fe340f0f19300290b74805106048a8a  guix-build-849a1f5c7b77/output/arm64-apple-darwin/bitcoin-849a1f5c7b77-arm64-apple-darwin.tar.gz
    329ae09d6b2d52f814bead74dc1a51a5d4944af29a38fa97acde3ca68ad83ecc9  guix-build-849a1f5c7b77/output/dist-archive/bitcoin-849a1f5c7b77.tar.gz
    4e86da978c62ac1ad5fe0df8a61c98e86203dbf4fd7ec7619d07af2ad957b9ef4  guix-build-849a1f5c7b77/output/x86_64-apple-darwin/SHA256SUMS.part
    5d6433cf54052308bd632c2f093260d355c51386e6751977a5a25a60cad14365e  guix-build-849a1f5c7b77/output/x86_64-apple-darwin/bitcoin-849a1f5c7b77-x86_64-apple-darwin-unsigned.dmg
    6d94dc7e2c4da8b45a36c39b35dda48b960e7c05a59834825215eb64daf5dcf06  guix-build-849a1f5c7b77/output/x86_64-apple-darwin/bitcoin-849a1f5c7b77-x86_64-apple-darwin-unsigned.tar.gz
    7ccda72b619d9bf88c0baca11875ea94091080befc1e19e4031778919ce5f5be1  guix-build-849a1f5c7b77/output/x86_64-apple-darwin/bitcoin-849a1f5c7b77-x86_64-apple-darwin.tar.gz
    

    arm64 build:

    0b6b7395fd0d67c32894b520ef6300d467b3c5ddc52733efd81243079e45c9184  guix-build-849a1f5c7b77/output/arm64-apple-darwin/SHA256SUMS.part
    1a6c5bc5af6992935ad4a547f471e18dbf5419b3284f95a78e65fc3a0c491cfe4  guix-build-849a1f5c7b77/output/arm64-apple-darwin/bitcoin-849a1f5c7b77-arm64-apple-darwin-unsigned.dmg
    2bf4f3cbb5ea2559251c6cca95205599456b6e597f32ccdf2a1d93a4384a932e0  guix-build-849a1f5c7b77/output/arm64-apple-darwin/bitcoin-849a1f5c7b77-arm64-apple-darwin-unsigned.tar.gz
    3f5118d115371a361c24d42af3b4be97d1fe340f0f19300290b74805106048a8a  guix-build-849a1f5c7b77/output/arm64-apple-darwin/bitcoin-849a1f5c7b77-arm64-apple-darwin.tar.gz
    429ae09d6b2d52f814bead74dc1a51a5d4944af29a38fa97acde3ca68ad83ecc9  guix-build-849a1f5c7b77/output/dist-archive/bitcoin-849a1f5c7b77.tar.gz
    5e86da978c62ac1ad5fe0df8a61c98e86203dbf4fd7ec7619d07af2ad957b9ef4  guix-build-849a1f5c7b77/output/x86_64-apple-darwin/SHA256SUMS.part
    6d6433cf54052308bd632c2f093260d355c51386e6751977a5a25a60cad14365e  guix-build-849a1f5c7b77/output/x86_64-apple-darwin/bitcoin-849a1f5c7b77-x86_64-apple-darwin-unsigned.dmg
    7d94dc7e2c4da8b45a36c39b35dda48b960e7c05a59834825215eb64daf5dcf06  guix-build-849a1f5c7b77/output/x86_64-apple-darwin/bitcoin-849a1f5c7b77-x86_64-apple-darwin-unsigned.tar.gz
    8ccda72b619d9bf88c0baca11875ea94091080befc1e19e4031778919ce5f5be1  guix-build-849a1f5c7b77/output/x86_64-apple-darwin/bitcoin-849a1f5c7b77-x86_64-apple-darwin.tar.gz
    
  8. jarolrod commented at 10:49 pm on August 10, 2022: member

    guix hashes

    x86:

    01b58b5109b32dca2509499c93347148e6bab5dca835081f8cbd3123bed72cce1  guix-build-08bd3382777b/output/arm64-apple-darwin/SHA256SUMS.part
    10e0d063d3832fad7c5116dabb2ac33c919f40bda04759aad4523c6247295bc9e  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin-unsigned.dmg
    21feb301245f2c664edcfd9ac528fe1543fc7b183b3b42637db77d57658bc2b5e  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin-unsigned.tar.gz
    3641eb100d0a281203f9d6e36e45dc0ffc772c680d6aec462434f106b4c44e295  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin.tar.gz
    49d89920626e35939aa6cf506fc85861179f3c0e18d4ef1954750cf81336a851a  guix-build-08bd3382777b/output/dist-archive/bitcoin-08bd3382777b.tar.gz
    5e7697d30084270d0b5843b3baf0d752e240c2f708f728bc2f6896f153276ca6b  guix-build-08bd3382777b/output/x86_64-apple-darwin/SHA256SUMS.part
    6dd77acee082dbfd3cdad2c564bbd3bdace8df9bf32f92cf4a2debd5a996ace49  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin-unsigned.dmg
    785e63fccb7af12468a04a678034c42dcd775d243b2d194a52e1086a6ffbdbe84  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin-unsigned.tar.gz
    8ff2629957608898d76a42025985e3ec4bf5dc8572794e32b4182ba6f8babb828  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin.tar.gz
    

    arm64:

    01b58b5109b32dca2509499c93347148e6bab5dca835081f8cbd3123bed72cce1  guix-build-08bd3382777b/output/arm64-apple-darwin/SHA256SUMS.part
    10e0d063d3832fad7c5116dabb2ac33c919f40bda04759aad4523c6247295bc9e  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin-unsigned.dmg
    21feb301245f2c664edcfd9ac528fe1543fc7b183b3b42637db77d57658bc2b5e  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin-unsigned.tar.gz
    3641eb100d0a281203f9d6e36e45dc0ffc772c680d6aec462434f106b4c44e295  guix-build-08bd3382777b/output/arm64-apple-darwin/bitcoin-08bd3382777b-arm64-apple-darwin.tar.gz
    49d89920626e35939aa6cf506fc85861179f3c0e18d4ef1954750cf81336a851a  guix-build-08bd3382777b/output/dist-archive/bitcoin-08bd3382777b.tar.gz
    5e7697d30084270d0b5843b3baf0d752e240c2f708f728bc2f6896f153276ca6b  guix-build-08bd3382777b/output/x86_64-apple-darwin/SHA256SUMS.part
    6dd77acee082dbfd3cdad2c564bbd3bdace8df9bf32f92cf4a2debd5a996ace49  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin-unsigned.dmg
    785e63fccb7af12468a04a678034c42dcd775d243b2d194a52e1086a6ffbdbe84  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin-unsigned.tar.gz
    8ff2629957608898d76a42025985e3ec4bf5dc8572794e32b4182ba6f8babb828  guix-build-08bd3382777b/output/x86_64-apple-darwin/bitcoin-08bd3382777b-x86_64-apple-darwin.tar.gz
    
  9. fanquake marked this as ready for review on Aug 12, 2022
  10. hebasto commented at 10:16 am on August 12, 2022: member

    For the reference, currently, in the master branch, the corelib and gui libraries are being compiled with QMAKE_CFLAGS_OPTIMIZE_FULL = -O3.

    Other libraries (network, widgets, plugins and testlib) are being compiled with QMAKE_CFLAGS_OPTIMIZE = -O2.

  11. hebasto commented at 10:34 am on August 12, 2022: member

    Guix builds on arm64:

    0b6b7395fd0d67c32894b520ef6300d467b3c5ddc52733efd81243079e45c9184  guix-build-849a1f5c7b77/output/arm64-apple-darwin/SHA256SUMS.part
    1a6c5bc5af6992935ad4a547f471e18dbf5419b3284f95a78e65fc3a0c491cfe4  guix-build-849a1f5c7b77/output/arm64-apple-darwin/bitcoin-849a1f5c7b77-arm64-apple-darwin-unsigned.dmg
    2bf4f3cbb5ea2559251c6cca95205599456b6e597f32ccdf2a1d93a4384a932e0  guix-build-849a1f5c7b77/output/arm64-apple-darwin/bitcoin-849a1f5c7b77-arm64-apple-darwin-unsigned.tar.gz
    3f5118d115371a361c24d42af3b4be97d1fe340f0f19300290b74805106048a8a  guix-build-849a1f5c7b77/output/arm64-apple-darwin/bitcoin-849a1f5c7b77-arm64-apple-darwin.tar.gz
    429ae09d6b2d52f814bead74dc1a51a5d4944af29a38fa97acde3ca68ad83ecc9  guix-build-849a1f5c7b77/output/dist-archive/bitcoin-849a1f5c7b77.tar.gz
    5e86da978c62ac1ad5fe0df8a61c98e86203dbf4fd7ec7619d07af2ad957b9ef4  guix-build-849a1f5c7b77/output/x86_64-apple-darwin/SHA256SUMS.part
    6d6433cf54052308bd632c2f093260d355c51386e6751977a5a25a60cad14365e  guix-build-849a1f5c7b77/output/x86_64-apple-darwin/bitcoin-849a1f5c7b77-x86_64-apple-darwin-unsigned.dmg
    7d94dc7e2c4da8b45a36c39b35dda48b960e7c05a59834825215eb64daf5dcf06  guix-build-849a1f5c7b77/output/x86_64-apple-darwin/bitcoin-849a1f5c7b77-x86_64-apple-darwin-unsigned.tar.gz
    8ccda72b619d9bf88c0baca11875ea94091080befc1e19e4031778919ce5f5be1  guix-build-849a1f5c7b77/output/x86_64-apple-darwin/bitcoin-849a1f5c7b77-x86_64-apple-darwin.tar.gz
    
  12. in depends/packages/qt.mk:136 in 849a1f5c7b outdated
    130@@ -131,6 +131,9 @@ $(package)_config_opts_darwin += -no-feature-corewlan
    131 $(package)_config_opts_darwin += -no-freetype
    132 $(package)_config_opts_darwin += QMAKE_MACOSX_DEPLOYMENT_TARGET=$(OSX_MIN_VERSION)
    133 
    134+$(package)_config_opts_aarch64_darwin += "QMAKE_CFLAGS_OPTIMIZE = '-O1'"
    135+$(package)_config_opts_aarch64_darwin += "QMAKE_CFLAGS_OPTIMIZE_FULL = '-O1'"
    136+
    


    hebasto commented at 2:35 pm on August 12, 2022:
    0$(package)_config_opts_aarch64_darwin += "QMAKE_CFLAGS_OPTIMIZE_FULL = -O1"
    

    will be enough. It changes optimization from -O3 to -O1 for the corelib and gui libraries only. Actually, we are interested in the latter only.


    hebasto commented at 2:36 pm on August 12, 2022:
    Also it would be nice to have a comment here.

    fanquake commented at 3:38 pm on August 12, 2022:
    Adjusted and added a comment.
  13. build: optimise arm64 darwin qt build using -O1
    Building at higher optimisation levels causes reproducibility issues
    when building on different architectures.
    08bd338277
  14. fanquake force-pushed on Aug 12, 2022
  15. hebasto approved
  16. hebasto commented at 3:50 pm on August 12, 2022: member
    ACK 08bd3382777bf5d24fa8f32f27abc7b6d1e20dd9
  17. jarolrod commented at 6:13 pm on August 12, 2022: member

    ACK 08bd3382777bf5d24fa8f32f27abc7b6d1e20dd9

    tested the resulting binary

  18. DrahtBot commented at 4:43 am on August 13, 2022: contributor

    Guix builds

    File commit 89b219412495489c870f0117de01ae35ae719395(master) commit ddff43115f347c4539bb9f5c8b095c2d125082da(master and this pull)
    SHA256SUMS.part e3a9452b1e8044fd... 052fc422c29a8d08...
    *-aarch64-linux-gnu-debug.tar.gz 2d3114b420076280... d281c93a2ff7abe0...
    *-aarch64-linux-gnu.tar.gz 19feba687e1615d4... 6154f60793d52b02...
    *-arm-linux-gnueabihf-debug.tar.gz 405177f244490763... 611e4f02f63d0365...
    *-arm-linux-gnueabihf.tar.gz b876ab5d28d1fabb... b193d57b46f26066...
    *-arm64-apple-darwin-unsigned.dmg 23c21420974ba4ae... 2f99420618f475ae...
    *-arm64-apple-darwin-unsigned.tar.gz 5d19cd1f2df1e62d... c613cb09f839c201...
    *-arm64-apple-darwin.tar.gz 5481ee4cbe397156... 2107a881e1e3aa71...
    *-powerpc64-linux-gnu-debug.tar.gz b6d5dc0a1df19ea9... 2d58d9844791c5ed...
    *-powerpc64-linux-gnu.tar.gz 9b8e7f8835e1c467... 386849055992d2ea...
    *-powerpc64le-linux-gnu-debug.tar.gz 893f7d601e0f0b4e... f9236f7739927d72...
    *-powerpc64le-linux-gnu.tar.gz 982f5c709f807f18... 3e189f8d2d71da95...
    *-riscv64-linux-gnu-debug.tar.gz 7f409bfda60cb875... e2db9522de0998a9...
    *-riscv64-linux-gnu.tar.gz 78215a6a3307a63d... 0b56b5f0401934d3...
    *-win64-debug.zip 4411980cbcb50310... 23c46747d8746bd0...
    *-win64-setup-unsigned.exe d89532536e471983... 0fbdd462cb81dff2...
    *-win64-unsigned.tar.gz dc7a7cced23fb64e... a42ef1d9a28992f6...
    *-win64.zip 5beaeb4d5583c4c1... 2d806be66c6fdbd2...
    *-x86_64-apple-darwin-unsigned.dmg 41300344fb6ed262... 0ed3f6fb4975996a...
    *-x86_64-apple-darwin-unsigned.tar.gz f760bae7a0eca54e... 3e4b2b5d022fa1c6...
    *-x86_64-apple-darwin.tar.gz 3364e5e37527db8d... 1ba257585386028e...
    *-x86_64-linux-gnu-debug.tar.gz 7a72829c6c7bcd41... 433243ab584b0b53...
    *-x86_64-linux-gnu.tar.gz f03c2b7f60e0c8b8... 0a174ec0bb806edb...
    *.tar.gz 67ec6747ac147ea4... 685414022edbc972...
    guix_build.log dc856d7a7f48a905... d855535de7ded8fd...
    guix_build.log.diff 3e5e07c6c0e181a2...
  19. DrahtBot removed the label DrahtBot Guix build requested on Aug 13, 2022
  20. bitcoin deleted a comment on Aug 13, 2022
  21. fanquake merged this on Aug 13, 2022
  22. fanquake closed this on Aug 13, 2022

  23. fanquake deleted the branch on Aug 13, 2022
  24. sidhujag referenced this in commit a63b93054b on Aug 15, 2022
  25. fanquake added this to the milestone 24.0 on Sep 15, 2022
  26. bitcoin locked this on Sep 15, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-06-29 07:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me