build: split libtapi and clang out of native_cctools #21457

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:split_native_cctools changing 5 files +63 −91
  1. fanquake commented at 10:18 am on March 17, 2021: member

    This splits our native cctools package into two additional packages: native_clang and native_libtapi. This is in an effort to not only make our mac toolchain more understandable, but also to reduce duplication, and as a nice side-effect, fix the issue mentioned here.

    Everything about the current build process should remain the same. For gitian, that is:

    • Download LLVM Clang 8.0.0 binary.
    • Build libtapi using downloaded Clang.
    • Build cctools using downloaded Clang and libtapi.
    • Build the rest of depends..

    For Guix (FORCE_USE_SYSTEM_CLANG=1):

    • Build libtapi using using system Clang.
    • Build cctools using system Clang and libtapi.
    • Build the rest of depends..

    After this has been merged, my plan is to combine a modified version of #20454 and #21414 with #19817, and from what I understand that will be enough to support Apple Arm cross compilation.

    Builds at 477ed59f49f39ae4272219a1216ee19fb72fdde5: Guix:

    0find output -type f -name *$(git rev-parse --short HEAD)*.* -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
    17e57b9e5a2109d1a35f0091d86f975c1b1d73ac70ac2609cefbe1134efbf2c87  output/bitcoin-477ed59f49f3-osx-unsigned.dmg
    2dd11e71c2634ac2fa883d1e45cbd6de194fad37624bb56b8b8a6213fd40d6050  output/bitcoin-477ed59f49f3-osx-unsigned.tar.gz
    364384eaa2fd9768992d86a06a1414c9e92e84ba21a875696483df2bb5828e2a2  output/bitcoin-477ed59f49f3-osx64.tar.gz
    48a889e88db952d2c82ef44713c04aba95b777441f578738ff6d8a0d251e51da3  output/src/bitcoin-477ed59f49f3.tar.gz
    

    Gitian:

    0d0eee8542d5f3d662555ad7218d2dc9f3f862656e65bcb2f01f256bfa0deead2  bitcoin-477ed59f49f3-osx-unsigned.dmg
    1ba7bc94897e42e7a037e352c4e4e1730f181c6d76b6d6a2785bbd7bf85614c83  bitcoin-477ed59f49f3-osx-unsigned.tar.gz
    2c4426d1d310a2fbffcaf2b7df0da4ec97bd11aab07085006dae68777b03f6372  bitcoin-477ed59f49f3-osx64.tar.gz
    38a889e88db952d2c82ef44713c04aba95b777441f578738ff6d8a0d251e51da3  src/bitcoin-477ed59f49f3.tar.gz
    4a746831467dc8ff17ec5df06fc9288a859c1961d8c0b632d97b42f080dbd825d  bitcoin-core-osx-22-res.yml
    
  2. fanquake added the label macOS on Mar 17, 2021
  3. fanquake added the label Build system on Mar 17, 2021
  4. fanquake added the label Needs gitian build on Mar 17, 2021
  5. fanquake added the label Needs Guix build on Mar 17, 2021
  6. DrahtBot commented at 12:59 pm on March 17, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    No conflicts as of last run.

  7. dongcarl commented at 0:57 am on March 18, 2021: member
    Concept ACK! So much clearer and glad to hear it fixes problems too!
  8. hebasto commented at 2:12 pm on March 18, 2021: member
    Concept ACK.
  9. hebasto commented at 6:32 pm on March 18, 2021: member

    Approach ACK 477ed59f49f39ae4272219a1216ee19fb72fdde5

    1. Some cleanup suggestions:
     0--- a/depends/packages/native_clang.mk
     1+++ b/depends/packages/native_clang.mk
     2@@ -20,3 +20,8 @@ define $(package)_stage_cmds
     3   cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \
     4   cp -rf lib/clang/$($(package)_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_version)/include/
     5 endef
     6+
     7+define $(package)_postprocess_cmds
     8+  rm bin/llvm-config && \
     9+  rmdir include
    10+endef
    
    0--- a/depends/packages/native_cctools.mk
    1+++ b/depends/packages/native_cctools.mk
    2@@ -32,3 +32,7 @@ endef
    3 define $(package)_stage_cmds
    4   $(MAKE) DESTDIR=$($(package)_staging_dir) install
    5 endef
    6+
    7+define $(package)_postprocess_cmds
    8+  rm -rf share
    9+endef
    
    1. Probably, it is out of this PR scope, but I think we could drop the ld64_disable_threading.patch as it seems that non-determinism was fixed in ld-450.3.

    2. Currently, my only concerns are about the differences in sizes for some files, e.g.:

    • native/bin/x86_64-apple-darwin18-ObjectDump – 833kB on master, 829kB with PR
    • native/bin/x86_64-apple-darwin18-vtool – 86kB on master, 82kB with PR

    UPDATE: Also a style nit – I suggest in new code with the make syntax in variable assignments around = and += with spaces.

  10. DrahtBot commented at 9:08 pm on March 18, 2021: member

    Guix builds

    File commit a9d1b40d53ec417eefbe767aa66701ef8e1801d5(master) commit 7f2d32edc89d64246a515f6ea0816d3b00dcef08(master and this pull)
    *-aarch64-linux-gnu-debug.tar.gz 0f4694caf39317aa... c92b5176f3321f38...
    *-aarch64-linux-gnu.tar.gz 4872f8b786581c1f... 7e475c616776a416...
    *-arm-linux-gnueabihf-debug.tar.gz fa08eaff0bb78361... 02122916990778eb...
    *-arm-linux-gnueabihf.tar.gz a88bba05c3cab057... 3869a295c4c15e9d...
    *-osx-unsigned.dmg d5799e5f579a345d... c960a1a86b929bf2...
    *-osx-unsigned.tar.gz c7f14bae7834fffe... 6a3675a7bfd1168b...
    *-osx64.tar.gz 40d29fe56dae7891... b18912e1ead26335...
    *-powerpc64-linux-gnu-debug.tar.gz ace332f222e916b6... da1dc4c0d0d2a7cf...
    *-powerpc64-linux-gnu.tar.gz 6d677e30960990c2... 175e2c908ef48dd4...
    *-powerpc64le-linux-gnu-debug.tar.gz f1e306c48cbe2c82... db6d5f0d62068806...
    *-powerpc64le-linux-gnu.tar.gz 5da50e25d575b1e3... 739f19efc4d151e2...
    *-riscv64-linux-gnu-debug.tar.gz 6fe18ca4217127c8... 5e985765c1002b61...
    *-riscv64-linux-gnu.tar.gz ff42caf352e66688... a5ebb9a3d670147e...
    *-win-unsigned.tar.gz c0d4021a0d90e6a3... 67372e3cd49933cf...
    *-win64-debug.zip 7d09398b71cf5b5b... 29efc4a8920f21e0...
    *-win64-setup-unsigned.exe f6c43613283493d8... 51814b9454aaa817...
    *-win64.zip 630450b2ccc1cf85... 421534c6db472597...
    *-x86_64-linux-gnu-debug.tar.gz 8584c3ae507df23c... bc5a197708eb612e...
    *-x86_64-linux-gnu.tar.gz c26e44b319ef3a46... 9a314c710c8a7992...
    *.tar.gz 56e411d3291bc111... 619e1328dbfa7701...
    guix_build.log 4fd1141f30716e53... 348afa0ebd89e6fb...
    guix_build.log.diff e7383c741bc5d9f4...
  11. DrahtBot removed the label Needs Guix build on Mar 18, 2021
  12. laanwj commented at 11:28 pm on March 18, 2021: member
    Concept ACK, this seems better organized.
  13. DrahtBot commented at 5:27 pm on March 21, 2021: member

    Gitian builds

    File commit 63952f73b3041468fe3b25fa54858db7899273fa(master) commit cf35e0685d0a5294e4bf40b655f531f45c353a38(master and this pull)
    *-aarch64-linux-gnu-debug.tar.gz 5484237ee5c3fa99... 4b996910a8b0e9e3...
    *-aarch64-linux-gnu.tar.gz 2a05550165b38652... a31eca6967cb7b65...
    *-arm-linux-gnueabihf-debug.tar.gz bfcf00e42246eae3... 53a96e677e6ab17d...
    *-arm-linux-gnueabihf.tar.gz 49401c03ceb458b0... 01c835aa1f641fa0...
    *-osx-unsigned.dmg bb46816571411f20... 3384588ef2363c8c...
    *-osx64.tar.gz 87297fdb1bd1e468... 03f6bc0cff1b8d49...
    *-powerpc64-linux-gnu-debug.tar.gz ef0bc03e9dc3bc9b... 6d19770251be5f0d...
    *-powerpc64-linux-gnu.tar.gz 8b994ad2faf8d00f... 3f97305f18e7c352...
    *-powerpc64le-linux-gnu-debug.tar.gz a21bb50f2a1c6444... 8f781e172a4657c6...
    *-powerpc64le-linux-gnu.tar.gz ac3bbefb3bb763cf... ad739b016529b015...
    *-riscv64-linux-gnu-debug.tar.gz d1127ea1c91d13d2... cc0f43a696733b71...
    *-riscv64-linux-gnu.tar.gz 2a1d70a226aea599... 8c746d36742daff3...
    *-win64-debug.zip 49bb0d62d4d992b1... e6b2bfd80a1216c9...
    *-win64-setup-unsigned.exe 2e31a6942609ae70... 0b69d6eff841809d...
    *-win64.zip eea2a3d2ae87bd94... 11e79e7c5e2d8812...
    *-x86_64-linux-gnu-debug.tar.gz c6ec5e1f93179f02... bb29f9a9dcef789a...
    *-x86_64-linux-gnu.tar.gz 9ec8794caea11319... 92509122ffa514ef...
    *.tar.gz debbf7a0bedc3e02... 4f965a85e8737e3b...
    bitcoin-core-linux-22-res.yml e8cbff85e5387c08... 2e1c7c881f13fa62...
    bitcoin-core-osx-22-res.yml d17361a4da1f9904... 42bb10dbe0eacb68...
    bitcoin-core-win-22-res.yml fbc466bbb012a14d... b39b2e63906782a2...
    linux-build.log bda29ffb8f627075... 39bdcaa5d3641d52...
    osx-build.log 4464f7ec164817d1... bf2e34ce151b6add...
    win-build.log d947d26c42344b85... 33e4f3232ccc50fc...
    bitcoin-core-linux-22-res.yml.diff 79d4deb35923274f...
    bitcoin-core-osx-22-res.yml.diff 7cbf24e83a860d8e...
    bitcoin-core-win-22-res.yml.diff 811e3a3cb711bd1d...
    linux-build.log.diff 7caf82291ba99247...
    osx-build.log.diff 259cbbc5c1e71b9d...
    win-build.log.diff 2a65db8d1dbc6727...
  14. DrahtBot removed the label Needs gitian build on Mar 21, 2021
  15. dongcarl commented at 6:51 pm on March 26, 2021: member
    Light Code-Review ACK 477ed59f49f39ae4272219a1216ee19fb72fdde5 Tested on Arch Linux both with and without FORCE_USE_SYSTEM_CLANG=1
  16. build: split native_cctools 765e0be534
  17. fanquake force-pushed on Mar 30, 2021
  18. fanquake commented at 6:55 am on March 30, 2021: member

    Rebased and took a couple minor changes.

    Some cleanup suggestions: rm bin/llvm-config && \

    Why? This would delete the llvm-config we just copied into /bin, and you’d end up with:

    0./configure: line 13194: /home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/bin/llvm-config: No such file or directory
    1./configure: line 13195: /home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/bin/llvm-config: No such file or directory
    2checking for lto_get_version in -lLTO... no
    

    when configuring native_cctools.

    Probably, it is out of this PR scope, but I think we could drop the ld64_disable_threading.patch as it seems that non-determinism was fixed in ld-450.3.

    Yes that’s out of scope here, and from those links it’s not exactly clear to me that all the determinism issues have been fixed. Could be looked at as part of #19817.

    Currently, my only concerns are about the differences in sizes for some files, e.g.:

    I had a look, and I’m pretty sure that’s just due to runpath differences, i.e master:

    00x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/native_cctools/55562e4073dea0fbfd0b20e0bf69ffe6390c7f97-93268e656c0/toolchain/lib:/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/native_cctools/55562e4073dea0fbfd0b20e0bf69ffe6390c7f97-93268e656c0/lib:/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/native_cctools/55562e4073dea0fbfd0b20e0bf69ffe6390c7f97-93268e656c0/lib64:/home/ubuntu/bitcoin/depends/work/build/x86_64-apple-darwin18/native_cctools/55562e4073dea0fbfd0b20e0bf69ffe6390c7f97-93268e656c0/lib32]
    

    vs this PR:

    00x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/lib]
    
  19. fanquake commented at 7:25 am on March 30, 2021: member

    Guix builds:

    06de9f9d2b829c10f2f9e8ceb96a14d77af3a5fc0038454809807b5de7477fdfb  output/bitcoin-765e0be5347e-osx-unsigned.dmg
    171cdfe7d7dd59c7061832e981380778808c2ba5a1a0f677795cd62262f797b4a  output/bitcoin-765e0be5347e-osx-unsigned.tar.gz
    2cb596fc85531a9d85ee08c9a6442d953071e50d2e70b4ab96f4be6bea342b766  output/bitcoin-765e0be5347e-osx64.tar.gz
    3f3d6a45c120a613ccc4256637d65b500fd38ee1588020d406c573677d40d6509  output/src/bitcoin-765e0be5347e.tar.gz
    

    Gitian builds:

    0aa9d65412d8c0ffccfc31997011e6991b58da537b9dcb6ecf8c6c1da30a47356  bitcoin-765e0be5347e-osx-unsigned.dmg
    1bca8f720ad30a900ef96235e4c411674e6717e48290923f3a5afbc6542933d12  bitcoin-765e0be5347e-osx-unsigned.tar.gz
    22330223c676f18270765b62dcba2564701f12ea109add64a577f3998c9760434  bitcoin-765e0be5347e-osx64.tar.gz
    3f3d6a45c120a613ccc4256637d65b500fd38ee1588020d406c573677d40d6509  src/bitcoin-765e0be5347e.tar.gz
    44ff786f4fad80af69734dd34c7e0ae86c28e3bc7c497f340627a716c0aa209b0  bitcoin-core-osx-22-res.yml
    
  20. dongcarl commented at 5:27 pm on March 30, 2021: member
    reACK 765e0be5347e9d85cee03255204d94119e4cbf38
  21. hebasto commented at 6:39 pm on March 30, 2021: member

    Guix build:

    0$ find output -type f -name *$(git rev-parse --short HEAD)*.* -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
    16de9f9d2b829c10f2f9e8ceb96a14d77af3a5fc0038454809807b5de7477fdfb  output/bitcoin-765e0be5347e-osx-unsigned.dmg
    271cdfe7d7dd59c7061832e981380778808c2ba5a1a0f677795cd62262f797b4a  output/bitcoin-765e0be5347e-osx-unsigned.tar.gz
    3cb596fc85531a9d85ee08c9a6442d953071e50d2e70b4ab96f4be6bea342b766  output/bitcoin-765e0be5347e-osx64.tar.gz
    4f3d6a45c120a613ccc4256637d65b500fd38ee1588020d406c573677d40d6509  output/src/bitcoin-765e0be5347e.tar.gz
    

    Gitian build

    0Generating report
    1aa9d65412d8c0ffccfc31997011e6991b58da537b9dcb6ecf8c6c1da30a47356  bitcoin-765e0be5347e-osx-unsigned.dmg
    2bca8f720ad30a900ef96235e4c411674e6717e48290923f3a5afbc6542933d12  bitcoin-765e0be5347e-osx-unsigned.tar.gz
    32330223c676f18270765b62dcba2564701f12ea109add64a577f3998c9760434  bitcoin-765e0be5347e-osx64.tar.gz
    4f3d6a45c120a613ccc4256637d65b500fd38ee1588020d406c573677d40d6509  src/bitcoin-765e0be5347e.tar.gz
    5e23a162479e60ccde6a01c1a9c47c05e84c6b62ce381102fba6e61b6aed17777  bitcoin-core-osx-22-res.yml
    6Done.
    

    Keeping testing for now…

  22. hebasto commented at 7:36 pm on March 30, 2021: member

    Why? This would delete the llvm-config we just copied into /bin, and you’d end up with:

    Right. I overlooked that.

  23. hebasto approved
  24. hebasto commented at 7:39 pm on March 30, 2021: member
    ACK 765e0be5347e9d85cee03255204d94119e4cbf38, verified building of the native_cctools package step-by-step.
  25. fanquake merged this on Mar 31, 2021
  26. fanquake closed this on Mar 31, 2021

  27. sidhujag referenced this in commit 621eab9ff7 on Mar 31, 2021
  28. kittywhiskers referenced this in commit 1fb2275663 on Aug 24, 2021
  29. kittywhiskers referenced this in commit ef50465864 on Aug 24, 2021
  30. kittywhiskers referenced this in commit c9fca85689 on Aug 24, 2021
  31. kittywhiskers referenced this in commit 9339dec6a0 on Aug 24, 2021
  32. kittywhiskers referenced this in commit 1019f0ab96 on Aug 24, 2021
  33. kittywhiskers referenced this in commit 4895dc3fcd on Aug 24, 2021
  34. kittywhiskers referenced this in commit 0ffe2a045a on Aug 24, 2021
  35. kittywhiskers referenced this in commit 20bed0d844 on Aug 24, 2021
  36. kittywhiskers referenced this in commit 5ee4fb263b on Aug 25, 2021
  37. kittywhiskers referenced this in commit f165a7bcab on Aug 25, 2021
  38. kittywhiskers referenced this in commit 573210aade on Aug 26, 2021
  39. kittywhiskers referenced this in commit 77beaa5cb9 on Aug 26, 2021
  40. kittywhiskers referenced this in commit db94975cfd on Aug 26, 2021
  41. kittywhiskers referenced this in commit 845f72e33a on Aug 27, 2021
  42. kittywhiskers referenced this in commit 2385d5dedd on Aug 30, 2021
  43. kittywhiskers referenced this in commit 19472e37a9 on Sep 1, 2021
  44. kittywhiskers referenced this in commit f3e83245e5 on Sep 1, 2021
  45. kittywhiskers referenced this in commit 4461fbb9f0 on Sep 1, 2021
  46. kittywhiskers referenced this in commit 4f0de0e27f on Sep 2, 2021
  47. kittywhiskers referenced this in commit d9f5fc1824 on Sep 3, 2021
  48. kittywhiskers referenced this in commit 1d6e8c32c4 on Sep 3, 2021
  49. kittywhiskers referenced this in commit 655cc2294a on Sep 3, 2021
  50. kittywhiskers referenced this in commit 8c1975e27d on Sep 4, 2021
  51. DeckerSU referenced this in commit a1be9b834f on Nov 16, 2021
  52. TheComputerGenie referenced this in commit 5f93d61885 on Jan 5, 2022
  53. gades referenced this in commit 8452f7ade8 on May 4, 2022
  54. DrahtBot locked this on Aug 16, 2022
  55. fanquake deleted the branch on Nov 9, 2022

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-11-17 15:12 UTC

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