From ddbfc2710f65ec1daa475578214aab33350ce086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Spindler?= Date: Mon, 23 Feb 2026 22:19:06 +0100 Subject: [PATCH 1/5] Upgrade to zig 0.16.0-dev --- build.zig | 12 ++++++------ build.zig.zon | 2 +- src/tests.zig | 2 +- src/zflecs.zig | 9 +++++++-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/build.zig b/build.zig index 69d90b3..ce74cf4 100644 --- a/build.zig +++ b/build.zig @@ -564,6 +564,7 @@ pub fn build(b: *std.Build) void { .root_source_file = b.path("src/zflecs.zig"), .target = target, .optimize = optimize, + .link_libc = true, }); module.addOptions("build-options", options); @@ -657,12 +658,11 @@ pub fn build(b: *std.Build) void { .linkage = if (opt_use_shared) .dynamic else .static, .root_module = module, }); - lib.linkLibC(); b.installArtifact(lib); if (target.result.os.tag == .windows) { - lib.linkSystemLibrary("ws2_32"); - lib.linkSystemLibrary("dbghelp"); + lib.root_module.linkSystemLibrary("ws2_32", .{}); + lib.root_module.linkSystemLibrary("dbghelp", .{}); } const test_step = b.step("test", "Run zflecs tests"); @@ -670,16 +670,16 @@ pub fn build(b: *std.Build) void { .root_source_file = b.path("src/tests.zig"), .target = target, .optimize = optimize, + .link_libc = true, }); tests_module.addOptions("build-options", options); + tests_module.addIncludePath(b.path("libs/flecs")); + tests_module.linkLibrary(lib); const tests = b.addTest(.{ .name = "zflecs-tests", .root_module = tests_module, }); - tests.addIncludePath(b.path("libs/flecs")); - tests.linkLibrary(lib); - tests.linkLibC(); b.installArtifact(tests); test_step.dependOn(&b.addRunArtifact(tests).step); diff --git a/build.zig.zon b/build.zig.zon index eb398d2..a1ca719 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -2,7 +2,7 @@ .name = .zflecs, .fingerprint = 0xb539547bca77f3d4, .version = "0.2.0-dev", - .minimum_zig_version = "0.15.1", + .minimum_zig_version = "0.16.0-dev.2623+27eec9bd6", .paths = .{ "build.zig", "build.zig.zon", diff --git a/src/tests.zig b/src/tests.zig index bdc6ae7..1c3602d 100644 --- a/src/tests.zig +++ b/src/tests.zig @@ -13,7 +13,7 @@ const Walking = struct {}; const Direction = enum { north, south, east, west }; test { - std.testing.refAllDeclsRecursive(@This()); + std.testing.refAllDecls(@This()); } test "extern struct ABI compatibility" { diff --git a/src/zflecs.zig b/src/zflecs.zig index fe1d80a..b8f5cad 100644 --- a/src/zflecs.zig +++ b/src/zflecs.zig @@ -1319,9 +1319,14 @@ const EcsAllocator = struct { }; fn flecs_abort() callconv(.c) noreturn { - std.debug.dumpCurrentStackTrace(@returnAddress()); + std.debug.dumpCurrentStackTrace(.{ + .first_address = @returnAddress(), + // TODO: Not sure about that + // .allow_unsafe_unwind = false, + // .context = null, + }); @breakpoint(); - std.posix.exit(1); + std.process.exit(1); } //-------------------------------------------------------------------------------------------------- From 7ca9ce5466356ecbb589a3248b3e1ca77d8b23cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Spindler?= Date: Mon, 23 Feb 2026 23:14:19 +0100 Subject: [PATCH 2/5] Make 0.16.0 changes backwards compatible --- src/zflecs.zig | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/zflecs.zig b/src/zflecs.zig index b8f5cad..646af9a 100644 --- a/src/zflecs.zig +++ b/src/zflecs.zig @@ -1319,12 +1319,16 @@ const EcsAllocator = struct { }; fn flecs_abort() callconv(.c) noreturn { - std.debug.dumpCurrentStackTrace(.{ - .first_address = @returnAddress(), - // TODO: Not sure about that - // .allow_unsafe_unwind = false, - // .context = null, - }); + if (builtin.zig_version.major == 0 and builtin.zig_version.minor <= 15) { + std.debug.dumpCurrentStackTrace(@returnAddress()); + } else { + std.debug.dumpCurrentStackTrace(.{ + .first_address = @returnAddress(), + // TODO: Not sure about that + // .allow_unsafe_unwind = false, + // .context = null, + }); + } @breakpoint(); std.process.exit(1); } From 884d3e2cf15ba6bb9bec3dbc3a11eec83c7ceae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Spindler?= Date: Mon, 23 Feb 2026 23:35:31 +0100 Subject: [PATCH 3/5] Add zig version to matrix strategy in github action. For now only 0.15.2 and master (0.16.0-dev nightly) --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1604929..3c14894 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,12 +16,15 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] + zig: [0.15.2, master] runs-on: ${{matrix.os}} steps: - name: Checkout repository uses: actions/checkout@v3 - name: Install Zig uses: mlugg/setup-zig@v2 + with: + version: ${{matrix.zig}} - name: Check format continue-on-error: true run: zig fmt --check . From bec3263f137610af37ce4ff5855697496ef01288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Spindler?= Date: Wed, 25 Feb 2026 22:21:08 +0100 Subject: [PATCH 4/5] Revert minimum zig version to 0.15.1 --- build.zig.zon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig.zon b/build.zig.zon index a1ca719..eb398d2 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -2,7 +2,7 @@ .name = .zflecs, .fingerprint = 0xb539547bca77f3d4, .version = "0.2.0-dev", - .minimum_zig_version = "0.16.0-dev.2623+27eec9bd6", + .minimum_zig_version = "0.15.1", .paths = .{ "build.zig", "build.zig.zon", From a5649648861989b30b9a3658a4627a1f8a902aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Spindler?= Date: Wed, 25 Feb 2026 23:07:51 +0100 Subject: [PATCH 5/5] Change zig version in matrix to 0.15.1 to follow min version --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3c14894..262375e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - zig: [0.15.2, master] + zig: [0.15.1, master] runs-on: ${{matrix.os}} steps: - name: Checkout repository