Skip to content

Commit aa24df4

Browse files
authored
fix build with Zig 0.14.0-dev.3445+6c3cbb0c8 (Breaking Change) (#57)
1 parent 1cceeb7 commit aa24df4

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed

.github/workflows/build.yml

+3-8
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ jobs:
1414
matrix:
1515
zig-version: [master]
1616
os: [ubuntu-latest, macos-latest, windows-latest]
17-
include:
18-
- zig-version: "0.12.1"
19-
os: ubuntu-latest
20-
- zig-version: "0.13.0"
21-
os: ubuntu-latest
17+
# include:
18+
# - zig-version: "0.14.0"
19+
# os: ubuntu-latest
2220
runs-on: ${{ matrix.os }}
2321
steps:
2422
- name: Checkout
@@ -35,8 +33,6 @@ jobs:
3533
- name: Setup `wasmtime`
3634
if: matrix.os == 'ubuntu-latest'
3735
uses: bytecodealliance/actions/wasmtime/setup@v1
38-
with:
39-
version: "21.0.1" # Wasmtime v22.0.0 has removed support for the "Wasmtime 13-and-prior CLI"
4036

4137
- name: Print wasmtime version
4238
if: matrix.os == 'ubuntu-latest'
@@ -46,5 +42,4 @@ jobs:
4642
if: matrix.os == 'ubuntu-latest'
4743
run: zig build test -Dtarget=wasm32-wasi -fwasmtime --summary all
4844
env:
49-
WASMTIME_NEW_CLI: 0
5045
WASMTIME_BACKTRACE_DETAILS: 1

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,16 @@ pub fn getPath(allocator: std.mem.Allocator, folder: KnownFolder) Error!?[]const
4545

4646
## Installation
4747

48+
> [!NOTE]
49+
> The minimum supported Zig version is `0.14.0-dev.3445+6c3cbb0c8`.
50+
4851
Initialize a `zig build` project if you haven't already.
4952

5053
```bash
5154
zig init
5255
```
5356

54-
Add the `known-folders` package to your `build.zig.zon`.
57+
Add the `known_folders` package to your `build.zig.zon`.
5558

5659
```bash
5760
zig fetch --save git+https://github.com/ziglibs/known-folders.git
@@ -60,7 +63,7 @@ zig fetch --save git+https://github.com/ziglibs/known-folders.git
6063
You can then import `known-folders` in your `build.zig` with:
6164

6265
```zig
63-
const known_folders = b.dependency("known-folders", .{}).module("known-folders");
66+
const known_folders = b.dependency("known_folders", .{}).module("known-folders");
6467
const exe = b.addExecutable(...);
6568
// This adds the known-folders module to the executable which can then be imported with `@import("known-folders")`
6669
exe.root_module.addImport("known-folders", known_folders);

build.zig

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const std = @import("std");
22
const builtin = @import("builtin");
33

4-
const minimum_zig_version = std.SemanticVersion.parse("0.12.0") catch unreachable;
4+
const minimum_zig_version = std.SemanticVersion.parse("0.14.0-dev.3445+6c3cbb0c8") catch unreachable;
55

66
pub fn build(b: *std.Build) void {
77
if (comptime (builtin.zig_version.order(minimum_zig_version) == .lt)) {
@@ -22,18 +22,15 @@ pub fn build(b: *std.Build) void {
2222
const strip = b.option(bool, "strip", "Omit debug information");
2323
const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{};
2424

25-
_ = b.addModule("known-folders", .{
25+
const mod = b.addModule("known-folders", .{
2626
.root_source_file = b.path("known-folders.zig"),
2727
.target = target,
2828
.optimize = optimize,
2929
.strip = strip,
3030
});
3131

3232
const unit_tests = b.addTest(.{
33-
.root_source_file = b.path("known-folders.zig"),
34-
.target = target,
35-
.optimize = optimize,
36-
.strip = strip,
33+
.root_module = mod,
3734
.filters = test_filters,
3835
});
3936

build.zig.zon

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.{
2-
.name = "known-folders",
2+
.name = .known_folders,
33
.version = "0.0.0",
4-
.minimum_zig_version = "0.12.0",
4+
.minimum_zig_version = "0.14.0-dev.3445+6c3cbb0c8",
55
.dependencies = .{},
66
.paths = .{
77
"build.zig",
@@ -11,4 +11,5 @@
1111
"README.md",
1212
"RESOURCES.md",
1313
},
14+
.fingerprint = 0x8b68d75b268f2f17, // Changing this has security and trust implications.
1415
}

0 commit comments

Comments
 (0)