summaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-03-11 12:20:00 -0700
committerDylan Baker <dylan@pnwbakers.com>2025-04-03 12:27:07 -0700
commitcc815c4bcac055721ae359cbc757f50c10ed54ed (patch)
treead5cf05822c0af67cdbaf67ba6edbdbc73291514 /mesonbuild
parent11771a8ce6a5767ebf460c5d722a83358d5f83d1 (diff)
downloadmeson-cc815c4bcac055721ae359cbc757f50c10ed54ed.tar.gz
backend/ninja: fix cross module dependencies
This requires that every Fortran target that uses modules have a full dependency on the scan target of it's dependencies. This means that for a three step target `A -> B -> C`, we cannot start compiling any of B until all of A is linked, and cannot start compiling any of C until all of A and B is linked. This fixes various kinds of races, but it serializes the build and makes it slow. This is the best we can do though, since we don't have any sort of portable format for telling C what is in A and B, so C can't know what sources to wait on for it's modules to be fulfilled.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/backend/ninjabackend.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 8971abd2b..a75befd73 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -1170,6 +1170,13 @@ class NinjaBackend(backends.Backend):
# they use or export.
for s in scan_sources:
elem.deps.add(s[0])
+ # We need a full dependency on the output depfiles of other targets. If
+ # they change we need to completely
+ for t in target.get_all_linked_targets():
+ if self.should_use_dyndeps_for_target(t):
+ elem.deps.add(os.path.join(self.get_target_dir(t), t.get_filename()))
+ elem.deps.update({os.path.join(self.get_target_dir(t), t.get_filename())
+ for t in self.flatten_object_list(target)[1]})
elem.orderdeps.update(object_deps)
self.add_build(elem)