Cmake build system breaks with symbolic links #31145

issue laanwj openend this issue on October 24, 2024
  1. laanwj commented at 8:04 am on October 24, 2024: member

    If the build directory is a symbolic link, or when the entire source directory is symlinked (and we build from there), the current cmake build runs into trouble finding its own generated files.

    To reproduce:

    0git clone --depth=1 https://github.com/bitcoin/bitcoin.git
    1mkdir build
    2cd bitcoin/
    3ln -s ../build .
    4cmake -Bbuild -DBUILD_GUI=ON
    5cd build
    6make
    
    0[ 37%] Building CXX object src/CMakeFiles/bitcoin_node.dir/validation.cpp.o
    1In file included from /data/src/tmp/bitcoin/build/src/qt/bitcoinqt_autogen/mocs_compilation.cpp:2:
    2/data/src/tmp/bitcoin/build/src/qt/bitcoinqt_autogen/EWIEGA46WW/moc_addressbookpage.cpp:10:10: fatal error: ../../../../../src/qt/addressbookpage.h: No such file or directory
    3   10 | #include "../../../../../src/qt/addressbookpage.h"
    4      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    5compilation terminated.
    6make[2]: *** [src/qt/CMakeFiles/bitcoinqt.dir/build.make:784: src/qt/CMakeFiles/bitcoinqt.dir/bitcoinqt_autogen/mocs_compilation.cpp.o] Error 1
    7make[2]: *** Waiting for unfinished jobs...
    

    This affects the build with Qt as well as the build with multiprocess, both which have generated files.

    With autotools this wasn’t an issue, so i think it can be considered a regression. But not a high-priority one as it can be worked around by specifying the full paths instead.

  2. laanwj added the label Build system on Oct 24, 2024
  3. fanquake added this to the milestone 29.0 on Nov 13, 2024


laanwj

Labels
Build system

Milestone
29.0


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-21 09:12 UTC

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