depends: Set CMAKE_INSTALL_RPATH for native packages #20046

pull ryanofsky wants to merge 1 commits into bitcoin:master from ryanofsky:pr/ipc-rpath changing 1 files +3 −1
  1. ryanofsky commented at 2:24 pm on September 30, 2020: member

    This PR is part of the process separation project.


    After #19685 started setting LDFLAGS, the INSTALL_RPATH_USE_LINK_PATH cmake option used in the libmultiprocess build no longer works, so it is neccessary to set CMAKE_INSTALL_RPATH as a fallback.

    It’s unclear currently whether the bad interaction between INSTALL_RPATH_USE_LINK_PATH and LDFLAGS is a bug, but the issue is reported:

    Fixes #19981

  2. depends: Set CMAKE_INSTALL_RPATH for native packages
    After #19685 started setting LDFLAGS, the INSTALL_RPATH_USE_LINK_PATH cmake
    option used in the libmultiprocess build no longer works, so it is neccessary
    to set CMAKE_INSTALL_RPATH as a fallback.
    
    It's unclear currently whether the bad interaction between
    INSTALL_RPATH_USE_LINK_PATH and LDFLAGS is a bug, but the issue is reported:
    
      https://github.com/bitcoin/bitcoin/issues/19981#issuecomment-696680877
      https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892
    
    Commands useful for building / testing this change
    
      make -C depends MULTIPROCESS=1 print-libmultiprocess_cmake
      make -C depends MULTIPROCESS=1 print-native_libmultiprocess_cmake
      make -C depends MULTIPROCESS=1 HOST=x86_64-apple-darwin16 print-libmultiprocess_cmake
    
      rm -rvf depends/x86_64-pc-linux-gnu/native depends/work/staging depends/work/build
      make -C depends MULTIPROCESS=1 V=1 native_libmultiprocess_staged
      for f in `find -name mpgen`; do echo == $f ==; readelf -d $f | grep -i path; done
    
      make -C depends MULTIPROCESS=1 V=1 native_libmultiprocess_built
      find -name CMakeCache.txt
    
    Fixes #19981
    7d0271b5c3
  3. ryanofsky commented at 2:29 pm on September 30, 2020: member

    This commit was originally part of #19160 but I’m making it a standalone PR because it seems to be causing travis timeouts on the macOS 10.12 build that I don’t know how to fix:

  4. MarcoFalke added the label Needs gitian build on Sep 30, 2020
  5. MarcoFalke added the label Needs Guix build on Sep 30, 2020
  6. ryanofsky commented at 3:41 pm on September 30, 2020: member

    Reproduced the travis macOS 10.12 timeout again:

  7. MarcoFalke commented at 4:59 pm on September 30, 2020: member
    The build is probably failing altogether. For temporary debugging, you can remove the &> "/dev/null". Though, the &> "/dev/null" can’t be removed from master, because other builds would fail on travis due to too much output.
  8. ryanofsky referenced this in commit d9dc091b25 on Sep 30, 2020
  9. ryanofsky commented at 10:48 pm on September 30, 2020: member

    Thanks @MarcoFalke! It still looks to me that this PR might be uncovering a pre-existing problem with the macOS 10.12 build, and not actually causing the failure. Removing >/dev/null in d9dc091b257e9736d67ca8eeecbaf2da6682a3e5 shows the error “configure: error: Qt5Core >= 5.5.1 not found” (https://travis-ci.org/github/bitcoin/bitcoin/jobs/731743605#L2010) with debug output:

     0configure:27263: checking for QT_CORE
     1configure:27270: $PKG_CONFIG --exists --print-errors "${qt_lib_prefix}Core $qt_version"
     2Package Qt5Core was not found in the pkg-config search path.
     3Perhaps you should add the directory containing `Qt5Core.pc'
     4to the PKG_CONFIG_PATH environment variable
     5No package 'Qt5Core' found
     6configure:27273: $? = 1
     7configure:27287: $PKG_CONFIG --exists --print-errors "${qt_lib_prefix}Core $qt_version"
     8Package Qt5Core was not found in the pkg-config search path.
     9Perhaps you should add the directory containing `Qt5Core.pc'
    10to the PKG_CONFIG_PATH environment variable
    11No package 'Qt5Core' found
    12configure:27290: $? = 1
    13configure:27304: result: no
    14No package 'Qt5Core' found
    15configure:27329: error: Qt5Core >= 5.5.1 not found
    

    (https://travis-ci.org/github/bitcoin/bitcoin/jobs/731743605#L5266)

    It’s good to have a starting point for debugging this, but am I wrong that this problem could be happening in master but masked by travis caching? @dongcarl’s PR #19683 also has a failing macOS 10.12 build https://travis-ci.org/github/bitcoin/bitcoin/jobs/730372585, but it seems to be failing with a different problem a little earlier so it’s unclear if this Qt5Core error would happen there

  10. dongcarl commented at 10:59 pm on September 30, 2020: member
    FWIW I’m fairly certain the failure in #19683 is unrelated. As it’s due to over-specifying -fuse-ld= which clang treats as a -Wunused-command-line-argument warning, but because we also have -Werror on, it turns into an error.
  11. ryanofsky commented at 11:03 pm on September 30, 2020: member

    FWIW I’m fairly certain the failure in #19683 is unrelated. As it’s due to over-specifying -fuse-ld= which clang treats as a -Wunused-command-line-argument warning, but because we also have -Werror on, it turns into an error.

    I’m also sure it’s unrelated. But since it happens before my error, if you fix it you might see the same problem there

  12. ryanofsky commented at 0:46 am on October 1, 2020: member

    It does appear the Qt5Core error is not related to the change in this PR. If I revert the original commit da6c9b7089d2cd0f5380d64882bd18f8794675f1, and just add a comment to funcs.mk 7472ee73d1541d822048c53157adc5030fbef5be, the error still happens: configure: error: Qt5Core >= 5.5.1 not found:

    However, it turns out the Qt5Core error isn’t limited to the macOS 10.12 build, but also happens on the CentOS 7 build:

    Which suggests the Qt5Core error is not related to the original macOS 10.12 timeouts #20046 (comment) and #20046 (comment), but maybe is caused by removing >/dev/null in d9dc091b257e9736d67ca8eeecbaf2da6682a3e5, or maybe is caused by more recent changes to master, or caused by other changes on travis. I guess I will try reverting the >/dev/null change d9dc091b257e9736d67ca8eeecbaf2da6682a3e5 to see if the timeout returns.

  13. ryanofsky referenced this in commit 9aa445de3f on Oct 1, 2020
  14. ryanofsky commented at 0:55 am on October 1, 2020: member
    I think I see why the Qt5Core error is happening. I was trying to debug in https://github.com/bitcoin/bitcoin/commit/d9dc091b257e9736d67ca8eeecbaf2da6682a3e5 by replacing source ./ci/test/05_before_script.sh &> "/dev/null" with source ./ci/test/05_before_script.sh &, but actually I need to drop the trailing & character, otherwise the before_script command doesn’t block at all.
  15. ryanofsky referenced this in commit e5d6dd0050 on Oct 1, 2020
  16. ryanofsky force-pushed on Oct 1, 2020
  17. ryanofsky force-pushed on Oct 1, 2020
  18. ryanofsky commented at 2:48 am on October 1, 2020: member

    After pushing e5d6dd00509d84de788d9f9f2d5511e2fe7c4c40, was able to reproduce the original macOS 10.12 error and get debug information: https://travis-ci.org/github/bitcoin/bitcoin/jobs/731786312#L4517. The error was CMake Error: TRY_RUN() invoked in cross-compiling mode building the native_cdrkit package


    Added 1 commits da6c9b7089d2cd0f5380d64882bd18f8794675f1 -> d9dc091b257e9736d67ca8eeecbaf2da6682a3e5 (pr/ipc-rpath.1 -> pr/ipc-rpath.2, compare) removing >/dev/null to try to debug macOS 10.12 timeout #20046 (comment) Added 2 commits d9dc091b257e9736d67ca8eeecbaf2da6682a3e5 -> 7472ee73d1541d822048c53157adc5030fbef5be (pr/ipc-rpath.2 -> pr/ipc-rpath.3, compare) reverting rpath fix to try to debug new Qt5Core error #20046 (comment) Added 1 commits 7472ee73d1541d822048c53157adc5030fbef5be -> 9aa445de3f794a92b5e6d0bc21cd854fa2c69619 (pr/ipc-rpath.3 -> pr/ipc-rpath.4, compare) adding back >/dev/null to try to reproduce original timeout Updated 9aa445de3f794a92b5e6d0bc21cd854fa2c69619 -> e5d6dd00509d84de788d9f9f2d5511e2fe7c4c40 (pr/ipc-rpath.4 -> pr/ipc-rpath.5, compare) restoring original fix and removing >/dev/null correctly to debug the timeout #20046 (comment) Updated e5d6dd00509d84de788d9f9f2d5511e2fe7c4c40 -> 9fe5c425fd70299ee3c43977d14cbee60da4985f (pr/ipc-rpath.5 -> pr/ipc-rpath.6, compare) with fix for native_cdrkit error https://travis-ci.org/github/bitcoin/bitcoin/jobs/731786312#L4517 Updated 9fe5c425fd70299ee3c43977d14cbee60da4985f -> 3c51b6a5d65fa80f6d69b82415935998406c8fef (pr/ipc-rpath.6 -> pr/ipc-rpath.7, compare) fixing broken rpath error fix error https://travis-ci.org/github/bitcoin/bitcoin/jobs/731808080#L2547-L2548 in #19160 pr/ipc-echo.15 Updated 3c51b6a5d65fa80f6d69b82415935998406c8fef -> 7d0271b5c30f86e4af175a5ab7df5e593cd85195 (pr/ipc-rpath.7 -> pr/ipc-rpath.8, compare) tweaking cmake config to limit rpath override

  19. fanquake added the label Build system on Oct 1, 2020
  20. DrahtBot commented at 4:51 am on October 1, 2020: member

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

    Conflicts

    No conflicts as of last run.

  21. ryanofsky force-pushed on Oct 1, 2020
  22. DrahtBot commented at 7:52 am on October 2, 2020: member

    Gitian builds

    File commit 3487e421a7fef4b28381efcf21a7e38483946cec(master) commit 6ca87c668789f3d8055a5c5421083f4a4cd3b6ef(master and this pull)
    *-aarch64-linux-gnu-debug.tar.gz 610763669e7e3cb7... 34335c1e8d7c8334...
    *-aarch64-linux-gnu.tar.gz 51812ca091622ed9... 9c28ba334251bf91...
    *-arm-linux-gnueabihf-debug.tar.gz f93c0427cd047290... 7500d6627c1f5d96...
    *-arm-linux-gnueabihf.tar.gz 6df65db3f3a7a123... e1079a63632749a8...
    *-osx-unsigned.dmg 0d4a4bf011b2019e... e389a17592bf3da8...
    *-osx64.tar.gz 0aa9fd6f4187d33f... 0719471b1851b0db...
    *-riscv64-linux-gnu-debug.tar.gz 58914f8feac72537... 3469a5e1ef37600b...
    *-riscv64-linux-gnu.tar.gz 1a30336e17f7cd6b... 070aa8c518addc1d...
    *-win64-debug.zip 2f06f34ffd627e79... 66bbfe781d22f8b0...
    *-win64-setup-unsigned.exe f23026e90602164d... 8ee1517a5e05a3df...
    *-win64.zip 8d3acee5e2584d3b... ae101a767508cf73...
    *-x86_64-linux-gnu-debug.tar.gz be688faf54cfea87... 90d8f0aa5ced4381...
    *-x86_64-linux-gnu.tar.gz 2a78323df8c70758... 1fadb805aa18d8eb...
    *.tar.gz 7bf0d038afb59072... 0915bc0d2f202929...
    bitcoin-core-linux-0.21-res.yml 2b37aee7c44927ee... d0bd019eaeef4cd4...
    bitcoin-core-osx-0.21-res.yml 1c3793321abc2f61... 489d46caee641f4b...
    bitcoin-core-win-0.21-res.yml 5de911b923fdda5a... 34e1cee7250d0138...
    linux-build.log e44bb3ce2f5117e8... 10779661ef8ad566...
    osx-build.log 886fd63ccaf3e7cb... 58b0dc61ae802c92...
    win-build.log aba8b79f48c7ff90... 8d4b348a363c1911...
    bitcoin-core-linux-0.21-res.yml.diff a10d0e2d2753becd...
    bitcoin-core-osx-0.21-res.yml.diff 2c17567462e15e52...
    bitcoin-core-win-0.21-res.yml.diff 5c3ba0cf9ba80491...
    linux-build.log.diff 60d9663e736179aa...
    osx-build.log.diff 7eb479dc55998ed3...
    win-build.log.diff 713007ccf7760687...
  23. DrahtBot removed the label Needs gitian build on Oct 2, 2020
  24. ryanofsky force-pushed on Oct 2, 2020
  25. DrahtBot commented at 2:47 pm on October 3, 2020: member

    Guix builds

    File commit 171cd05ae3413e18fd6382572c86f2bb21ab2fd9(master) commit 0dc72add5b576b15598893d9c85eede50bbafd97(master and this pull)
    *-aarch64-linux-gnu-debug.tar.gz 2544005fe8e12a29... d132c023c3ef144c...
    *-aarch64-linux-gnu.tar.gz 6a64024f047f6712... c8f6b3ca54c4ea4f...
    *-arm-linux-gnueabihf-debug.tar.gz 34af46c61f85885e... 1f7a01c83b78bacb...
    *-arm-linux-gnueabihf.tar.gz 8ccbac1b22d99093... 59d5d4e89b063dd2...
    *-riscv64-linux-gnu-debug.tar.gz c24e7fb442464ab4... c4cbfc6ec3386cf2...
    *-riscv64-linux-gnu.tar.gz 19e8824a0d747eb8... c81c7d3b3dce06ec...
    *-win-unsigned.tar.gz e308beda6da7bc73... f02ccf2ab477aecf...
    *-win64-debug.zip b938748c10c3494d... b5b13543a1c3aad6...
    *-win64-setup-unsigned.exe 7e55497679c1410e... ca289a2ac5531559...
    *-win64.zip 92faca401d04a85a... 53b6372cf67c2e3b...
    *-x86_64-linux-gnu-debug.tar.gz 98c8d82ec5cb3b56... cd7ae692c4fbe91e...
    *-x86_64-linux-gnu.tar.gz d7e27b4109831a9d... bd41242f1f983a32...
    *.tar.gz 5218235aa0573680... a18d431f4a2adc2b...
    guix_build.log 68ca6f0f5067a4a6... c4e072bf6c67c11f...
    guix_build.log.diff 3d6dc7810b496376...
  26. DrahtBot removed the label Needs Guix build on Oct 3, 2020
  27. ryanofsky added this to the "In progress" column in a project

  28. ryanofsky requested review from dongcarl on Dec 8, 2020
  29. ryanofsky requested review from fanquake on Dec 8, 2020
  30. fanquake commented at 8:27 am on December 9, 2020: member

    ACK 7d0271b5c30f86e4af175a5ab7df5e593cd85195 - I haven’t looked in depth, but I’ve re-read through #19981 and checked the failure by testing #19160 (with this reverted):

    0  CXX      bitcoin_node-bitcoind.o
    1  CXX      init/bitcoin_node-bitcoin-node.o
    2  GEN      ipc/capnp/echo.capnp.c++
    3/home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/native/bin/mpgen: error while loading shared libraries: libcapnpc-0.7.0.so: cannot open shared object file: No such file or directory
    4make[2]: *** [/home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/native/include/mpgen.mk:4: ipc/capnp/echo.capnp.c++] Error 127
    

    Hopefully our upstream issue will get a reply at some point. Will wait for Carl to comment.

  31. ryanofsky commented at 5:45 pm on December 9, 2020: member
    Thanks for looking fanquake. Note original version of this PR was more complicated and ugly. Now that it’s is just setting CMAKE_INSTALL_RPATH for native packages, I think it’s pretty clean and straightforward. It may even a be good thing to set rpath explicitly and be clear the build looks for depends libraries ahead of system libraries
  32. MarcoFalke added the label Needs gitian build on Dec 9, 2020
  33. dongcarl commented at 9:44 pm on December 9, 2020: member

    ACK 7d0271b Looked into this a bit, it makes sense that for the things we build in depends, we want the library search to start in depends. It seems reasonable to expect this to happen automatically when CMAKE_INSTALL_PREFIX and INSTALL_RPATH_USE_LINK_PATH are set, but oh well…


    I looked into the CMake codebase a bit, but couldn’t find a definite culprit for the weird CMAKE_INSTALL_RPATH_USE_LINK_PATH behaviour. It seems unintended, but we’ll see what the forums say I guess.

  34. fanquake merged this on Dec 10, 2020
  35. fanquake closed this on Dec 10, 2020

  36. sidhujag referenced this in commit 7512d370e3 on Dec 10, 2020
  37. MarcoFalke removed the label Needs gitian build on Dec 10, 2020
  38. ryanofsky moved this from the "In progress" to the "Done" column in a project

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

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