Plan::RefreshDyndepDependents: Assertion `edge && !edge->outputs_ready()' failed.
Author: cebtenzzreCreated Feb 20, 2025Updated Jun 7, 2026
This issue seems to be caused by an interaction between a certain CMake patch, a dirty build directory, and an attempt to use fmt as both a C++20 module and a header. It can be avoided, but it definitely seems like there is a ninja bug here, since it crashes.
You will need:
- ninja 1.21.1
- LLVM Clang 19 (this project crashes GCC)
- Qt 6.8.2 (anything 6.5+ might work)
- CMake 3.28.0 (vanilla)
- CMake 3.31.5 (patched with MR 10373)
- This minimal project to reproduce the issue: QtModuleDependency-fmt.zip
Steps to Reproduce
$ sudo pacman -U ../cmake/cmake-3.28.0-1-x86_64.pkg.tar.zst # vanilla CMake 3.28.0
$ unzip QtModuleDependency-fmt.zip
$ cd QtModuleDependency
$ cmake -G Ninja -B build -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
$ ninja -C build
$ sudo pacman -U ../cmake/cmake-3.31.5-1-x86_64.pkg.tar.zst # patched with MR 10373
$ ninja -vC build
ninja: Entering directory `build'
[0/1] /usr/bin/cmake --regenerate-during-build -S/home/jared/scratch/QtModuleDependency -B/home/jared/scratch/QtModuleDependency/build
-- The C compiler identification is Clang 19.1.7
-- The CXX compiler identification is Clang 19.1.7
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- {fmt} version: 11.0.2
-- Build type:
-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /home/jared/scratch/QtModuleDependency/build
[1/14] "/usr/bin/clang-scan-deps" -format=p1689 -- /usr/bin/clang++ -DFMT_MODULE -I/home/jared/scratch/QtModuleDependency/fmt/include -std=gnu++23 -x c++ /home/jared/scratch/QtModuleDependency/fmt/src/fmt.cc -c -o fmt/CMakeFiles/fmt.dir/src/fmt.cc.o -resource-dir "/usr/lib/clang/19" -MT fmt/CMakeFiles/fmt.dir/src/fmt.cc.o.ddi -MD -MF fmt/CMakeFiles/fmt.dir/src/fmt.cc.o.ddi.d > fmt/CMakeFiles/fmt.dir/src/fmt.cc.o.ddi.tmp && mv fmt/CMakeFiles/fmt.dir/src/fmt.cc.o.ddi.tmp fmt/CMakeFiles/fmt.dir/src/fmt.cc.o.ddi
[2/14] /usr/bin/cmake -E cmake_ninja_dyndep --tdi=fmt/CMakeFiles/fmt.dir/CXXDependInfo.json --lang=CXX --modmapfmt=clang --dd=fmt/CMakeFiles/fmt.dir/CXX.dd @fmt/CMakeFiles/fmt.dir/CXX.dd.rsp
ninja: /usr/src/debug/ninja/ninja-1.12.1/src/build.cc:423: bool Plan::RefreshDyndepDependents(DependencyScan*, const Node*, std::string*): Assertion `edge && !edge->outputs_ready()' failed.
[1] 150141 IOT instruction (core dumped) ninja -vC build
$ ninja -vC build
ninja: Entering directory `build'
[1/12] /usr/bin/cmake -E cmake_ninja_dyndep --tdi=fmt/CMakeFiles/fmt.dir/CXXDependInfo.json --lang=CXX --modmapfmt=clang --dd=fmt/CMakeFiles/fmt.dir/CXX.dd @fmt/CMakeFiles/fmt.dir/CXX.dd.rsp
ninja: /usr/src/debug/ninja/ninja-1.12.1/src/build.cc:423: bool Plan::RefreshDyndepDependents(DependencyScan*, const Node*, std::string*): Assertion `edge && !edge->outputs_ready()' failed.
[1] 150203 IOT instruction (core dumped) ninja -vC buildninja -C build will now crash as above until you rm -rf build and run CMake again.
Debug Information
This is the backtrace:
>>> bt
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1 0x00007ffff7aa56d3 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:89
#2 0x00007ffff7a4bba0 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3 0x00007ffff7a33582 in __GI_abort () at abort.c:73
#4 0x00007ffff7a334eb in __assert_fail_base (fmt=<optimized out>, assertion=<optimized out>, file=<optimized out>, line=423, function=<optimized out>)
at assert.c:118
#5 0x00005555555773f1 in Plan::RefreshDyndepDependents (this=this@entry=0x7fffffffd3d0, scan=scan@entry=0x7fffffffd4b8, node=node@entry=0x55555566d450,
err=err@entry=0x7fffffffd3a0) at /usr/src/debug/ninja/ninja-1.12.1/src/build.cc:423
#6 0x0000555555576d1e in Plan::DyndepsLoaded (this=this@entry=0x7fffffffd3d0, scan=scan@entry=0x7fffffffd4b8, node=node@entry=0x55555566d450, ddf=...,
err=err@entry=0x7fffffffd3a0) at /usr/src/debug/ninja/ninja-1.12.1/src/build.cc:323
#7 0x000055555557b7cd in Builder::LoadDyndeps (this=0x7fffffffd3c0, node=node@entry=0x55555566d450, err=err@entry=0x7fffffffd3a0)
at /usr/src/debug/ninja/ninja-1.12.1/src/build.cc:1108
#8 0x00005555555766fe in Plan::NodeFinished (this=this@entry=0x7fffffffd3d0, node=0x55555566d450, err=err@entry=0x7fffffffd3a0)
at /usr/src/debug/ninja/ninja-1.12.1/src/build.cc:227
#9 0x0000555555576616 in Plan::EdgeFinished (this=this@entry=0x7fffffffd3d0, edge=<optimized out>, result=result@entry=Plan::kEdgeSucceeded,
err=err@entry=0x7fffffffd3a0) at /usr/src/debug/ninja/ninja-1.12.1/src/build.cc:215
#10 0x000055555557a84e in Builder::FinishCommand (this=this@entry=0x7fffffffd3c0, result=result@entry=0x7fffffffd2e0, err=err@entry=0x7fffffffd3a0)
at /usr/src/debug/ninja/ninja-1.12.1/src/build.cc:1001
#11 0x00005555555796f9 in Builder::Build (this=this@entry=0x7fffffffd3c0, err=err@entry=0x7fffffffd3a0) at /usr/src/debug/ninja/ninja-1.12.1/src/build.cc:845
#12 0x00005555555619ac in (anonymous namespace)::NinjaMain::RunBuild (this=this@entry=0x7fffffffd650, argc=0, argv=0x7fffffffd9f0, status=status@entry=0x555555613490)
at /usr/src/debug/ninja/ninja-1.12.1/src/ninja.cc:1382
#13 0x00005555555627f9 in (anonymous namespace)::real_main (argc=<optimized out>, argc@entry=3, argv=<optimized out>, argv@entry=0x7fffffffd9d8)
at /usr/src/debug/ninja/ninja-1.12.1/src/ninja.cc:1608
#14 0x00005555555629ab in main (argc=3, argv=0x7fffffffd9d8) at /usr/src/debug/ninja/ninja-1.12.1/src/ninja.cc:1637Source: ninja-build/ninja