From cd2161f6010de472deb0d9e20ef23fa155d5b835 Mon Sep 17 00:00:00 2001 From: sadguitarius Date: Mon, 23 Feb 2026 22:48:47 -0800 Subject: [PATCH 1/6] fix building with Zig 0.15 --- build.zig | 19 ++++++++++++------- build.zig.zon | 44 ++------------------------------------------ 2 files changed, 14 insertions(+), 49 deletions(-) diff --git a/build.zig b/build.zig index ab02e50..627fe8f 100644 --- a/build.zig +++ b/build.zig @@ -7,20 +7,25 @@ pub fn build(b: *std.Build) void { .root_source_file = b.path("src/root.zig"), }); - const lib = b.addStaticLibrary(.{ + const lib = b.addLibrary(.{ .name = "zigosc", - .root_source_file = b.path("src/root.zig"), - .target = target, - .optimize = optimize, + .linkage = .static, + .root_module = b.createModule(.{ + .root_source_file = b.path("src/root.zig"), + .target = target, + .optimize = optimize, + }) }); b.installArtifact(lib); zigosc.linkLibrary(lib); const lib_unit_tests = b.addTest(.{ - .root_source_file = b.path("src/root.zig"), - .target = target, - .optimize = optimize, + .root_module = b.createModule(.{ + .root_source_file = b.path("src/root.zig"), + .target = target, + .optimize = optimize, + }), }); const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests); const test_step = b.step("test", "Run unit tests"); diff --git a/build.zig.zon b/build.zig.zon index 7fd5b6f..a5aaa53 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,51 +1,11 @@ .{ - .name = "zigosc", - // This is a [Semantic Version](https://semver.org/). - // In a future version of Zig it will be used for package deduplication. + .name = .zigosc, + .fingerprint = 0xba8ac348895bb149, .version = "0.1.0", - // This field is optional. - // This is currently advisory only; Zig does not yet do anything - // with this value. - //.minimum_zig_version = "0.11.0", - - // This field is optional. - // Each dependency must either provide a `url` and `hash`, or a `path`. - // `zig build --fetch` can be used to fetch all dependencies of a package, recursively. - // Once all dependencies are fetched, `zig build` no longer requires - // Internet connectivity. .dependencies = .{ - // See `zig fetch --save ` for a command-line interface for adding dependencies. - //.example = .{ - // // When updating this field to a new URL, be sure to delete the corresponding - // // `hash`, otherwise you are communicating that you expect to find the old hash at - // // the new URL. - // .url = "https://example.com/foo.tar.gz", - // - // // This is computed from the file contents of the directory of files that is - // // obtained after fetching `url` and applying the inclusion rules given by - // // `paths`. - // // - // // This field is the source of truth; packages do not come from an `url`; they - // // come from a `hash`. `url` is just one of many possible mirrors for how to - // // obtain a package matching this `hash`. - // // - // // Uses the [multihash](https://multiformats.io/multihash/) format. - // .hash = "...", - // - // // When this is provided, the package is found in a directory relative to the - // // build root. In this case the package's hash is irrelevant and therefore not - // // computed. This field and `url` are mutually exclusive. - // .path = "foo", - //}, }, - // Specifies the set of files and directories that are included in this package. - // Only files and directories listed here are included in the `hash` that - // is computed for this package. - // Paths are relative to the build root. Use the empty string (`""`) to refer to - // the build root itself. - // A directory listed here means that all files within, recursively, are included. .paths = .{ "build.zig", "build.zig.zon", From 2749e4311c387252bd13d58ec5aa47bfd958fa4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Granstr=C3=B6m?= Date: Tue, 24 Feb 2026 09:50:21 +0100 Subject: [PATCH 2/6] Format with zig fmt --- build.zig | 2 +- build.zig.zon | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/build.zig b/build.zig index 627fe8f..1767924 100644 --- a/build.zig +++ b/build.zig @@ -14,7 +14,7 @@ pub fn build(b: *std.Build) void { .root_source_file = b.path("src/root.zig"), .target = target, .optimize = optimize, - }) + }), }); b.installArtifact(lib); diff --git a/build.zig.zon b/build.zig.zon index a5aaa53..039bb7b 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -2,10 +2,7 @@ .name = .zigosc, .fingerprint = 0xba8ac348895bb149, .version = "0.1.0", - - .dependencies = .{ - }, - + .dependencies = .{}, .paths = .{ "build.zig", "build.zig.zon", From bbb2e4fb4bdd7704b83997fcb0a279c7c545e62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Granstr=C3=B6m?= Date: Tue, 24 Feb 2026 09:50:56 +0100 Subject: [PATCH 3/6] Use zig 0.15.2 on CI --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 84c7346..e1bc5ff 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -15,5 +15,5 @@ jobs: - uses: actions/checkout@v4 - uses: mlugg/setup-zig@v1 with: - version: master + version: 0.15.2 - run: zig build test --summary all From e5cd18acaf0464554edfccd230d6ee0c4f7dfd30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Granstr=C3=B6m?= Date: Tue, 24 Feb 2026 09:56:45 +0100 Subject: [PATCH 4/6] Fix action --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index e1bc5ff..f01246c 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -13,7 +13,7 @@ jobs: name: Build and Test steps: - uses: actions/checkout@v4 - - uses: mlugg/setup-zig@v1 + - uses: https://codeberg.org/mlugg/setup-zig@v2 with: version: 0.15.2 - run: zig build test --summary all From 1aceb7d69ded180a5e004133dc7eb2bf82345de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Granstr=C3=B6m?= Date: Tue, 24 Feb 2026 09:59:08 +0100 Subject: [PATCH 5/6] Downgrade --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f01246c..8b0513e 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest name: Build and Test steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - uses: https://codeberg.org/mlugg/setup-zig@v2 with: version: 0.15.2 From 37566121612332d5d79ff370cd2e5e50cfa53201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Granstr=C3=B6m?= Date: Tue, 24 Feb 2026 10:02:16 +0100 Subject: [PATCH 6/6] Try again --- .github/workflows/unit-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 8b0513e..65bb2d2 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -12,8 +12,8 @@ jobs: runs-on: ubuntu-latest name: Build and Test steps: - - uses: actions/checkout@v3 - - uses: https://codeberg.org/mlugg/setup-zig@v2 + - uses: actions/checkout@v4 + - uses: mlugg/setup-zig@v2 with: version: 0.15.2 - run: zig build test --summary all