Commit 537e2808e0

Andrew Kelley <andrew@ziglang.org>
2024-01-04 07:40:05
build system: fix missing step dependencies on lib
When depending on a module that depends on a static library, there was a missing step dependency on the static library, which caused a compile error due to missing header file. This fixes the problem by adding the proper step dependencies. Reviewing this code, I'm starting to wonder if it might be simpler to have Module instances create dummy Step objects to better model dependencies and dependees, rather than trying to maintain this graph without an actual node. That would be an improvement for a future commit.
1 parent fc79b22
Changed files (1)
lib
std
lib/std/Build/Module.zig
@@ -263,7 +263,11 @@ fn addShallowDependencies(m: *Module, dependee: *Module) void {
     };
 
     for (dependee.link_objects.items) |link_object| switch (link_object) {
-        .other_step => |compile| addStepDependencies(m, dependee, &compile.step),
+        .other_step => |compile| {
+            addStepDependencies(m, dependee, &compile.step);
+            for (compile.installed_headers.items) |install_step|
+                addStepDependenciesOnly(m, install_step);
+        },
 
         .static_path,
         .assembly_file,