also looking at this
feat(maps): add key-free native Android maps and shared map controls
#363
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.
| @@ -3,6 +3,6 @@ dependencies: | ||
| 3 | 3 | # symlink, so 1.4.0 would be picked up silently on the next install — and |
| 4 | 4 | # 1.4.x writes `lockfileVersion: 2`, which 1.3.x cannot read. |
| 5 | 5 | 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 | |
| @@ -1960,15 +1960,6 @@ pub fn build(b: *std.Build) void { | ||
| 1960 | 1960 | } |
| 1961 | 1961 | |
| 1962 | 1962 | 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); | |
| 1972 | 1963 | test_step.dependOn(&run_lib_unit_tests.step); |
| 1973 | 1964 | if (js_test_run) |run| test_step.dependOn(&run.step); |
| 1974 | 1965 | test_step.dependOn(&run_api_tests.step); |
| @@ -2,7 +2,7 @@ | ||
| 2 | 2 | .fingerprint = 0xf45c4a848bf58c1c, |
| 3 | 3 | .name = .craft, |
| 4 | 4 | .version = "0.0.237", |
| 5 | .minimum_zig_version = "0.17.0-dev", | |
| 5 | .minimum_zig_version = "0.18.0-dev.146+35accc06e", | |
| 6 | 6 | .dependencies = .{ |
| 7 | 7 | // First-party, and the engine craft's own JavaScript runs on — see |
| 8 | 8 | // src/js_runtime.zig. A sibling checkout rather than a URL because |
| @@ -200,7 +200,7 @@ pub const GlobalState = struct { | ||
| 200 | 200 | |
| 201 | 201 | // Lazy init for test mode or when not explicitly initialized |
| 202 | 202 | 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(); | |
| 204 | 204 | return self.io.?; |
| 205 | 205 | } |
| 206 | 206 | |
| @@ -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. | |
| 5 | const std = ; | |
| 6 | const builtin = ; | |
| 7 | ||
| 8 | pub 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 | ||
| 15 | fn 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 | ||
| 24 | fn processReplaceUnsupported(_: ?*anyopaque, _: std.process.ReplaceOptions) std.process.ReplaceError { | |
| 25 | return error.OperationUnsupported; | |
| 26 | } | |
| 27 | ||
| 28 | test "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 | ||
| 36 | test "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 | } | |
| @@ -5,8 +5,8 @@ | ||
| 5 | 5 | // every 1.3-based checkout and CI job the day 1.4.0 publishes. Keep this in |
| 6 | 6 | // step with deps.yaml. |
| 7 | 7 | "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" | |
| 11 | 11 | } |
| 12 | 12 | } |
| @@ -14,7 +14,7 @@ | ||
| 14 | 14 | }, |
| 15 | 15 | "system": { |
| 16 | 16 | "bun.sh": "1.3.14", |
| 17 | "ziglang.org": "0.17.0" | |
| 17 | "ziglang.org": "0.18.0-dev.146_35accc06e" | |
| 18 | 18 | } |
| 19 | 19 | }, |
| 20 | 20 | "benchmarks": { |
| @@ -428,11 +428,11 @@ | ||
| 428 | 428 | }, |
| 429 | 429 | "optionalPeers": ["typescript"] |
| 430 | 430 | }, |
| 431 | "ziglang.org@0.17.0": { | |
| 431 | "ziglang.org@0.18.0-dev.146_35accc06e": { | |
| 432 | 432 | "name": "ziglang.org", |
| 433 | "version": "0.17.0", | |
| 433 | "version": "0.18.0-dev.146_35accc06e", | |
| 434 | 434 | "source": "pantry", |
| 435 | "resolved": "registry:ziglang.org@0.17.0" | |
| 435 | "resolved": "registry:ziglang.org@0.18.0-dev.146_35accc06e" | |
| 436 | 436 | } |
| 437 | 437 | } |
| 438 | 438 | } |