diff options
Diffstat (limited to 'src/tape.zig')
| -rw-r--r-- | src/tape.zig | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/tape.zig b/src/tape.zig index 0e8bbfe6..3723537e 100644 --- a/src/tape.zig +++ b/src/tape.zig @@ -150,8 +150,8 @@ pub const results = .{ /// taped by its name, and `anyerror` keeps no list of names to look one up /// in. ponytail: kept by hand, the sets of what a host reports from; one /// outside them is a Debug build's panic as it is taped (walk.encode) and a -/// release build's divergence (the replica joins again). No host, none. -pub const Failure = if (!pardes.hosted) error{} else ErrorOf(host_io.forkShell) || ErrorOf(pardes.filesystem.write) || +/// release build's divergence (the replica joins again). +pub const Failure = ErrorOf(host_io.forkShell) || ErrorOf(pardes.filesystem.write) || ErrorOf(pardes.filesystem.readRestore) || ErrorOf(pardes.dump.restore) || @typeInfo(@TypeOf(pardes.config.User.dumpThemes(undefined, undefined, undefined, pardes.themes))).error_union.error_set || ErrorOf(host_io.Lsp.snapshot) || @@ -279,7 +279,6 @@ pub const Tape = struct { } fn flush(t: *Tape) void { - if (comptime !pardes.hosted) return; // A tape in memory (a replica's, an authority's stream) is taken // by whoever holds it. if (t.fd < 0) return; @@ -894,7 +893,6 @@ fn call(comptime s: Site, a: ?std.mem.Allocator, comptime f: anytype, args: anyt } else @compileError("tape: the site ." ++ @tagName(s) ++ " returns " ++ @typeName(R) ++ ", which tape.results does not list"); } // No tape where there is no host to record or replay one. - if (comptime !pardes.hosted) return if (yields) out(f, args) else @call(.auto, f, args); const t = on orelse return if (yields) out(f, args) else @call(.auto, f, args); const id: u16 = @as(u16, host_fns.len) + @backingInt(s); if (t.replay) { @@ -1201,7 +1199,6 @@ pub fn digestOf(p: *const Pardes) u64 { /// PARDES_RECORD set: the tape is written from the session's first call. pub fn startFromEnv() void { - if (comptime !pardes.hosted) return; if (on != null) return; const prefix = std.mem.span(libc.getenv("PARDES_RECORD") orelse return); if (prefix.len == 0) return; @@ -1257,7 +1254,6 @@ pub fn replayMain(io: std.Io, path: []const u8) u8 { } test "a syscall that is no site, made replaying, diverges the replay and poisons a speculation" { - if (comptime !pardes.hosted) return; const gpa = std.testing.allocator; var t: Tape = .{ .gpa = gpa, .replay = true, .scratch = .init(gpa), .arena = .init(gpa) }; defer t.scratch.deinit(); @@ -1276,7 +1272,6 @@ test "a syscall that is no site, made replaying, diverges the replay and poisons } test "a replay that finds no answer where its core reads one diverges, and the read goes on harmless" { - if (comptime !pardes.hosted) return; const gpa = std.testing.allocator; var t: Tape = .{ .gpa = gpa, .replay = true, .scratch = .init(gpa), .arena = .init(gpa) }; defer t.scratch.deinit(); |
