cmake: Disable automatic C++20 module dependency scanning #355

pull ryanofsky wants to merge 1 commits into bitcoin-core:master from ryanofsky:pr/cmake-nomodules changing 1 files +5 −0
  1. ryanofsky commented at 8:48 PM on August 20, 2026: collaborator

    Set CMAKE_CXX_SCAN_FOR_MODULES off because this project doesn't use C++ modules, and they are enabled by default in newer versions of cmake, which can lead to failures trying to invoke the clang-scan-deps tool if it is not installed.

  2. cmake: fix CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND error with new cmake policies
    With latest cmake policies, specifically CMP0155, openbsd and freebsd CI
    jobs fail due to a lack of a clang-scan-deps tool. The tool could
    potentially be installed on these platforms but it is unclear how to do
    that and the project isn't using modules anyway, so just disable them
    here. Errors look like:
    
    + cmake --build . --parallel -t all tests mpexamples -- -k 0
    [1/114] Scanning /home/runner/work/libmultiprocess/libmultiprocess/src/mp/util.cpp for CXX dependencies
    FAILED: CMakeFiles/mputil.dir/src/mp/util.cpp.o.ddi
    "CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND" -format=p1689 -- /usr/bin/c++  -I/home/runner/work/libmultiprocess/libmultiprocess/include -I/home/runner/work/libmultiprocess/libmultiprocess/build-openbsd/include -isystem /usr/local/include -Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -std=gnu++20 -x c++ /home/runner/work/libmultiprocess/libmultiprocess/src/mp/util.cpp -c -o CMakeFiles/mputil.dir/src/mp/util.cpp.o -resource-dir "/usr/lib/clang/16" -MT CMakeFiles/mputil.dir/src/mp/util.cpp.o.ddi -MD -MF CMakeFiles/mputil.dir/src/mp/util.cpp.o.ddi.d > CMakeFiles/mputil.dir/src/mp/util.cpp.o.ddi.tmp && mv CMakeFiles/mputil.dir/src/mp/util.cpp.o.ddi.tmp CMakeFiles/mputil.dir/src/mp/util.cpp.o.ddi
    /bin/sh: CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND: not found
    b81b9de3af
  3. DrahtBot commented at 8:48 PM on August 20, 2026: none

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. maflcko commented at 6:24 AM on August 21, 2026: contributor

    -0 Seems odd to split this out when it can't happen in reality. Seems better to leave this as part of #209, so that review is easier.

  5. in CMakeLists.txt:16 in b81b9de3af
       9 | @@ -10,6 +10,11 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
      10 |    set(CMAKE_CXX_STANDARD_REQUIRED YES)
      11 |  endif()
      12 |  
      13 | +# Disable automatic C++20 module dependency scanning.
      14 | +# CMake >=3.28 tries to use `clang-scan-deps` by default, which may not
      15 | +# be installed on all platforms. We don't use named modules, so turn this off.
      16 | +set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
    


    hebasto commented at 11:27 AM on August 23, 2026:

    ~I tend to agree with @purpleKarrot and other CMake developers that a project should avoid forcibly setting the CMAKE_* variables as much as possible.~

    As far as I understand this is a workaround for an upstream bug reported here.

    ~I think the proper workaround is to modify the CI scripts without touching the project's CML files.~

    ~If "we don't use named modules", we shouldn't worry about them at all rather than explicitly disabling them.~

  6. hebasto commented at 11:38 AM on August 23, 2026: member

    -0 Seems odd to split this out when it can't happen in reality. Seems better to leave this as part of #209, so that review is easier.

    I agree. This change is a no-op on the current master branch.

  7. ryanofsky commented at 3:30 AM on August 26, 2026: collaborator

    Good points. It's not good for the cmake file to force this setting internally when it could just be set by CI jobs that need it. And I didn't know there was an upstream bug reported for this https://gitlab.kitware.com/cmake/cmake/-/work_items/27228 so it might be fixed later. Will close this PR as it is not a good approach.

  8. ryanofsky closed this on Aug 26, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-26 11:30 UTC

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