Skip to content

Commit c984005

Browse files
authored
Merge pull request #1 from sea-grass/upgrade-to-zig-0.15.0-dev.377+f01833e03
Update to zig 0.15.0-dev.377+f01833e03
2 parents eaa5ba4 + 7a3403f commit c984005

26 files changed

+316
-312
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v4
1212
- uses: mlugg/setup-zig@v1
1313
with:
14-
version: 0.13.0
14+
version: master
1515
- run: zig build release
1616
- name: zip artifact
1717
run: |

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ jobs:
1010
- uses: actions/checkout@v4
1111
- uses: mlugg/setup-zig@v1
1212
with:
13-
version: 0.13.0
14-
- uses: leafo/gh-actions-lua@v10
13+
version: master
14+
- uses: ilammy/msvc-dev-cmd@v1
15+
- uses: leafo/gh-actions-lua@v11
1516
with:
1617
luaVersion: "5.4.7"
1718
- uses: luarocks/gh-actions-luarocks@v5
@@ -29,5 +30,5 @@ jobs:
2930
- uses: actions/checkout@v4
3031
- uses: mlugg/setup-zig@v1
3132
with:
32-
version: 0.13.0
33+
version: master
3334
- run: zig fmt --check .

build.zig

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const std = @import("std");
2-
const e = @import("embed-file");
2+
const e = @import("embed_file");
33

44
const Dep = struct {
55
name: []const u8,
@@ -37,7 +37,7 @@ pub fn build(b: *std.Build) !void {
3737
.optimize = optimize,
3838
.link_libc = true,
3939
});
40-
for (deps) |dep| dep.addImport(&lib.root_module);
40+
for (deps) |dep| dep.addImport(lib.root_module);
4141
const lib_install = b.addInstallFileWithDir(
4242
lib.getEmittedBin(),
4343
.lib,
@@ -53,15 +53,15 @@ pub fn build(b: *std.Build) !void {
5353
.target = target,
5454
.optimize = optimize,
5555
});
56-
for (deps) |dep| dep.addImport(&exe.root_module);
56+
for (deps) |dep| dep.addImport(exe.root_module);
5757
b.installArtifact(exe);
5858

5959
const tests = b.addTest(.{
6060
.target = target,
6161
.optimize = optimize,
6262
.root_source_file = b.path("src/main.zig"),
6363
});
64-
for (deps) |dep| dep.addImport(&tests.root_module);
64+
for (deps) |dep| dep.addImport(tests.root_module);
6565
const tests_run = b.addRunArtifact(tests);
6666

6767
const tests_step = b.step("test", "test seamstress");
@@ -86,8 +86,8 @@ pub fn build(b: *std.Build) !void {
8686
.optimize = optimize,
8787
});
8888
for (deps) |dep| {
89-
dep.addImport(&root_comp_check.root_module);
90-
dep.addImport(&comp_check.root_module);
89+
dep.addImport(root_comp_check.root_module);
90+
dep.addImport(comp_check.root_module);
9191
}
9292
const check = b.step("check", "check for compile errors");
9393
check.dependOn(&comp_check.step);
@@ -125,7 +125,7 @@ pub fn build(b: *std.Build) !void {
125125
.target = t,
126126
.optimize = release_mode,
127127
});
128-
for (target_deps) |dep| dep.addImport(&release_exe.root_module);
128+
for (target_deps) |dep| dep.addImport(release_exe.root_module);
129129

130130
const target_output = b.addInstallArtifact(release_exe, .{
131131
.dest_dir = .{ .override = .{
@@ -140,16 +140,16 @@ pub fn build(b: *std.Build) !void {
140140
}
141141

142142
fn createImports(b: *std.Build, options: Options) []const Dep {
143-
var list: std.ArrayListUnmanaged(Dep) = .{};
143+
var list: std.ArrayListUnmanaged(Dep) = .empty;
144144
list.ensureTotalCapacity(b.allocator, 5) catch @panic("OOM");
145145

146146
const assets = b.createModule(.{
147-
.root_source_file = b.addWriteFile("module.zig",
147+
.root_source_file = b.addWriteFiles().add("module.zig",
148148
\\pub const lua = @import("lua");
149149
\\pub const @"test" = @import("test");
150150
\\pub const version = @import("version").version;
151151
\\
152-
).files.items[0].getPath(),
152+
),
153153
});
154154
{
155155
const lua_files: []const []const u8 = &.{
@@ -174,7 +174,7 @@ fn createImports(b: *std.Build, options: Options) []const Dep {
174174
{
175175
const ef = e.addEmbedFiles(b);
176176
ef.addFile(b.path("version.txt"), "semver-str", null);
177-
const wf_module = b.addWriteFile("version.zig",
177+
const wf_module = b.addWriteFiles().add("version.zig",
178178
\\const semver_str = str: {
179179
\\ const str = @import("semver-str").@"semver-str";
180180
\\ if (std.mem.indexOfAny(u8, &str, "\r\n \t")) |idx| break :str str[0..idx];
@@ -187,13 +187,13 @@ fn createImports(b: *std.Build, options: Options) []const Dep {
187187
\\ @compileLog("error: ", err);
188188
\\ @compileError("semantic version string failed to parse!");
189189
\\};
190-
).files.items[0].getPath();
190+
);
191191
const version = b.createModule(.{ .root_source_file = wf_module });
192192
version.addImport("semver-str", ef.module);
193193
assets.addImport("version", version);
194194
}
195195

196-
const ziglua = b.dependency("ziglua", .{
196+
const zlua = b.dependency("zlua", .{
197197
.target = options.target,
198198
.optimize = options.optimize,
199199
});
@@ -205,11 +205,11 @@ fn createImports(b: *std.Build, options: Options) []const Dep {
205205
.target = options.target,
206206
.optimize = options.optimize,
207207
});
208-
const @"known-folders" = b.dependency("known-folders", .{});
209-
list.appendAssumeCapacity(.{ .module = ziglua.module("ziglua"), .name = "ziglua" });
208+
const known_folders = b.dependency("known_folders", .{});
209+
list.appendAssumeCapacity(.{ .module = zlua.module("zlua"), .name = "zlua" });
210210
list.appendAssumeCapacity(.{ .module = xev.module("xev"), .name = "xev" });
211211
list.appendAssumeCapacity(.{ .module = zosc.module("zosc"), .name = "zosc" });
212-
list.appendAssumeCapacity(.{ .module = @"known-folders".module("known-folders"), .name = "known-folders" });
212+
list.appendAssumeCapacity(.{ .module = known_folders.module("known-folders"), .name = "known-folders" });
213213
list.appendAssumeCapacity(.{ .module = assets, .name = "assets" });
214214
return list.items;
215215
}

build.zig.zon

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
.{
2-
.name = "seamstress",
2+
.name = .steamstress,
33
.version = "2.0.0-prealpha-3",
4+
.fingerprint = 0xd0e1bb1829aedf14,
45
.paths = .{ "build.zig.zon", "build.zig", "src", "lua" },
56
.dependencies = .{
6-
.ziglua = .{
7-
.url = "git+https://github.com/robbielyman/ziglua?ref=byo-lua#69a86667f31257e8529a3d20e1799283984bead5",
8-
.hash = "12202e945f7d80689f48333beefd8a1993f3a67ca6af400d9c746f1a121fc7cb78fa",
7+
.zlua = .{
8+
.url = "git+https://github.com/natecraddock/ziglua#f7b3c90d026afd33b0a70debfd54ea50f1acfc1b",
9+
.hash = "zlua-0.1.0-hGRpC-IZBQDD9MfKTbeRE3z_Qg-kI2SqnT1JaRl9W9Sq",
910
},
1011
.libxev = .{
11-
.url = "git+https://github.com/robbielyman/libxev?ref=seamstress-branch#8cfc85b21974996775d7ca8a4febc5d0963e6f7f",
12-
.hash = "1220c9e5ef90baa4bcc9ceb73edf54961ca4de5d0bcebec6aff38a20079947b04682",
12+
.url = "git+https://github.com/mitchellh/libxev?ref=main#94ed6af7b2aaaeab987fbf87fcee410063df715b",
13+
.hash = "libxev-0.0.0-86vtc-zkEgB7uv1i0Sa6ytJETZQi_lHJrImu9mLb9moi",
1314
},
1415
.zosc = .{
15-
.url = "git+https://github.com/robbielyman/zosc?ref=v1.1.0#ef8caf3c9f86b09b7fbed9fe6d4cdba3a43fb9de",
16-
.hash = "12207c108f821340bc3514117afd24bace658bc3ad06b79c51d1440eb498cec4349c",
16+
.url = "git+https://github.com/robbielyman/zosc?ref=main#574938ce59505e57df1ed7b22d505e84a4c6f051",
17+
.hash = "zosc-0.1.0-Y0MRGIJmAQAp85zMQYfekmcK-CPy2U1bNAN3H0-gH3XS",
1718
},
18-
.@"embed-file" = .{
19-
.url = "git+https://github.com/robbielyman/EmbedFile.zig#b5ae28c2812a510de762b41cea489aad80bc039a",
20-
.hash = "1220633202df3bfbf2436d80dee0cf94b7eeab59177b4d777680f175a08fa8deaf41",
19+
.embed_file = .{
20+
.url = "git+https://github.com/robbielyman/EmbedFile.zig?ref=main#67d95b1a7db29bf80fe7db5daeb3878b1002f3e9",
21+
.hash = "embed_file-1.0.0-xHnAJbRyAACyaZoX76xXnqJr8ZPsACm12-D4C_VIXEFc",
2122
},
22-
.@"known-folders" = .{
23-
.url = "git+https://github.com/ziglibs/known-folders#1cceeb70e77dec941a4178160ff6c8d05a74de6f",
24-
.hash = "12205f5e7505c96573f6fc5144592ec38942fb0a326d692f9cddc0c7dd38f9028f29",
23+
.known_folders = .{
24+
.url = "git+https://github.com/ziglibs/known-folders?ref=master#aa24df42183ad415d10bc0a33e6238c437fc0f59",
25+
.hash = "known_folders-0.0.0-Fy-PJtLDAADGDOwYwMkVydMSTp_aN-nfjCZw6qPQ2ECL",
2526
},
2627
},
2728
}

design.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Here is an example from =cli.zig=:
250250
// l is the seamstress Lua environment.
251251
// self is a pointer to the CLI struct
252252
l.pushLightUserdata(self);
253-
l.pushClosure(ziglua.wrap(struct {
253+
l.pushClosure(zlua.wrap(struct {
254254
fn f(l: *Lua) i32 {
255255
const i = Lua.upvalueIndex(1);
256256
const cli = l.toUserdata(Cli, i) catch unreachable;

src/args.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const Args = @This();
22

3-
logging: logging.Args,
3+
log: logging.Args,
44
run: Seamstress.RunArgs,
55

66
pub fn format(args: Args, comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void {
7-
try writer.print("log file: {s}, log level: {s}\n", .{ args.logging.path orelse "default", switch (args.logging.level) {
7+
try writer.print("log file: {s}, log level: {s}\n", .{ args.log.path orelse "default", switch (args.log.level) {
88
.err => "error",
99
.warn => "warning",
1010
.info => "info",
@@ -67,7 +67,7 @@ pub fn process(cli_args: []const []const u8) Args {
6767
file = arg;
6868
}
6969
return .{
70-
.logging = logging_arg,
70+
.log = logging_arg,
7171
.run = .{
7272
.file = file,
7373
.tests = .{

0 commit comments

Comments
 (0)