build: Fix configuring depends with cmake #24392

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:220219-cmake changing 1 files +1 −1
  1. hebasto commented at 11:05 AM on February 19, 2022: member

    This PR fixes bitcoin/bitcoin#24389.

    On master (28aa0e3ca0a6cfeb5b2b63929d4bc58de6ee6f02) configuring of the libmultiprocess package for the x86_64-w64-mingw32 target fails:

    $ cd depends
    $ make libmultiprocess_configured MULTIPROCESS=1 HOST=x86_64-w64-mingw32
    Configuring libmultiprocess...
    CMake Warning:
      No source or binary directory provided.  Both will be assumed to be the
      same as the current working directory, but note that this warning will
      become a fatal error in future CMake releases.
    
    
    -- The CXX compiler identification is GNU 9.3.0
    -- Check for working CXX compiler: /usr/bin/x86_64-w64-mingw32-g++-posix
    -- Check for working CXX compiler: /usr/bin/x86_64-w64-mingw32-g++-posix -- broken
    CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message):
      The C++ compiler
    
        "/usr/bin/x86_64-w64-mingw32-g++-posix"
    
      is not able to compile a simple test program.
    
      It fails with the following output:
    
        Change Dir: /home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeTmp
        
        Run Build Command(s):/usr/bin/make cmTC_93273/fast && make[1]: Entering directory '/home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeTmp'
        /usr/bin/make -f CMakeFiles/cmTC_93273.dir/build.make CMakeFiles/cmTC_93273.dir/build
        make[2]: Entering directory '/home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeTmp'
        Building CXX object CMakeFiles/cmTC_93273.dir/testCXXCompiler.cxx.o
        /usr/bin/x86_64-w64-mingw32-g++-posix    -I/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32/include     -pipe -O2    -o CMakeFiles/cmTC_93273.dir/testCXXCompiler.cxx.o -c /home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
        Linking CXX executable cmTC_93273
        /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_93273.dir/link.txt --verbose=1
        /usr/bin/x86_64-w64-mingw32-g++-posix  -I/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32/include     -pipe -O2   -L/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32/lib  -rdynamic CMakeFiles/cmTC_93273.dir/testCXXCompiler.cxx.o  -o cmTC_93273 
        x86_64-w64-mingw32-g++-posix: error: unrecognized command line option ‘-rdynamic’
        make[2]: *** [CMakeFiles/cmTC_93273.dir/build.make:87: cmTC_93273] Error 1
        make[2]: Leaving directory '/home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeTmp'
        make[1]: *** [Makefile:121: cmTC_93273/fast] Error 2
        make[1]: Leaving directory '/home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeTmp'
        
        
    
      
    
      CMake will not be able to correctly generate this project.
    Call Stack (most recent call first):
      CMakeLists.txt:6 (project)
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeOutput.log".
    See also "/home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeError.log".
    make: *** [funcs.mk:283: /home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/./.stamp_configured] Error 1
    
    

    The reason of that failure is the unset -DCMAKE_SYSTEM_NAME flag:

    $ make print-libmultiprocess_cmake MULTIPROCESS=1 HOST=x86_64-w64-mingw32
    libmultiprocess_cmake=env CC="x86_64-w64-mingw32-gcc" CFLAGS="  -I/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32/include     -pipe -O2    " CXX="x86_64-w64-mingw32-g++-posix" CXXFLAGS="  -I/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32/include     -pipe -O2    " LDFLAGS="  -L/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32/lib    " cmake -DCMAKE_INSTALL_PREFIX:PATH="/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32" -DCMAKE_SYSTEM_NAME= -DCMAKE_C_COMPILER_TARGET=x86_64-w64-mingw32 -DCMAKE_CXX_COMPILER_TARGET=x86_64-w64-mingw32
    

    This PR fixes this error:

    $ make libmultiprocess_configured MULTIPROCESS=1 HOST=x86_64-w64-mingw32
    $ # no errors
    
  2. hebasto marked this as ready for review on Feb 19, 2022
  3. DrahtBot added the label Build system on Feb 19, 2022
  4. hebasto commented at 1:20 PM on February 19, 2022: member

    Guix builds:

    $ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
    eb42250db2f8f80993bbf4e6b8188341302c152804a0575e3513caf0f1c18dc4  guix-build-599260ba95c5/output/aarch64-linux-gnu/SHA256SUMS.part
    aa0a968bc4da578bdb96cd7fa3ce08b4a0d5000358ea2e502453190ed33f20ac  guix-build-599260ba95c5/output/aarch64-linux-gnu/bitcoin-599260ba95c5-aarch64-linux-gnu-debug.tar.gz
    72c0502cebffb1fc1ab0df2aa94426f668d7ac7ada0c87834a2b503f3e498ccf  guix-build-599260ba95c5/output/aarch64-linux-gnu/bitcoin-599260ba95c5-aarch64-linux-gnu.tar.gz
    2d8a6c36b4f5b17addcff7c8d3e3c3f17dead986f75ddc013c0b6b00aad1c756  guix-build-599260ba95c5/output/arm-linux-gnueabihf/SHA256SUMS.part
    ca56cd17357fa1498c2c28d9cb227ae6e63d89867cd7c1721c6ff6e5353b02ac  guix-build-599260ba95c5/output/arm-linux-gnueabihf/bitcoin-599260ba95c5-arm-linux-gnueabihf-debug.tar.gz
    1428fc9e26fc8d90a3d0ded66632f3fba511a690707e26daf153d3a1949a9fc4  guix-build-599260ba95c5/output/arm-linux-gnueabihf/bitcoin-599260ba95c5-arm-linux-gnueabihf.tar.gz
    ea6fac4a5efce23591c0723eebe4377b15612edd090618519dee4c3def671bbf  guix-build-599260ba95c5/output/arm64-apple-darwin/SHA256SUMS.part
    4560d5e7dcd286091f83988bc662fd8d07c5b3cbe9e22784c6ae380b693772f5  guix-build-599260ba95c5/output/arm64-apple-darwin/bitcoin-599260ba95c5-arm64-apple-darwin.tar.gz
    928b6d8512e05e36eafc30b1b709c554b7e0479e4d9e2f9ede5dc1a2da113d14  guix-build-599260ba95c5/output/arm64-apple-darwin/bitcoin-599260ba95c5-osx-unsigned.dmg
    7bf2582d80ae728cb0cfaaa1913e78100e1eea95fb693e866cac1ca1726f03ef  guix-build-599260ba95c5/output/arm64-apple-darwin/bitcoin-599260ba95c5-osx-unsigned.tar.gz
    881f5cf583b95d1808e465114f5c16d8b31e0497f2e9f854eb1c9b9b33c7180f  guix-build-599260ba95c5/output/dist-archive/bitcoin-599260ba95c5.tar.gz
    14cab8db190d2d2f8da599ea5cc668830472903a3e1b2d006156d30d5ae0dff2  guix-build-599260ba95c5/output/powerpc64-linux-gnu/SHA256SUMS.part
    b6017d32e407ffa1622b0d51bba891e50aeac965eb1c560c485e17911f26ec39  guix-build-599260ba95c5/output/powerpc64-linux-gnu/bitcoin-599260ba95c5-powerpc64-linux-gnu-debug.tar.gz
    ff07c3242275a626db1e5e168c499d5911fc18f1a460d50eab9e28345b9e3c79  guix-build-599260ba95c5/output/powerpc64-linux-gnu/bitcoin-599260ba95c5-powerpc64-linux-gnu.tar.gz
    3619dfe95bb392ec2b77fa8351419137f030b7b19a797f8114a13a9c09df6f5b  guix-build-599260ba95c5/output/powerpc64le-linux-gnu/SHA256SUMS.part
    d6f963d3eee0d32bd0152f5201b62c0e443cdd463d1f74607ee31caaef5c9531  guix-build-599260ba95c5/output/powerpc64le-linux-gnu/bitcoin-599260ba95c5-powerpc64le-linux-gnu-debug.tar.gz
    56025e4b41d40879a1e867cb678c24af1bcb86752f17149cefc56beb3986ac4f  guix-build-599260ba95c5/output/powerpc64le-linux-gnu/bitcoin-599260ba95c5-powerpc64le-linux-gnu.tar.gz
    50bd0934b853170a86d225696f2f0d6737ed17560790c136eaa0494aae0f021b  guix-build-599260ba95c5/output/riscv64-linux-gnu/SHA256SUMS.part
    b6f39cae3bb22eb8e0731b41cd072c8af6d242f854f4d46c992ada53d2e184eb  guix-build-599260ba95c5/output/riscv64-linux-gnu/bitcoin-599260ba95c5-riscv64-linux-gnu-debug.tar.gz
    760d1423f488e1e6518a2a6aa9cf0bb5ea6dfa8944ea42bc261c77d31bd81001  guix-build-599260ba95c5/output/riscv64-linux-gnu/bitcoin-599260ba95c5-riscv64-linux-gnu.tar.gz
    6e2144ef9756f4e6b9e5320e0180df567474580e58a795fc522211ec2e13f0fb  guix-build-599260ba95c5/output/x86_64-apple-darwin/SHA256SUMS.part
    eda7e45d8a5519c64c652251d8e10a5285cc8f31734364205aa77778cfa13621  guix-build-599260ba95c5/output/x86_64-apple-darwin/bitcoin-599260ba95c5-osx-unsigned.dmg
    e22a565267c7af7aeb4f656a5688246f944de54b2a6b3f9091447d71d1c34f72  guix-build-599260ba95c5/output/x86_64-apple-darwin/bitcoin-599260ba95c5-osx-unsigned.tar.gz
    036e48419e4c89ff21b7a41876354d78daea5acdbe3e0204b6e01a8c4510e2e2  guix-build-599260ba95c5/output/x86_64-apple-darwin/bitcoin-599260ba95c5-osx64.tar.gz
    e39316358c34d18ecad77657ced8bcf965620ec719032a9b33fee06ed683cee7  guix-build-599260ba95c5/output/x86_64-linux-gnu/SHA256SUMS.part
    f13177fcb5ad08e9e53fc26c21255233f99ee169c40c2dcb0a3439df64c900e2  guix-build-599260ba95c5/output/x86_64-linux-gnu/bitcoin-599260ba95c5-x86_64-linux-gnu-debug.tar.gz
    cca8dbe1e2ac94e78bc6b9b2ca849475f86cafc3ff482605934eb699bcd1814c  guix-build-599260ba95c5/output/x86_64-linux-gnu/bitcoin-599260ba95c5-x86_64-linux-gnu.tar.gz
    a95b8f22a7f47167e6ca07455a443657467b8c01cc49f95a7e30c0316e518922  guix-build-599260ba95c5/output/x86_64-w64-mingw32/SHA256SUMS.part
    db1cb2fd652cc058c618929b9be0b2f152d92ffc8083afe43c051c3311719cbf  guix-build-599260ba95c5/output/x86_64-w64-mingw32/bitcoin-599260ba95c5-win-unsigned.tar.gz
    a5a8105cba33c22f08ec91c937246831405ff10d438e1c680d78f2b69d9066a3  guix-build-599260ba95c5/output/x86_64-w64-mingw32/bitcoin-599260ba95c5-win64-debug.zip
    5629b380beb6b3a6463ce4c717082af054aa373fc447052ce4d295789a3d629e  guix-build-599260ba95c5/output/x86_64-w64-mingw32/bitcoin-599260ba95c5-win64-setup-unsigned.exe
    0d21ba38160b2d89a06f568ed8829b26610ee9ef15412b52a0f1e2a6c085f918  guix-build-599260ba95c5/output/x86_64-w64-mingw32/bitcoin-599260ba95c5-win64.zip
    
  5. fanquake commented at 1:38 PM on February 19, 2022: member

    Has this just never worked?

  6. hebasto commented at 7:41 PM on February 19, 2022: member

    Has this just never worked?

    It seems so.

  7. fanquake added this to the milestone 23.0 on Feb 21, 2022
  8. fanquake commented at 12:23 PM on February 21, 2022: member

    Building 599260ba95c5bb82e023e9e8655cf957a51e6cd5 I see:

    make -C depends/ HOST=x86_64-w64-mingw32 MULTIPROCESS=1 -j9
    make: Entering directory '/home/ubuntu/bitcoin/depends'
    Building libmultiprocess...
    make[1]: Entering directory '/home/ubuntu/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-75065271f9c'
    make[2]: Entering directory '/home/ubuntu/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-75065271f9c'
    make[3]: Entering directory '/home/ubuntu/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-75065271f9c'
    [ 14%] Compiling Cap'n Proto schema include/mp/proxy.capnp
    make[3]: /home/ubuntu/bitcoin/depends/x86_64-w64-mingw32/native/bin/capnp.exe: Command not found
    make[3]: *** [CMakeFiles/multiprocess.dir/build.make:62: include/mp/proxy.capnp.c++] Error 127
    make[3]: Leaving directory '/home/ubuntu/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-75065271f9c'
    make[2]: *** [CMakeFiles/Makefile2:153: CMakeFiles/multiprocess.dir/all] Error 2
    make[2]: Leaving directory '/home/ubuntu/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-75065271f9c'
    make[1]: *** [Makefile:130: all] Error 2
    
  9. hebasto commented at 1:45 PM on February 21, 2022: member

    Building 599260b I see:

    Yes. It is another error which is similar to #24387 (comment), or the same one.

  10. fanquake commented at 2:02 PM on February 21, 2022: member

    In that case, it would be good to update the PR and commit title to indicate that this doesn't actually fix cross-compiling, it fixes configuring with cmake, when building for Windows. I'm reluctant to merge this as-is, if we are just going to need more changes later to actually fix the build issue. Would be good to get the configuration and build issues fixed together.

  11. hebasto renamed this:
    build: Fix cross-compiling depends with cmake
    build: Fix configuring depends with cmake
    on Feb 21, 2022
  12. build: Fix configuring depends with cmake ff4a38a327
  13. hebasto force-pushed on Feb 21, 2022
  14. hebasto commented at 2:17 PM on February 21, 2022: member

    In that case, it would be good to update the PR and commit title to indicate that this doesn't actually fix cross-compiling, it fixes configuring with cmake, when building for Windows.

    Updated 599260ba95c5bb82e023e9e8655cf957a51e6cd5 -> ff4a38a32766942ce5c4be6d6510f800a9f8e0d9 (pr24392.01 -> pr24392.02, diff):

    • commit message updated

    I'm reluctant to merge this as-is, if we are just going to need more changes later to actually fix the build issue. Would be good to get the configuration and build issues fixed together.

    I don't feel myself confident in cmake stuff, so feel free to close this PR with "Up for grabs" label.

  15. fanquake removed this from the milestone 23.0 on Feb 23, 2022
  16. fanquake commented at 12:07 PM on February 23, 2022: member

    so feel free to close this PR with "Up for grabs" label.

    No need to close this just yet. However I've removed it from the 23.0 milestone now.

  17. fanquake approved
  18. fanquake commented at 2:43 PM on April 26, 2022: member

    ACK ff4a38a32766942ce5c4be6d6510f800a9f8e0d9 - going to merge this now, and we can follow up with more cmake improvements.

  19. fanquake merged this on Apr 26, 2022
  20. fanquake closed this on Apr 26, 2022

  21. hebasto deleted the branch on Apr 26, 2022
  22. sidhujag referenced this in commit 52ef0425fa on Apr 26, 2022
  23. DrahtBot locked this on Apr 26, 2023
Contributors

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: 2026-04-24 21:14 UTC

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