Skip to content

Commit 246e1de

Browse files
committed
Watch: do not fail when file is removed
before this we would get a crash
1 parent 58b9200 commit 246e1de

File tree

13 files changed

+18
-12
lines changed

13 files changed

+18
-12
lines changed

lib/std/Build/Watch.zig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,13 @@ const Os = switch (builtin.os.tag) {
171171
const gop = try w.dir_table.getOrPut(gpa, path);
172172
if (!gop.found_existing) {
173173
var mount_id: MountId = undefined;
174-
const dir_handle = try Os.getDirHandle(gpa, path, &mount_id);
174+
const dir_handle = Os.getDirHandle(gpa, path, &mount_id) catch |err| switch (err) {
175+
error.FileNotFound => {
176+
std.debug.assert(w.dir_table.swapRemove(path));
177+
continue;
178+
},
179+
else => return err,
180+
};
175181
const fan_fd = blk: {
176182
const fd_gop = try w.os.poll_fds.getOrPut(gpa, mount_id);
177183
if (!fd_gop.found_existing) {

src/Zcu.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3646,6 +3646,7 @@ pub fn errorSetBits(zcu: *const Zcu) u16 {
36463646

36473647
if (zcu.error_limit == 0) return 0;
36483648
if (target.cpu.arch.isSpirV()) {
3649+
// As expected by https://github.com/Snektron/zig-spirv-test-executor
36493650
if (zcu.comp.config.is_test) return 32;
36503651
}
36513652

src/codegen.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn importBackend(comptime backend: std.builtin.CompilerBackend) type {
5757
.stage2_powerpc => unreachable,
5858
.stage2_riscv64 => @import("arch/riscv64/CodeGen.zig"),
5959
.stage2_sparc64 => @import("arch/sparc64/CodeGen.zig"),
60-
.stage2_spirv => @import("arch/spirv/CodeGen.zig"),
60+
.stage2_spirv => @import("codegen/spirv/CodeGen.zig"),
6161
.stage2_wasm => @import("arch/wasm/CodeGen.zig"),
6262
.stage2_x86, .stage2_x86_64 => @import("arch/x86_64/CodeGen.zig"),
6363
_ => unreachable,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/link/SpirV.zig

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@ const link = @import("../link.zig");
1111
const Air = @import("../Air.zig");
1212
const Type = @import("../Type.zig");
1313
const BinaryModule = @import("SpirV/BinaryModule.zig");
14-
const CodeGen = @import("../arch/spirv/CodeGen.zig");
15-
const SpvModule = @import("../arch/spirv/Module.zig");
16-
const Section = @import("../arch/spirv/Section.zig");
14+
const CodeGen = @import("../codegen/spirv/CodeGen.zig");
15+
const Module = @import("../codegen/spirv/Module.zig");
1716
const trace = @import("../tracy.zig").trace;
1817

19-
const spec = @import("../arch/spirv/spec.zig");
18+
const spec = @import("../codegen/spirv/spec.zig");
2019
const Id = spec.Id;
2120
const Word = spec.Word;
2221

2322
const Linker = @This();
2423

2524
base: link.File,
26-
module: SpvModule,
25+
module: Module,
2726

2827
pub fn createEmpty(
2928
arena: Allocator,

0 commit comments

Comments
 (0)