diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1604929..262375e 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.1, 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 . 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/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..646af9a 100644 --- a/src/zflecs.zig +++ b/src/zflecs.zig @@ -1319,9 +1319,18 @@ const EcsAllocator = struct { }; fn flecs_abort() callconv(.c) noreturn { - std.debug.dumpCurrentStackTrace(@returnAddress()); + 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.posix.exit(1); + std.process.exit(1); } //--------------------------------------------------------------------------------------------------