clang-tidy and CXX_MODULES: error: module 'fmt' not found?

/usr/local/bin/cmake -E __run_co_compile --tidy="clang-tidy-18;--header-filter=^/home/runner/work/fmt-module/fmt-module/;--extra-arg-before=--driver-mode=g++" --source=/home/runner/work/fmt-module/fmt-module/tests/header-only-test.cc -- /usr/bin/clang++-18 -DFMT_MODULE -I/home/runner/work/fmt-module/fmt-module/build/sanitize/_deps/fmt-src/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wno-conversion -Wno-sign-conversion -Wcast-qual -Wformat=2 -Wundef -Wfloat-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wno-implicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wno-old-style-cast -O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-common -std=gnu++23 -MD -MT tests/CMakeFiles/header-only-test.dir/header-only-test.cc.o -MF tests/CMakeFiles/header-only-test.dir/header-only-test.cc.o.d @tests/CMakeFiles/header-only-test.dir/header-only-test.cc.o.modmap -o tests/CMakeFiles/header-only-test.dir/header-only-test.cc.o -c /home/runner/work/fmt-module/fmt-module/tests/header-only-test.cc
/home/runner/work/fmt-module/fmt-module/tests/header-only-test.cc:6:8: error: module 'fmt' not found [clang-diagnostic-error]

My project may be found here: GitHub - ClausKlein/fmt-module: Modern cmake project to show CXX_MODULES builds

Please do not expect forum users to look at your project. Formulate your question in a concise manner, minimise the problem down to a bare minimum demonstrator project, and ask a clear question you want people to help you with. The process of producing the minimal demonstrator usually reveals the problem.

Is it a CMake or a clang-tidy problem?

Without CXX_CLANG_TIDY set the project builds fine.

It’s not clear to me where the root problem is, but co-compilation is definitely unmarked waters for CMake so far (while it may work if the tooling shares a module implementation with the compiler, it is not guaranteed). That said, the .modmap response file in the command line is of interest. The state of files it references are also of interest.