From 6b4ed304a68930ee2ef567e56295ca38fbeedbeb Mon Sep 17 00:00:00 2001 From: CodeHz Date: Thu, 3 Sep 2020 09:07:06 +0000 Subject: [PATCH 01/11] fix iterate hashmap --- zig-ecs/src/ecs/registry.zig | 3 ++- zig-ecs/src/ecs/type_store.zig | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/zig-ecs/src/ecs/registry.zig b/zig-ecs/src/ecs/registry.zig index b049414..9703202 100644 --- a/zig-ecs/src/ecs/registry.zig +++ b/zig-ecs/src/ecs/registry.zig @@ -195,7 +195,8 @@ pub const Registry = struct { } pub fn deinit(self: *Registry) void { - for (self.components.items()) |ptr| { + var iter = self.components.iterator(); + while (iter.next()) |ptr| { // HACK: we dont know the Type here but we need to call deinit var storage = @intToPtr(*Storage(u1), ptr.value); storage.deinit(); diff --git a/zig-ecs/src/ecs/type_store.zig b/zig-ecs/src/ecs/type_store.zig index 21db41f..a16704d 100644 --- a/zig-ecs/src/ecs/type_store.zig +++ b/zig-ecs/src/ecs/type_store.zig @@ -14,7 +14,8 @@ pub const TypeStore = struct { } pub fn deinit(self: *TypeStore) void { - for (self.map.items()) |kv| { + var iter = self.map.iterator(); + while (iter.next()) |kv| { self.allocator.free(kv.value); } self.map.deinit(); From f1171b78c81782525901d84115f152c8d032fdb6 Mon Sep 17 00:00:00 2001 From: CodeHz Date: Sun, 6 Sep 2020 07:12:55 +0000 Subject: [PATCH 02/11] fix for ziglang pull 6246 --- zig-ecs/src/ecs/entity.zig | 6 +++--- zig-ecs/src/ecs/groups.zig | 4 ++-- zig-ecs/src/ecs/handles.zig | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/zig-ecs/src/ecs/entity.zig b/zig-ecs/src/ecs/entity.zig index c8f505a..2679232 100644 --- a/zig-ecs/src/ecs/entity.zig +++ b/zig-ecs/src/ecs/entity.zig @@ -14,9 +14,9 @@ pub fn EntityTraitsType(comptime size: EntityTraitsSize) type { } fn EntityTraitsDefinition(comptime EntityType: type, comptime IndexType: type, comptime VersionType: type) type { - std.debug.assert(@typeInfo(EntityType) == .Int and !EntityType.is_signed); - std.debug.assert(@typeInfo(IndexType) == .Int and !IndexType.is_signed); - std.debug.assert(@typeInfo(VersionType) == .Int and !VersionType.is_signed); + std.debug.assert(@typeInfo(EntityType) == .Int and !@typeInfo(EntityType).Int.is_signed); + std.debug.assert(@typeInfo(IndexType) == .Int and !@typeInfo(IndexType).Int.is_signed); + std.debug.assert(@typeInfo(VersionType) == .Int and !@typeInfo(VersionType).Int.is_signed); if (@bitSizeOf(IndexType) + @bitSizeOf(VersionType) != @bitSizeOf(EntityType)) @compileError("IndexType and VersionType must sum to EntityType's bit count"); diff --git a/zig-ecs/src/ecs/groups.zig b/zig-ecs/src/ecs/groups.zig index b5a03b9..683d1f4 100644 --- a/zig-ecs/src/ecs/groups.zig +++ b/zig-ecs/src/ecs/groups.zig @@ -85,7 +85,7 @@ pub const OwningGroup = struct { var component_ptrs: [component_info.fields.len][*]u8 = undefined; inline for (component_info.fields) |field, i| { - const storage = group.registry.assure(field.field_type.Child); + const storage = group.registry.assure(@typeInfo(field.field_type).Pointer.child); component_ptrs[i] = @ptrCast([*]u8, storage.instances.items.ptr); } @@ -104,7 +104,7 @@ pub const OwningGroup = struct { // fill and return the struct var comps: Components = undefined; inline for (@typeInfo(Components).Struct.fields) |field, i| { - const typed_ptr = @ptrCast([*]field.field_type.Child, @alignCast(@alignOf(field.field_type.Child), it.component_ptrs[i])); + const typed_ptr = @ptrCast([*]@typeInfo(field.field_type).Pointer.child, @alignCast(@alignOf(@typeInfo(field.field_type).Pointer.child), it.component_ptrs[i])); @field(comps, field.name) = &typed_ptr[it.index]; } return comps; diff --git a/zig-ecs/src/ecs/handles.zig b/zig-ecs/src/ecs/handles.zig index 567aeb9..d769087 100644 --- a/zig-ecs/src/ecs/handles.zig +++ b/zig-ecs/src/ecs/handles.zig @@ -4,9 +4,9 @@ const std = @import("std"); /// you choose the type of the handle (aka its size) and how much of that goes to the index and the version. /// the bitsize of version + id must equal the handle size. pub fn Handles(comptime HandleType: type, comptime IndexType: type, comptime VersionType: type) type { - std.debug.assert(@typeInfo(HandleType) == .Int and !HandleType.is_signed); - std.debug.assert(@typeInfo(IndexType) == .Int and !IndexType.is_signed); - std.debug.assert(@typeInfo(VersionType) == .Int and !VersionType.is_signed); + std.debug.assert(@typeInfo(HandleType) == .Int and !@typeInfo(HandleType).Int.is_signed); + std.debug.assert(@typeInfo(IndexType) == .Int and !@typeInfo(IndexType).Int.is_signed); + std.debug.assert(@typeInfo(VersionType) == .Int and !@typeInfo(VersionType).Int.is_signed); if (@bitSizeOf(IndexType) + @bitSizeOf(VersionType) != @bitSizeOf(HandleType)) @compileError("IndexType and VersionType must sum to HandleType's bit count"); From 6e412489a2bb423993f0ad72e5b996799448cdce Mon Sep 17 00:00:00 2001 From: Maurizio Crocci Date: Sat, 28 Nov 2020 02:21:03 +0000 Subject: [PATCH 03/11] Fixes Registry.removeAll iteration --- zig-ecs/src/ecs/registry.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zig-ecs/src/ecs/registry.zig b/zig-ecs/src/ecs/registry.zig index 9703202..3ec8027 100644 --- a/zig-ecs/src/ecs/registry.zig +++ b/zig-ecs/src/ecs/registry.zig @@ -343,7 +343,8 @@ pub const Registry = struct { pub fn removeAll(self: *Registry, entity: Entity) void { assert(self.valid(entity)); - for (self.components.items()) |ptr| { + var iter = self.components.iterator(); + for (iter.next()) |ptr| { // HACK: we dont know the Type here but we need to be able to call methods on the Storage(T) var store = @intToPtr(*Storage(u1), ptr.value); store.removeIfContains(entity); From 695e59bbf5f64a51cba0458730467cab38309970 Mon Sep 17 00:00:00 2001 From: Mike Desaro Date: Fri, 27 Nov 2020 20:02:40 -0800 Subject: [PATCH 04/11] hack to validate unsigned. closes #7 --- zig-ecs/src/ecs/entity.zig | 6 +++--- zig-ecs/src/ecs/handles.zig | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zig-ecs/src/ecs/entity.zig b/zig-ecs/src/ecs/entity.zig index 2679232..076fe9d 100644 --- a/zig-ecs/src/ecs/entity.zig +++ b/zig-ecs/src/ecs/entity.zig @@ -14,9 +14,9 @@ pub fn EntityTraitsType(comptime size: EntityTraitsSize) type { } fn EntityTraitsDefinition(comptime EntityType: type, comptime IndexType: type, comptime VersionType: type) type { - std.debug.assert(@typeInfo(EntityType) == .Int and !@typeInfo(EntityType).Int.is_signed); - std.debug.assert(@typeInfo(IndexType) == .Int and !@typeInfo(IndexType).Int.is_signed); - std.debug.assert(@typeInfo(VersionType) == .Int and !@typeInfo(VersionType).Int.is_signed); + std.debug.assert(@typeInfo(EntityType) == .Int and std.meta.Int(.unsigned, @bitSizeOf(EntityType)) == EntityType); + std.debug.assert(@typeInfo(IndexType) == .Int and std.meta.Int(.unsigned, @bitSizeOf(IndexType)) == IndexType); + std.debug.assert(@typeInfo(VersionType) == .Int and std.meta.Int(.unsigned, @bitSizeOf(VersionType)) == VersionType); if (@bitSizeOf(IndexType) + @bitSizeOf(VersionType) != @bitSizeOf(EntityType)) @compileError("IndexType and VersionType must sum to EntityType's bit count"); diff --git a/zig-ecs/src/ecs/handles.zig b/zig-ecs/src/ecs/handles.zig index d769087..452c974 100644 --- a/zig-ecs/src/ecs/handles.zig +++ b/zig-ecs/src/ecs/handles.zig @@ -4,9 +4,9 @@ const std = @import("std"); /// you choose the type of the handle (aka its size) and how much of that goes to the index and the version. /// the bitsize of version + id must equal the handle size. pub fn Handles(comptime HandleType: type, comptime IndexType: type, comptime VersionType: type) type { - std.debug.assert(@typeInfo(HandleType) == .Int and !@typeInfo(HandleType).Int.is_signed); - std.debug.assert(@typeInfo(IndexType) == .Int and !@typeInfo(IndexType).Int.is_signed); - std.debug.assert(@typeInfo(VersionType) == .Int and !@typeInfo(VersionType).Int.is_signed); + std.debug.assert(@typeInfo(HandleType) == .Int and std.meta.Int(.unsigned, @bitSizeOf(HandleType)) == HandleType); + std.debug.assert(@typeInfo(IndexType) == .Int and std.meta.Int(.unsigned, @bitSizeOf(IndexType)) == IndexType); + std.debug.assert(@typeInfo(VersionType) == .Int and std.meta.Int(.unsigned, @bitSizeOf(VersionType)) == VersionType); if (@bitSizeOf(IndexType) + @bitSizeOf(VersionType) != @bitSizeOf(HandleType)) @compileError("IndexType and VersionType must sum to HandleType's bit count"); From ae22b69026915274fa8a50c5c7d150f914e450f0 Mon Sep 17 00:00:00 2001 From: Mike Desaro Date: Fri, 27 Nov 2020 20:02:50 -0800 Subject: [PATCH 05/11] arm64 support --- zig-ecs/.gitignore | 1 + zig-ecs/.vscode/tasks.json | 17 +++++++++++++++++ zig-ecs/build.zig | 8 ++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/zig-ecs/.gitignore b/zig-ecs/.gitignore index 2040c29..b72f969 100644 --- a/zig-ecs/.gitignore +++ b/zig-ecs/.gitignore @@ -1 +1,2 @@ zig-cache +zig-arm-cache diff --git a/zig-ecs/.vscode/tasks.json b/zig-ecs/.vscode/tasks.json index dce0dbc..2af359a 100644 --- a/zig-ecs/.vscode/tasks.json +++ b/zig-ecs/.vscode/tasks.json @@ -2,6 +2,11 @@ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", + "options": { + "env": { + "ZIG_SYSTEM_LINKER_HACK": "1", + } + }, "tasks": [ { "label": "Build Project", @@ -26,6 +31,18 @@ "clear": true } }, + { + "label": "Build and Run Project (x64 on arm)", + "type": "shell", + "command": "~/zig/zig-x64/zig build run", + "problemMatcher": [ + "$gcc" + ], + "group": "build", + "presentation": { + "clear": true + } + }, { "label": "Build and Run Project (release-fast)", "type": "shell", diff --git a/zig-ecs/build.zig b/zig-ecs/build.zig index 8af56bf..7a099dd 100644 --- a/zig-ecs/build.zig +++ b/zig-ecs/build.zig @@ -1,9 +1,13 @@ -const Builder = @import("std").build.Builder; +const std = @import("std"); +const Builder = std.build.Builder; const builtin = @import("builtin"); pub fn build(b: *Builder) void { const buildMode = b.standardReleaseOptions(); + // use a different cache folder for macos arm builds + b.cache_root = if (std.builtin.os.tag == .macos and std.builtin.arch == std.builtin.Arch.aarch64) "zig-arm-cache/bin" else "zig-cache/bin"; + const examples = [_][2][]const u8{ [_][]const u8{ "view_vs_group", "examples/view_vs_group.zig" }, [_][]const u8{ "group_sort", "examples/group_sort.zig" }, @@ -25,7 +29,7 @@ pub fn build(b: *Builder) void { // first element in the list is added as "run" so "zig build run" works if (i == 0) { - exe.setOutputDir("zig-cache/bin"); + exe.setOutputDir(std.fs.path.joinPosix(b.allocator, &[_][]const u8{ b.cache_root, "bin" }) catch unreachable); const run_exe_step = b.step("run", b.fmt("run {}.zig", .{name})); run_exe_step.dependOn(&run_cmd.step); } From 3c540293fdb521157492cf0e240591d53dedfc92 Mon Sep 17 00:00:00 2001 From: foxnne Date: Thu, 3 Dec 2020 15:59:28 -0600 Subject: [PATCH 06/11] add getPackage to build.zig --- zig-ecs/build.zig | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/zig-ecs/build.zig b/zig-ecs/build.zig index 7a099dd..b126d3c 100644 --- a/zig-ecs/build.zig +++ b/zig-ecs/build.zig @@ -55,8 +55,15 @@ pub const LibType = enum(i32) { exe_compiled, }; -/// rel_path is used to add package paths. It should be the the same path used to include this build file -pub fn linkArtifact(b: *Builder, artifact: *std.build.LibExeObjStep, target: std.build.Target, lib_type: LibType, rel_path: []const u8) void { +pub fn getPackage(comptime prefix_path: []const u8) std.build.Pkg { + return .{ + .name = "ecs", + .path = prefix_path ++ "src/ecs.zig", + }; +} + +/// prefix_path is used to add package paths. It should be the the same path used to include this build file +pub fn linkArtifact(b: *Builder, artifact: *std.build.LibExeObjStep, target: std.build.Target, lib_type: LibType, prefix_path: []const u8) void { switch (lib_type) { .static => { const lib = b.addStaticLibrary("ecs", "ecs.zig"); @@ -75,5 +82,5 @@ pub fn linkArtifact(b: *Builder, artifact: *std.build.LibExeObjStep, target: std else => {}, } - artifact.addPackagePath("ecs", std.fs.path.join(b.allocator, &[_][]const u8{ rel_path, "ecs.zig" }) catch unreachable); + artifact.addPackage(getPackage(prefix_path)); } From 737e5a9b3913f0a95542bf01b1e273ddb349b4f4 Mon Sep 17 00:00:00 2001 From: foxnne Date: Thu, 3 Dec 2020 16:23:29 -0600 Subject: [PATCH 07/11] fix error in linkArtifact --- zig-ecs/build.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zig-ecs/build.zig b/zig-ecs/build.zig index b126d3c..5dd9bf1 100644 --- a/zig-ecs/build.zig +++ b/zig-ecs/build.zig @@ -63,7 +63,8 @@ pub fn getPackage(comptime prefix_path: []const u8) std.build.Pkg { } /// prefix_path is used to add package paths. It should be the the same path used to include this build file -pub fn linkArtifact(b: *Builder, artifact: *std.build.LibExeObjStep, target: std.build.Target, lib_type: LibType, prefix_path: []const u8) void { +pub fn linkArtifact(b: *Builder, artifact: *std.build.LibExeObjStep, target: std.build.Target, lib_type: LibType, comptime prefix_path: []const u8) void { + const buildMode = b.standardReleaseOptions(); switch (lib_type) { .static => { const lib = b.addStaticLibrary("ecs", "ecs.zig"); @@ -73,7 +74,7 @@ pub fn linkArtifact(b: *Builder, artifact: *std.build.LibExeObjStep, target: std artifact.linkLibrary(lib); }, .dynamic => { - const lib = b.addSharedLibrary("ecs", "ecs.zig", null); + const lib = b.addSharedLibrary("ecs", "ecs.zig", .unversioned); lib.setBuildMode(buildMode); lib.install(); From b8117306fae01ca9d473939a6931b747c5767383 Mon Sep 17 00:00:00 2001 From: Mike Desaro Date: Fri, 4 Dec 2020 12:48:15 -0800 Subject: [PATCH 08/11] zig 0.7 fixes --- zig-ecs/src/ecs/groups.zig | 4 ++-- zig-ecs/src/ecs/registry.zig | 2 +- zig-ecs/src/resources/assets.zig | 5 +++-- zig-ecs/src/resources/cache.zig | 5 +++-- zig-ecs/src/signals/dispatcher.zig | 3 ++- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/zig-ecs/src/ecs/groups.zig b/zig-ecs/src/ecs/groups.zig index 683d1f4..0af32c1 100644 --- a/zig-ecs/src/ecs/groups.zig +++ b/zig-ecs/src/ecs/groups.zig @@ -173,7 +173,7 @@ pub const OwningGroup = struct { var component_ptrs: [component_info.fields.len][*]u8 = undefined; inline for (component_info.fields) |field, i| { - const storage = self.registry.assure(field.field_type.Child); + const storage = self.registry.assure(std.meta.Child(field.field_type)); component_ptrs[i] = @ptrCast([*]u8, storage.instances.items.ptr); } @@ -181,7 +181,7 @@ pub const OwningGroup = struct { const index = self.firstOwnedStorage().set.index(entity); var comps: Components = undefined; inline for (component_info.fields) |field, i| { - const typed_ptr = @ptrCast([*]field.field_type.Child, @alignCast(@alignOf(field.field_type.Child), component_ptrs[i])); + const typed_ptr = @ptrCast([*]std.meta.Child(field.field_type), @alignCast(@alignOf(std.meta.Child(field.field_type)), component_ptrs[i])); @field(comps, field.name) = &typed_ptr[index]; } diff --git a/zig-ecs/src/ecs/registry.zig b/zig-ecs/src/ecs/registry.zig index 3ec8027..c0b861b 100644 --- a/zig-ecs/src/ecs/registry.zig +++ b/zig-ecs/src/ecs/registry.zig @@ -344,7 +344,7 @@ pub const Registry = struct { assert(self.valid(entity)); var iter = self.components.iterator(); - for (iter.next()) |ptr| { + while (iter.next()) |ptr| { // HACK: we dont know the Type here but we need to be able to call methods on the Storage(T) var store = @intToPtr(*Storage(u1), ptr.value); store.removeIfContains(entity); diff --git a/zig-ecs/src/resources/assets.zig b/zig-ecs/src/resources/assets.zig index bb02846..cc6aa53 100644 --- a/zig-ecs/src/resources/assets.zig +++ b/zig-ecs/src/resources/assets.zig @@ -14,7 +14,8 @@ pub const Assets = struct { } pub fn deinit(self: *Assets) void { - for (self.caches.items()) |ptr| { + var iter = self.caches.iterator(); + while (iter.next()) |ptr| { // HACK: we dont know the Type here but we need to call deinit @intToPtr(*Cache(u1), ptr.value).deinit(); } @@ -39,7 +40,7 @@ pub const Assets = struct { fn ReturnType(comptime loader: anytype, strip_ptr: bool) type { var ret = @typeInfo(@TypeOf(@field(loader, "load"))).BoundFn.return_type.?; if (strip_ptr) { - return ret.Child; + return std.meta.Child(ret); } return ret; } diff --git a/zig-ecs/src/resources/cache.zig b/zig-ecs/src/resources/cache.zig index 576ef9e..d9d9fd0 100644 --- a/zig-ecs/src/resources/cache.zig +++ b/zig-ecs/src/resources/cache.zig @@ -67,7 +67,8 @@ pub fn Cache(comptime T: type) type { pub fn clear(self: *@This()) void { // optionally deinit any resources that have a deinit method if (@hasDecl(T, "deinit")) { - for (self.resources.items()) |kv| { + var iter = self.resources.iterator(); + while (iter.next()) |kv| { @call(.{ .modifier = .always_inline }, @field(kv.value, "deinit"), .{}); } } @@ -75,7 +76,7 @@ pub fn Cache(comptime T: type) type { } pub fn size(self: @This()) usize { - return self.resources.items().len; + return self.resources.count(); } }; } diff --git a/zig-ecs/src/signals/dispatcher.zig b/zig-ecs/src/signals/dispatcher.zig index 15eab06..6bbaf03 100644 --- a/zig-ecs/src/signals/dispatcher.zig +++ b/zig-ecs/src/signals/dispatcher.zig @@ -15,7 +15,8 @@ pub const Dispatcher = struct { } pub fn deinit(self: *Dispatcher) void { - for (self.signals.items()) |ptr| { + var iter = self.signals.iterator(); + while (iter.next()) |ptr| { // HACK: we dont know the Type here but we need to call deinit var signal = @intToPtr(*Signal(void), ptr.value); signal.deinit(); From 3591aac01929f6f07206c932eac21f40bbedbd7f Mon Sep 17 00:00:00 2001 From: Mike Desaro Date: Thu, 10 Dec 2020 11:08:44 -0800 Subject: [PATCH 09/11] snake case --- zig-ecs/build.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zig-ecs/build.zig b/zig-ecs/build.zig index 5dd9bf1..5e34207 100644 --- a/zig-ecs/build.zig +++ b/zig-ecs/build.zig @@ -3,7 +3,7 @@ const Builder = std.build.Builder; const builtin = @import("builtin"); pub fn build(b: *Builder) void { - const buildMode = b.standardReleaseOptions(); + const build_mode = b.standardReleaseOptions(); // use a different cache folder for macos arm builds b.cache_root = if (std.builtin.os.tag == .macos and std.builtin.arch == std.builtin.Arch.aarch64) "zig-arm-cache/bin" else "zig-cache/bin"; @@ -37,12 +37,12 @@ pub fn build(b: *Builder) void { // internal tests const internal_test_step = b.addTest("src/tests.zig"); - internal_test_step.setBuildMode(buildMode); + internal_test_step.setBuildMode(build_mode); // public api tests const test_step = b.addTest("tests/tests.zig"); test_step.addPackagePath("ecs", "src/ecs.zig"); - test_step.setBuildMode(buildMode); + test_step.setBuildMode(build_mode); const test_cmd = b.step("test", "Run the tests"); test_cmd.dependOn(&internal_test_step.step); @@ -64,18 +64,18 @@ pub fn getPackage(comptime prefix_path: []const u8) std.build.Pkg { /// prefix_path is used to add package paths. It should be the the same path used to include this build file pub fn linkArtifact(b: *Builder, artifact: *std.build.LibExeObjStep, target: std.build.Target, lib_type: LibType, comptime prefix_path: []const u8) void { - const buildMode = b.standardReleaseOptions(); + const build_mode = b.standardReleaseOptions(); switch (lib_type) { .static => { const lib = b.addStaticLibrary("ecs", "ecs.zig"); - lib.setBuildMode(buildMode); + lib.setBuildMode(build_mode); lib.install(); artifact.linkLibrary(lib); }, .dynamic => { const lib = b.addSharedLibrary("ecs", "ecs.zig", .unversioned); - lib.setBuildMode(buildMode); + lib.setBuildMode(build_mode); lib.install(); artifact.linkLibrary(lib); From 41a5180ece6a019880be8e11a6489a83fbfe1fc9 Mon Sep 17 00:00:00 2001 From: Mike Desaro Date: Thu, 10 Dec 2020 19:32:22 -0800 Subject: [PATCH 10/11] ignore mac files --- zig-ecs/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zig-ecs/.gitignore b/zig-ecs/.gitignore index b72f969..2aca84c 100644 --- a/zig-ecs/.gitignore +++ b/zig-ecs/.gitignore @@ -1,2 +1,4 @@ zig-cache zig-arm-cache + +.DS_Store \ No newline at end of file From b398969be6786df38ecda7190f9dbee760987314 Mon Sep 17 00:00:00 2001 From: Mike Desaro Date: Sat, 12 Dec 2020 15:23:45 -0800 Subject: [PATCH 11/11] fix cache dir --- zig-ecs/build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zig-ecs/build.zig b/zig-ecs/build.zig index 5e34207..324c12c 100644 --- a/zig-ecs/build.zig +++ b/zig-ecs/build.zig @@ -6,7 +6,7 @@ pub fn build(b: *Builder) void { const build_mode = b.standardReleaseOptions(); // use a different cache folder for macos arm builds - b.cache_root = if (std.builtin.os.tag == .macos and std.builtin.arch == std.builtin.Arch.aarch64) "zig-arm-cache/bin" else "zig-cache/bin"; + b.cache_root = if (std.builtin.os.tag == .macos and std.builtin.arch == std.builtin.Arch.aarch64) "zig-arm-cache" else "zig-cache"; const examples = [_][2][]const u8{ [_][]const u8{ "view_vs_group", "examples/view_vs_group.zig" },