Skip to content

Commit 1d20ff1

Browse files
authored
Merge pull request #20580 from ziglang/watch
introduce file system watching features to the zig build system
2 parents 0d79aa0 + 5efcc2e commit 1d20ff1

27 files changed

+1552
-417
lines changed

build.zig

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void {
595595
run_opt.addArg("-o");
596596
run_opt.addFileArg(b.path("stage1/zig1.wasm"));
597597

598-
const copy_zig_h = b.addWriteFiles();
598+
const copy_zig_h = b.addUpdateSourceFiles();
599599
copy_zig_h.addCopyFileToSource(b.path("lib/zig.h"), "stage1/zig.h");
600600

601601
const update_zig1_step = b.step("update-zig1", "Update stage1/zig1.wasm");
@@ -1261,7 +1261,9 @@ fn generateLangRef(b: *std.Build) std.Build.LazyPath {
12611261
});
12621262

12631263
var dir = b.build_root.handle.openDir("doc/langref", .{ .iterate = true }) catch |err| {
1264-
std.debug.panic("unable to open 'doc/langref' directory: {s}", .{@errorName(err)});
1264+
std.debug.panic("unable to open '{}doc/langref' directory: {s}", .{
1265+
b.build_root, @errorName(err),
1266+
});
12651267
};
12661268
defer dir.close();
12671269

@@ -1280,10 +1282,7 @@ fn generateLangRef(b: *std.Build) std.Build.LazyPath {
12801282
// in a temporary directory
12811283
"--cache-root", b.cache_root.path orelse ".",
12821284
});
1283-
if (b.zig_lib_dir) |p| {
1284-
cmd.addArg("--zig-lib-dir");
1285-
cmd.addDirectoryArg(p);
1286-
}
1285+
cmd.addArgs(&.{ "--zig-lib-dir", b.fmt("{}", .{b.graph.zig_lib_directory}) });
12871286
cmd.addArgs(&.{"-i"});
12881287
cmd.addFileArg(b.path(b.fmt("doc/langref/{s}", .{entry.name})));
12891288

0 commit comments

Comments
 (0)