From 537e2808e04fc34bb2015433895a57c15118eb28 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 3 Jan 2024 23:40:05 -0700 Subject: [PATCH] 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. --- lib/std/Build/Module.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/std/Build/Module.zig b/lib/std/Build/Module.zig index ce17d655a0..d46263849d 100644 --- a/lib/std/Build/Module.zig +++ b/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,