╭ changed ──────────────────────────╮ │lib/compiler/Maker/Step/Options.zig│ ╰───────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │30 // generated zig file are observable by dependant steps. │ │31 // Pathnames added to Options.args are assumed to be generated files whose│ │32 // contents are also observable, while pathnames added to │ │33 - // Options.args_untracked are treated as pure path string data with no │ │33 + // Options.untracked_paths are treated as pure path string data with no │ │34 // tracking of the path's state or contents. │ │35 │ │36 step.clearWatchInputs(maker); │ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────╮ │40 │ │41 var args_bytes: std.ArrayList(u8) = .empty; │ │42 │ │43 - for (conf_options.args.slice) |arg| { │ │43 + for (conf_options.files.slice) |arg| { │ │44 const name = arg.name.slice(conf); │ │45 const lazy_path = arg.path.get(conf); │ │46 try step.addWatchInput(maker, arena, lazy_path);│ ╰────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │51 }); │ │52 } │ │53 │ │54 - for (conf_options.args_untracked.slice) |arg| { │ │54 + for (conf_options.directories.slice) |arg| { │ │55 + const name = arg.name.slice(conf); │ │56 + const lazy_path = arg.path.get(conf); │ │57 + _ = try step.addDirectoryWatchInput(maker, lazy_path); │ │58 + const arg_path = try maker.resolveLazyPath(arena, lazy_path, step_index);│ │59 + _ = try man.addInputPath(arg_path, .{ │ │60 + .handle = .{ .dir = null }, │ │61 + }); │ │62 + try args_bytes.print(arena, "pub const {f}: []const u8 = \"{f}\";\n", .{ │ │63 + std.zig.fmtId(name), arg_path.fmtEscapeString(), │ │64 + }); │ │65 + } │ │66 + │ │67 + for (conf_options.untracked_paths.slice) |arg| { │ │68 const name = arg.name.slice(conf); │ │69 const lazy_path = arg.path.get(conf); │ │70 const arg_path = try maker.resolveLazyPath(arena, lazy_path, step_index);│ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │lib/std/Build/Cache.zig│ ╰───────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │513 │ │514 pub fn path(off: File.Offset, contents: []const u8) [:0]const u8 { │ │515 return pathFallible(off, contents) catch unreachable; │ │516 + } │ │517 + │ │518 + pub fn pathOrDot(off: File.Offset, contents: []const u8) [:0]const u8 {│ │519 + const p = pathFallible(off, contents) catch unreachable; │ │520 + return if (p.len == 0) "." else p; │ │521 } │ │522 }; │ │523 │ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │1181 const io = cache.io; │ │1182 const input_file = file_off.get(contents); │ │1183 const parent_dir = cache.prefixes()[input_file.flags.prefix].handle;│ │1179 - const file_path = file_off.path(contents); │ │1184 + const file_path = file_off.pathOrDot(contents); │ │1185 const gpa = cache.gpa; │ │1186 │ │1187 if (input_path.have_digest) return; │ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │1357 const disk_file = file_off.get(disk_contents); │ │1358 const input_file = file_off.get(input_contents); │ │1359 const parent_dir = cache.prefixes()[disk_file.flags.prefix].handle;│ │1355 - const file_path = file_off.path(disk_contents); │ │1360 + const file_path = file_off.pathOrDot(disk_contents); │ │1361 │ │1362 assert(disk_file.flags == input_file.flags); │ │1363 │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1541 const gpa = cache.gpa; │ │1542 const io = cache.io; │ │1543 const parent_dir = cache.prefixes()[file.flags.prefix].handle; │ │1539 - const file_path = file_off.path(contents); │ │1544 + const file_path = file_off.pathOrDot(contents); │ │1545 │ │1546 if (file.flags.metadata_only) { │ │1547 const actual_stat = parent_dir.statFile(io, file_path, .{}) catch |err| switch (err) {│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────────────╮ │lib/std/Build/Configuration.zig│ ╰───────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ │1378 flags: @This().Flags, │ │1379 generated_file: GeneratedFileIndex, │ │1380 contents: Bytes, │ │1381 - args: Storage.FlagLengthPrefixedList(.flags, .args, Arg), │ │1382 - args_untracked: Storage.FlagLengthPrefixedList(.flags, .args_untracked, Arg), │ │1381 + files: Storage.FlagLengthPrefixedList(.flags, .files, NamedPath), │ │1382 + directories: Storage.FlagLengthPrefixedList(.flags, .directories, NamedPath), │ │1383 + untracked_paths: Storage.FlagLengthPrefixedList(.flags, .untracked_paths, NamedPath),│ │1384 │ │1384 - pub const Arg = extern struct { │ │1385 + pub const NamedPath = extern struct { │ │1386 name: String, │ │1387 path: LazyPath.Index, │ │1388 }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────╮ │1389 │ │1390 pub const Flags = packed struct(u32) {│ │1391 tag: Tag = .options, │ │1391 - args: bool, │ │1392 - args_untracked: bool, │ │1393 - _: u25 = 0, │ │1392 + files: bool, │ │1393 + directories: bool, │ │1394 + untracked_paths: bool, │ │1395 + _: u24 = 0, │ │1396 }; │ │1397 }; │ │1398 │ ╰────────────────────────────────────────────────────╯ ╭ changed ──────────────────╮ │lib/std/Build/Serialize.zig│ ╰───────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │648 .options => e: { │ │649 const so: *Step.Options = @fieldParentPtr("step", step); │ │650 │ │651 - const args = try arena.alloc(Configuration.Step.Options.Arg, so.args.items.len); │ │652 - for (args, so.args.items) |*dest, src| dest.* = .{ │ │651 + const files = try arena.alloc(Configuration.Step.Options.NamedPath, so.files.items.len);│ │652 + for (files, so.files.items) |*dest, src| dest.* = .{ │ │653 .name = src.name, │ │654 .path = try s.addLazyPath(src.path), │ │655 }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯