depends: CMake invocation cleanup #19685

pull dongcarl wants to merge 5 commits into bitcoin:master from dongcarl:2020-08-depends-misc changing 3 files +11 −6
  1. dongcarl commented at 1:00 am on August 8, 2020: member
    • Use $($(package)_cmake) instead of invoking cmake directly
    • Use well-known env vars instead of overriding CMake variables
  2. depends: Use $($(package)_cmake) instead of cmake 3ecf0eca63
  3. depends: More robust cmake invocation
    Specify well-known env vars instead of using a workaround to split up CC
    and CXX.
    8c7cd0c6d9
  4. dongcarl added the label Build system on Aug 8, 2020
  5. MarcoFalke added the label Needs gitian build on Aug 8, 2020
  6. MarcoFalke added the label Needs Guix build on Aug 8, 2020
  7. DrahtBot commented at 3:50 am on August 9, 2020: member

    Guix builds

    File commit 4b705b1c98f60ab736df98d62a8d4988f61678d5(master) commit dd4a33744b046f65d524b9a8245806e216da1d04(master and this pull)
    *-aarch64-linux-gnu-debug.tar.gz 7166f9d857e0beb3... e79f20c0b5ef525e...
    *-aarch64-linux-gnu.tar.gz b41a668d77e98e8a... d9614c3a2450c2db...
    *-arm-linux-gnueabihf-debug.tar.gz 96451f6f65702fdc... d2e8d52a6a19c8c2...
    *-arm-linux-gnueabihf.tar.gz 7de1306dfbe540a4... e96b9030cdf76f21...
    *-riscv64-linux-gnu-debug.tar.gz 19b4bf2bab5c713b... 39aea6ae56d8ba32...
    *-riscv64-linux-gnu.tar.gz 640f95fea6056d32... 87aab213f5983975...
    *-win-unsigned.tar.gz 733b9c59a0c0de46... 845e0f3dfe3763f3...
    *-win64-debug.zip cc5b9f59f0b7ccdf... 74c0d5a545ac9d15...
    *-win64-setup-unsigned.exe 1529ca094f7042eb... 5144bd5f06d99a5b...
    *-win64.zip 3d91c73314927262... 8cfea9922721d0ba...
    *-x86_64-linux-gnu-debug.tar.gz 697a9e8329e58c73... bc8001a2341d0c5c...
    *-x86_64-linux-gnu.tar.gz 4a4a75fd54a32041... d85022e7651a1f3d...
    *.tar.gz 863a380cc97a348c... b83af45bb80e8ad3...
    guix_build.log 6c70fec424aa8e86... a8454e851dc9d2c0...
    guix_build.log.diff 0e1c3d9801c966c3...
  8. DrahtBot removed the label Needs Guix build on Aug 9, 2020
  9. DrahtBot commented at 0:29 am on August 10, 2020: member

    Gitian builds

    File commit e349eeeb2c9219908686f430b3d74d1b2d5c1106(master) commit adeefd4a61adf483423969ef5fbeed836a6cf961(master and this pull)
    bitcoin-core-linux-0.21-res.yml 0372e71b46f9d40f... b9e1666aecfaafa0...
    bitcoin-core-osx-0.21-res.yml 4f923c053e78ef5e... da4e9481bbe31c84...
    bitcoin-core-win-0.21-res.yml 7a08e17dd15907f2... 5f6f5160bfeeacdb...
    *-aarch64-linux-gnu-debug.tar.gz 1a8a9205d549cab5... 7aa17c216a83bee1...
    *-aarch64-linux-gnu.tar.gz 2bcce0777ecbc17b... 8d226aa2a22b28de...
    *-arm-linux-gnueabihf-debug.tar.gz 0cbe42a72681e406... f0392e393e967b0d...
    *-arm-linux-gnueabihf.tar.gz 951b6567da5d8704... 28f8c3b66df45352...
    *-osx-unsigned.dmg 974bde7a4f342f60... ac24bdd5810d4d92...
    *-osx64.tar.gz cf93dde281a4e117... 509c21259796f8df...
    *-riscv64-linux-gnu-debug.tar.gz e63d0e4944f3805d... 949702d0f003e967...
    *-riscv64-linux-gnu.tar.gz 3222f97768080388... d335cb170a0edefb...
    *-win64-debug.zip aa92bd07339a7aeb... 45d1f772ccb6daad...
    *-win64-setup-unsigned.exe 193b161053b71ddc... b1a647fb85ad3028...
    *-win64.zip 2a263b5a2e06c4d9... e32ee7a013ee1152...
    *-x86_64-linux-gnu-debug.tar.gz bb51dfd2db8dbbe6... fc9ad674819014ad...
    *-x86_64-linux-gnu.tar.gz 0bbeb146a04fb504... 571973663029dfbd...
    *.tar.gz f172e2db5f1742fd... 59ac8ad405932cea...
    linux-build.log a43872b660fbbc1b... 12f03158aade41f4...
    osx-build.log 90c5e013fb2ebb9b... 417a0564d02d6ca3...
    win-build.log a1a826271b9ac0b4... 8cc5545298301cd8...
    bitcoin-core-linux-0.21-res.yml.diff 5cfca0aae5e3a7f5...
    bitcoin-core-osx-0.21-res.yml.diff ec27540431bee8d9...
    bitcoin-core-win-0.21-res.yml.diff 3698ec4789f04b3f...
    linux-build.log.diff 8454299b662fdccc...
    osx-build.log.diff cc526a43ee86467f...
    win-build.log.diff aaa779c52514d673...
  10. DrahtBot removed the label Needs gitian build on Aug 10, 2020
  11. fanquake commented at 7:54 am on August 10, 2020: member
    Concept ACK. @ryanofsky could you take a look re multiprocess.
  12. in depends/funcs.mk:163 in 8c7cd0c6d9 outdated
    156@@ -157,12 +157,12 @@ ifneq ($($(1)_ldflags),)
    157 $(1)_autoconf += LDFLAGS="$$($(1)_ldflags)"
    158 endif
    159 
    160-$(1)_cmake=cmake -DCMAKE_INSTALL_PREFIX=$($($(1)_type)_prefix)
    161+$(1)_cmake=env CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" CFLAGS="$$($(1)_cflags)" CXXFLAGS="$$($(1)_cxxflags)" cmake -DCMAKE_INSTALL_PREFIX:PATH=$($($(1)_type)_prefix)
    162 ifneq ($($(1)_type),build)
    163 ifneq ($(host),$(build))
    164-$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system) -DCMAKE_SYSROOT=$(host_prefix)
    


    ryanofsky commented at 4:29 pm on August 12, 2020:

    In commit “depends: More robust cmake invocation” (8c7cd0c6d9f295bcb6913e3c69c9dac4ce2b25ce)

    Note: Seems to makes sense -DCMAKE_SYSROOT setting here can be dropped if cmake picks up sysroot from CC/CXX variables. It apparently does if I run make -C depends HOST=x86_64-apple-darwin16 MULTIPROCESS=1 NO_QT=1 V=1 libmultiprocess_built, looking at CMAKE_CXX_COMPILER_ARG1 in CMakeCache.txt

    I am still unsure of when we should and shouldn’t use sysroot (https://github.com/bitcoin/bitcoin/issues/18915), but as long as values that are set are passed along that’s probably good.

  13. ryanofsky approved
  14. ryanofsky commented at 5:06 pm on August 12, 2020: member
    Code review ACK 8c7cd0c6d9f295bcb6913e3c69c9dac4ce2b25ce. Looks good, and I tested the native linux and linux->mac cross builds. It would have made sense to favor using CC/CXX environment variables over -DCMAKE_C_COMPILER and -DCMAKE_CXX_COMPILER for cmake cross compiles in #18677, but I didn’t know at the time that cmake actually used these environment variables: https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html
  15. depends: Cleanup CMake invocation 8e121e5509
  16. depends: Prepend CPPFLAGS to C{,XX}FLAGS for CMake
    This is similar to how we do it for qt.mk.
    b3f541f618
  17. depends: Specify LDFLAGS to cmake as well b893688357
  18. dongcarl commented at 7:41 pm on August 18, 2020: member
    Took another look and found a few very simple things I can add. Sorry for invalidating reviews @ryanofsky
  19. dongcarl added the label Needs gitian build on Aug 18, 2020
  20. dongcarl added the label Needs Guix build on Aug 18, 2020
  21. DrahtBot commented at 1:14 pm on August 22, 2020: member

    Gitian builds

    File commit e9b30126545d6ddd8772363e4079d1e4908ad117(master) commit 9bcab79d3397123a5bba0c6e67809c8d7429ce8d(master and this pull)
    bitcoin-core-linux-0.21-res.yml cea1ba265603d02f... 79fcfe88f6c9f421...
    bitcoin-core-osx-0.21-res.yml 77d7884f6a574134... 2b58e9a46bc9cd98...
    bitcoin-core-win-0.21-res.yml 0b0f6bbbd9a5c0ef... c8e9bc95cd44836b...
    *-aarch64-linux-gnu-debug.tar.gz 4ed42dd1dc70bea9... 5cfc51a821d8c415...
    *-aarch64-linux-gnu.tar.gz 8a7a6ef9cccbae35... b34d71d590bf482d...
    *-arm-linux-gnueabihf-debug.tar.gz e40e4858ee8bd4d1... 8dbdd5182bf9b7ea...
    *-arm-linux-gnueabihf.tar.gz 7ddca7cad75ef53b... 434bc8e242ed464a...
    *-osx-unsigned.dmg 79a2858ea685e8b0... d8c6d588e46e1e87...
    *-osx64.tar.gz e77905a2f3abb599... e3b303bc5673de88...
    *-riscv64-linux-gnu-debug.tar.gz 4ccc4f940f998b62... 62b08797adb775df...
    *-riscv64-linux-gnu.tar.gz 561c5ed7ebaf0ea5... 36ef473441506df1...
    *-win64-debug.zip e0b30b67a2217a50... b8af63844191d264...
    *-win64-setup-unsigned.exe 3e5025cde6a4d3d5... 83458af5fc9d0879...
    *-win64.zip caee7761af12305b... c5f0cb64cd9c944e...
    *-x86_64-linux-gnu-debug.tar.gz 4036b1cb7c0177b0... d6c34fc426fa4735...
    *-x86_64-linux-gnu.tar.gz e15879353155c44c... a1d71ca983461eba...
    *.tar.gz e8cbb99f0f9f02a0... cd0f1b5bc4a42bb3...
    linux-build.log 43933168846d907b... e3acec54b5912899...
    osx-build.log f0d612ea7fbc1c07... 1a80d9948402e1b3...
    win-build.log 54a3cd2d3d8f9dd4... 77eb45af6bcbe821...
    bitcoin-core-linux-0.21-res.yml.diff cb59f8c6212eb61a...
    bitcoin-core-osx-0.21-res.yml.diff 9cdb93e7ab76b049...
    bitcoin-core-win-0.21-res.yml.diff 7daaf540c8f0b89f...
    linux-build.log.diff 48a8716c113c8afd...
    osx-build.log.diff ef9cf83c177dc970...
    win-build.log.diff 972a3fcb1afed1a7...
  22. DrahtBot removed the label Needs gitian build on Aug 22, 2020
  23. DrahtBot commented at 8:41 pm on August 24, 2020: member

    Guix builds

    File commit 197450f80868fe752c6107955e5da80704212b34(master) commit 2deadc0dd5b7638f1fa092e0af2b0c9f756dd750(master and this pull)
    *-aarch64-linux-gnu-debug.tar.gz 8943872ac3d5df7c... dcd8b6876032eddb...
    *-aarch64-linux-gnu.tar.gz 7307c4ee3d4934bd... dfe62392f391e516...
    *-arm-linux-gnueabihf-debug.tar.gz fccc26d7c7dfa90b... 7c3b67f683846da0...
    *-arm-linux-gnueabihf.tar.gz 34e1140f65a0f606... 79cf3f300a4844d3...
    *-riscv64-linux-gnu-debug.tar.gz a94385d318571b00... d773b917d0fd0246...
    *-riscv64-linux-gnu.tar.gz 3abb016b01e33949... aadb507dd10a561a...
    *-win-unsigned.tar.gz f35d661c7f1bbdae... ec6b208ece6d8d11...
    *-win64-debug.zip 62437d10c94cfef6... 716455789c2e80e7...
    *-win64-setup-unsigned.exe 5e2b6831dd645b79... bb859d1c6dc47a5e...
    *-win64.zip c9829996dc3386f5... f8f6e54b084001d1...
    *-x86_64-linux-gnu-debug.tar.gz effc996453960003... 147de28b6b81f20f...
    *-x86_64-linux-gnu.tar.gz 7ef18c4f4cd4f2e2... fc0154fcdca968f0...
    *.tar.gz 5c60a590f5e9971c... ba72c4ff88c31457...
    guix_build.log 3eca0392f5149475... 85ba55336e64951b...
    guix_build.log.diff e05f02ebeb39c23d...
  24. DrahtBot removed the label Needs Guix build on Aug 24, 2020
  25. ryanofsky approved
  26. ryanofsky commented at 9:33 pm on August 25, 2020: member
    Code review ACK b8936883573708059357a66f67fad9dc77a8bade. Only changes since last review are new commits adding whitespace, cppflags and ldflags to cmake invocation
  27. fanquake merged this on Sep 2, 2020
  28. fanquake closed this on Sep 2, 2020

  29. sidhujag referenced this in commit 7f101d0ab8 on Sep 3, 2020
  30. ryanofsky commented at 5:27 pm on September 15, 2020: member

    Still confirming but it seems like this PR might be causing an error on travis: “/home/travis/build/bitcoin/bitcoin/depends/x86_64-pc-linux-gnu/share/../native/bin/mpgen: error while loading shared libraries: libcapnpc-0.7.0.so: cannot open shared object file: No such file or directory” error in https://travis-ci.org/github/bitcoin/bitcoin/jobs/726983595#L2545

    Running CI scripts locally, I’m able to reproduce the error. But if I revert the changes in this PR the error goes away. The difference seems to be caused by cmake no longer setting RUNPATH after this PR. With this PR, RUNPATH is empty, but if this PR is reverted, readelf shows:

    0$ readelf -d depends/x86_64-pc-linux-gnu/native/bin/mpgen | grep RUNPATH
    1 0x000000000000001d (RUNPATH)            Library runpath: [/home/russ/src/bitcoin/depends/x86_64-pc-linux-gnu/native/lib]
    

    I need to dig in more but two questions I have are:

    1. Why did travis not catch this problem when this PR was being worked on or after this PR was merged. Is there a cache that we failed to clear? Is there a cache we should be clearing when we update depends scripts in the future? (The travis error above started happening after I pushed a PR update that bumped the depends/packages/native_libmultiprocess.mk package, so I think that accounts for why a cache might have been avoided in the failing run above).

    2. What change in this PR might be clobbering the cmake RUNPATH? If I had to guess it might be happening because the LDFLAGS environment variable was unset previously, but now it is set

  31. fanquake commented at 4:58 am on September 20, 2020: member
    @ryanofsky thanks for following up here. Did your digging turn anything up? I’ve opened #19981 in the interim so this doesn’t get lost.
  32. ryanofsky referenced this in commit 01a7b77360 on Sep 24, 2020
  33. ryanofsky referenced this in commit da6c9b7089 on Sep 30, 2020
  34. ryanofsky referenced this in commit 9fe5c425fd on Oct 1, 2020
  35. ryanofsky referenced this in commit 429e78a909 on Oct 1, 2020
  36. ryanofsky referenced this in commit 4e99aef80d on Oct 1, 2020
  37. ryanofsky referenced this in commit 3c51b6a5d6 on Oct 1, 2020
  38. ryanofsky referenced this in commit 321aeb0bf1 on Oct 2, 2020
  39. ryanofsky referenced this in commit 7d0271b5c3 on Oct 2, 2020
  40. ryanofsky referenced this in commit 3655f304de on Nov 25, 2020
  41. fanquake referenced this in commit 17918a987a on Dec 10, 2020
  42. sidhujag referenced this in commit 7512d370e3 on Dec 10, 2020
  43. DrahtBot locked this on Feb 15, 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-07-03 10:13 UTC

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