@ejgallego writes:
as in principle dune should reinvoke coqdep if the filesystem layout changes
But this does not appear to be true — at least in dune 3.1.1 which has the latest relevant changes.
We have a From bedrock Require Import bytestring., added bedrock.auto.cpp.elpi.bytestring, and the coq_makefile build resolved the Require to the new file (and failed) while the dune build didn't notice the failure.
This is part of #6145, but I extracted it because it's IMHO a separate (and worse) bug, and the workaround suggested in #6145 doesn't work here.