authorgravatar for techatrix@mailbox.orgTechatrix <techatrix@mailbox.org> 2026-08-01 22:50:11+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-08-05 01:47:01+02:00
log0be5e81cc8cae524768e6a66e0af84c4d2b28314
tree1918483e3d6c22111abdd4f1e3d28e50d8d30013
parent5bf19f61ff5fe80a8f9aad5ce55812bd7e673fd0

Maker: fix `confPathDepToCachePath` on non-root build root


1 files changed, 11 insertions(+), 6 deletions(-)

lib/compiler/Maker.zig+11-6
......@@ -1451,7 +1451,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig {
14511451 if (config_man) |man| for (configuration.path_deps) |path_dep| {
14521452 switch (path_dep.flags.mode) {
14531453 .directory => {}, // TODO
1454 .contents => try man.addPathPost(confPathDepToCachePath(graph, &configuration, path_dep)),
1454 .contents => try man.addPathPost(try confPathDepToCachePath(arena, graph, &configuration, path_dep)),
14551455 .metadata => {}, // TODO
14561456 }
14571457 };
......@@ -3917,7 +3917,12 @@ const Templates = struct {
39173917 }
39183918};
39193919
3920fn confPathDepToCachePath(graph: *const Graph, c: *const Configuration, path_dep: Configuration.PathDep) Path {
3920fn confPathDepToCachePath(
3921 arena: Allocator,
3922 graph: *const Graph,
3923 c: *const Configuration,
3924 path_dep: Configuration.PathDep,
3925) Allocator.Error!Path {
39213926 const sub_path = path_dep.sub.slice(c);
39223927 return switch (path_dep.flags.base) {
39233928 .cwd => .{
......@@ -3933,11 +3938,11 @@ fn confPathDepToCachePath(graph: *const Graph, c: *const Configuration, path_dep
39333938 .sub_path = sub_path,
39343939 },
39353940 .build_root => .{
3936 .root_dir = switch (path_dep.pkg.unwrap().?) {
3937 .root => graph.build_root_directory,
3938 _ => @panic("TODO"),
3941 .root_dir = graph.build_root_directory,
3942 .sub_path = switch (path_dep.pkg.unwrap().?) {
3943 .root => sub_path,
3944 else => |index| try Dir.path.join(arena, &.{ index.get(c).?.root_path.slice(c), sub_path }),
39393945 },
3940 .sub_path = sub_path,
39413946 },
39423947 .zig_lib => .{
39433948 .root_dir = graph.zig_lib_directory,