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 {...@@ -1451,7 +1451,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig {
1451 if (config_man) |man| for (configuration.path_deps) |path_dep| {1451 if (config_man) |man| for (configuration.path_deps) |path_dep| {
1452 switch (path_dep.flags.mode) {1452 switch (path_dep.flags.mode) {
1453 .directory => {}, // TODO1453 .directory => {}, // TODO
1454 .contents => try man.addPathPost(confPathDepToCachePath(graph, &configuration, path_dep)),1454 .contents => try man.addPathPost(try confPathDepToCachePath(arena, graph, &configuration, path_dep)),
1455 .metadata => {}, // TODO1455 .metadata => {}, // TODO
1456 }1456 }
1457 };1457 };
...@@ -3917,7 +3917,12 @@ const Templates = struct {...@@ -3917,7 +3917,12 @@ const Templates = struct {
3917 }3917 }
3918};3918};
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 {
3921 const sub_path = path_dep.sub.slice(c);3926 const sub_path = path_dep.sub.slice(c);
3922 return switch (path_dep.flags.base) {3927 return switch (path_dep.flags.base) {
3923 .cwd => .{3928 .cwd => .{
...@@ -3933,11 +3938,11 @@ fn confPathDepToCachePath(graph: *const Graph, c: *const Configuration, path_dep...@@ -3933,11 +3938,11 @@ fn confPathDepToCachePath(graph: *const Graph, c: *const Configuration, path_dep
3933 .sub_path = sub_path,3938 .sub_path = sub_path,
3934 },3939 },
3935 .build_root => .{3940 .build_root => .{
3936 .root_dir = switch (path_dep.pkg.unwrap().?) {3941 .root_dir = graph.build_root_directory,
3937 .root => graph.build_root_directory,3942 .sub_path = switch (path_dep.pkg.unwrap().?) {
3938 _ => @panic("TODO"),3943 .root => sub_path,
3944 else => |index| try Dir.path.join(arena, &.{ index.get(c).?.root_path.slice(c), sub_path }),
3939 },3945 },
3940 .sub_path = sub_path,
3941 },3946 },
3942 .zig_lib => .{3947 .zig_lib => .{
3943 .root_dir = graph.zig_lib_directory,3948 .root_dir = graph.zig_lib_directory,