ReviewOS

also looking at this

craft-native/craft

feat(maps): add key-free native Android maps and shared map controls

#363
Merged chris wants to merge codex/wildloop-native-map-providers into main
28 files +1857 -481

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

deps.yamlmodified+3-3
Changes to deps.yaml
@@ -3,6 +3,6 @@ dependencies:
33 # symlink, so 1.4.0 would be picked up silently on the next install — and
44 # 1.4.x writes `lockfileVersion: 2`, which 1.3.x cannot read.
55 bun.sh: 1.3.14
6 # A tagged compiler remains available on every target after nightly pruning.
7 # Bump deliberately and verify the native Linux, macOS and Windows builds.
8 ziglang.org: 0.17.0
6 # Exact upstream revision with the iOS Threaded-I/O descriptor fix.
7 # Pantry mirrors the native archives; verify all platforms before bumping.
8 ziglang.org: 0.18.0-dev.146+35accc06e
packages/zig/build.zigmodified+0-9
Changes to packages/zig/build.zig
@@ -1960,15 +1960,6 @@ pub fn build(b: *std.Build) void {
19601960 }
19611961
19621962 const test_step = b.step("test", "Run all unit tests");
1963 const io_backend_tests = b.addTest(.{
1964 .root_module = b.createModule(.{
1965 .root_source_file = b.path("src/io_backend.zig"),
1966 .target = target,
1967 .optimize = optimize,
1968 .link_libc = true,
1969 }),
1970 });
1971 test_step.dependOn(&b.addRunArtifact(io_backend_tests).step);
19721963 test_step.dependOn(&run_lib_unit_tests.step);
19731964 if (js_test_run) |run| test_step.dependOn(&run.step);
19741965 test_step.dependOn(&run_api_tests.step);
packages/zig/build.zig.zonmodified+1-1
Changes to packages/zig/build.zig.zon
@@ -2,7 +2,7 @@
22 .fingerprint = 0xf45c4a848bf58c1c,
33 .name = .craft,
44 .version = "0.0.237",
5 .minimum_zig_version = "0.17.0-dev",
5 .minimum_zig_version = "0.18.0-dev.146+35accc06e",
66 .dependencies = .{
77 // First-party, and the engine craft's own JavaScript runs on — see
88 // src/js_runtime.zig. A sibling checkout rather than a URL because
packages/zig/src/global_state.zigmodified+1-1
Changes to packages/zig/src/global_state.zig
@@ -200,7 +200,7 @@ pub const GlobalState = struct {
200200
201201 // Lazy init for test mode or when not explicitly initialized
202202 self.default_threaded = std.Io.Threaded.init(std.heap.c_allocator, .{ .environ = .empty });
203 self.io = .threadedIo(&self.default_threaded.?);
203 self.io = self.default_threaded.?.io();
204204 return self.io.?;
205205 }
206206
packages/zig/src/io_backend.zigdeleted+0-46
Changes to packages/zig/src/io_backend.zig
@@ -1,46 +0,0 @@
1//! Craft's platform policy for the standard threaded I/O backend.
2//! Sandboxed Apple apps cannot replace their running process. Apply that
3//! restriction when constructing the vtable, before desktop process code is
4//! instantiated; file, network and concurrency operations remain unchanged.
5const std = ;
6const builtin = ;
7
8pub fn threadedIo(threaded: *std.Io.Threaded) std.Io {
9 return switch (builtin.os.tag) {
10 .ios, .tvos, .visionos, .watchos => sandboxedIo(threaded),
11 else => threaded.io(),
12 };
13}
14
15fn sandboxedIo(threaded: *std.Io.Threaded) std.Io {
16 const vtable = comptime blk: {
17 var table = std.Io.Threaded.io(undefined).vtable.*;
18 table.processReplace = processReplaceUnsupported;
19 break :blk table;
20 };
21 return .{ .userdata = threaded, .vtable = &vtable };
22}
23
24fn processReplaceUnsupported(_: ?*anyopaque, _: std.process.ReplaceOptions) std.process.ReplaceError {
25 return error.OperationUnsupported;
26}
27
28test "sandboxed Io refuses process replacement without accessing backend state" {
29 try std.testing.expectEqual(error.OperationUnsupported, processReplaceUnsupported(null, .{ .argv = &.{"/never-executed"} }));
30 var threaded: std.Io.Threaded = undefined;
31 const io = sandboxedIo(&threaded);
32 try std.testing.expectEqual(error.OperationUnsupported, std.process.replace(io, .{ .argv = &.{"/never-executed"} }));
33 try std.testing.expectEqual(@as(?*anyopaque, &threaded), io.userdata);
34}
35
36test "sandboxed Io retains standard file network and concurrency operations" {
37 var threaded: std.Io.Threaded = undefined;
38 const standard = threaded.io();
39 const sandboxed = sandboxedIo(&threaded);
40 inline for (.{ "fileReadPositional", "fileWritePositional", "dirOpenDir", "netConnectIp", "async", "sleep" }) |name| {
41 try std.testing.expectEqual(@field(standard.vtable, name), @field(sandboxed.vtable, name));
42 }
43 if (comptime builtin.os.tag != .ios and builtin.os.tag != .tvos and builtin.os.tag != .visionos and builtin.os.tag != .watchos) {
44 try std.testing.expectEqual(standard.vtable, threadedIo(&threaded).vtable);
45 }
46}
pantry.jsoncmodified+3-3
Changes to pantry.jsonc
@@ -5,8 +5,8 @@
55 // every 1.3-based checkout and CI job the day 1.4.0 publishes. Keep this in
66 // step with deps.yaml.
77 "bun.sh": "1.3.14",
8 // Use the permanent tagged compiler on every target. Nightly snapshots are
9 // pruned upstream and cannot provision a fresh runner. Keep deps.yaml in step.
10 "ziglang.org": "0.17.0"
8 // This exact upstream revision fixes iOS Threaded-I/O descriptor storage.
9 // Pantry mirrors its native archives. Keep deps.yaml and pantry.lock in step.
10 "ziglang.org": "0.18.0-dev.146+35accc06e"
1111 }
1212}
pantry.lockmodified+4-4
Changes to pantry.lock
@@ -14,7 +14,7 @@
1414 },
1515 "system": {
1616 "bun.sh": "1.3.14",
17 "ziglang.org": "0.17.0"
17 "ziglang.org": "0.18.0-dev.146_35accc06e"
1818 }
1919 },
2020 "benchmarks": {
@@ -428,11 +428,11 @@
428428 },
429429 "optionalPeers": ["typescript"]
430430 },
431 "ziglang.org@0.17.0": {
431 "ziglang.org@0.18.0-dev.146_35accc06e": {
432432 "name": "ziglang.org",
433 "version": "0.17.0",
433 "version": "0.18.0-dev.146_35accc06e",
434434 "source": "pantry",
435 "resolved": "registry:ziglang.org@0.17.0"
435 "resolved": "registry:ziglang.org@0.18.0-dev.146_35accc06e"
436436 }
437437 }
438438}