Skip to content

Commit 92ded91

Browse files
committed
update to latest zig
1 parent daf47cf commit 92ded91

File tree

10 files changed

+196
-191
lines changed

10 files changed

+196
-191
lines changed

build.zig

Lines changed: 55 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub fn build(b: *std.Build) !void {
4949
options.addOption(Version.Kind, "version_kind", version);
5050

5151
const folders = b.dependency("known_folders", .{});
52-
const lsp = b.dependency("lsp_codegen", .{});
52+
const lsp = b.dependency("lsp_kit", .{});
5353

5454
const check = setupCheckStep(b, target, optimize, options, superhtml, folders, lsp);
5555
setupTestStep(b, target, superhtml, check);
@@ -80,9 +80,11 @@ fn setupCheckStep(
8080
const check = b.step("check", "Check if the SuperHTML CLI compiles");
8181
const super_cli_check = b.addExecutable(.{
8282
.name = "superhtml",
83-
.root_source_file = b.path("src/cli.zig"),
84-
.target = target,
85-
.optimize = optimize,
83+
.root_module = b.createModule(.{
84+
.root_source_file = b.path("src/cli.zig"),
85+
.target = target,
86+
.optimize = optimize,
87+
}),
8688
});
8789

8890
super_cli_check.root_module.addImport("superhtml", superhtml);
@@ -107,8 +109,6 @@ fn setupTestStep(
107109

108110
const unit_tests = b.addTest(.{
109111
.root_module = superhtml,
110-
.target = target,
111-
.optimize = .Debug,
112112
// .strip = true,
113113
// .filter = "if-else-loop",
114114
});
@@ -117,9 +117,11 @@ fn setupTestStep(
117117
test_step.dependOn(&run_unit_tests.step);
118118

119119
const fuzz_tests = b.addTest(.{
120-
.root_source_file = b.path("src/fuzz.zig"),
121-
.target = target,
122-
.optimize = .Debug,
120+
.root_module = b.createModule(.{
121+
.root_source_file = b.path("src/fuzz.zig"),
122+
.target = target,
123+
.optimize = .Debug,
124+
}),
123125
// .strip = true,
124126
// .filter = "nesting",
125127
});
@@ -137,9 +139,11 @@ fn setupFuzzStep(
137139
const afl = b.lazyImport(@This(), "afl_kit") orelse return;
138140
const afl_obj = b.addObject(.{
139141
.name = "superfuzz-afl",
140-
.root_source_file = b.path("src/fuzz/afl.zig"),
141-
.target = target,
142-
.optimize = .ReleaseSafe,
142+
.root_module = b.createModule(.{
143+
.root_source_file = b.path("src/fuzz/afl.zig"),
144+
.target = target,
145+
.optimize = .ReleaseSafe,
146+
}),
143147
});
144148

145149
afl_obj.root_module.addImport("superhtml", superhtml);
@@ -159,19 +163,23 @@ fn setupFuzzStep(
159163

160164
const super_fuzz = b.addExecutable(.{
161165
.name = "superfuzz",
162-
.root_source_file = b.path("src/fuzz.zig"),
163-
.target = target,
164-
.optimize = .ReleaseSafe,
166+
.root_module = b.createModule(.{
167+
.root_source_file = b.path("src/fuzz.zig"),
168+
.target = target,
169+
.optimize = .ReleaseSafe,
170+
}),
165171
});
166172

167173
super_fuzz.root_module.addImport("superhtml", superhtml);
168174
b.installArtifact(super_fuzz);
169175

170176
const supergen = b.addExecutable(.{
171177
.name = "supergen",
172-
.root_source_file = b.path("src/fuzz/astgen.zig"),
173-
.target = target,
174-
.optimize = .Debug,
178+
.root_module = b.createModule(.{
179+
.root_source_file = b.path("src/fuzz/astgen.zig"),
180+
.target = target,
181+
.optimize = .Debug,
182+
}),
175183
});
176184

177185
supergen.root_module.addImport("superhtml", superhtml);
@@ -189,10 +197,12 @@ fn setupCliTool(
189197
) void {
190198
const super_cli = b.addExecutable(.{
191199
.name = "superhtml",
192-
.root_source_file = b.path("src/cli.zig"),
193-
.target = target,
194-
.optimize = optimize,
195-
.single_threaded = true,
200+
.root_module = b.createModule(.{
201+
.root_source_file = b.path("src/cli.zig"),
202+
.target = target,
203+
.optimize = optimize,
204+
.single_threaded = true,
205+
}),
196206
});
197207

198208
super_cli.root_module.addImport("superhtml", superhtml);
@@ -221,14 +231,16 @@ fn setupWasmStep(
221231
const wasm = b.step("wasm", "Generate a WASM build of the SuperHTML LSP for VSCode");
222232
const super_wasm_lsp = b.addExecutable(.{
223233
.name = "superhtml",
224-
.root_source_file = b.path("src/wasm.zig"),
225-
.target = b.resolveTargetQuery(.{
226-
.cpu_arch = .wasm32,
227-
.os_tag = .wasi,
234+
.root_module = b.createModule(.{
235+
.root_source_file = b.path("src/wasm.zig"),
236+
.target = b.resolveTargetQuery(.{
237+
.cpu_arch = .wasm32,
238+
.os_tag = .wasi,
239+
}),
240+
.optimize = optimize,
241+
.single_threaded = true,
242+
.link_libc = false,
228243
}),
229-
.optimize = optimize,
230-
.single_threaded = true,
231-
.link_libc = false,
232244
});
233245

234246
super_wasm_lsp.root_module.addImport("superhtml", superhtml);
@@ -266,9 +278,11 @@ fn setupReleaseStep(
266278

267279
const super_exe_release = b.addExecutable(.{
268280
.name = "superhtml",
269-
.root_source_file = b.path("src/cli.zig"),
270-
.target = release_target,
271-
.optimize = .ReleaseFast,
281+
.root_module = b.createModule(.{
282+
.root_source_file = b.path("src/cli.zig"),
283+
.target = release_target,
284+
.optimize = .ReleaseFast,
285+
}),
272286
});
273287

274288
super_exe_release.root_module.addImport("superhtml", superhtml);
@@ -294,14 +308,16 @@ fn setupReleaseStep(
294308
{
295309
const super_wasm_lsp = b.addExecutable(.{
296310
.name = "superhtml",
297-
.root_source_file = b.path("src/wasm.zig"),
298-
.target = b.resolveTargetQuery(.{
299-
.cpu_arch = .wasm32,
300-
.os_tag = .wasi,
311+
.root_module = b.createModule(.{
312+
.root_source_file = b.path("src/wasm.zig"),
313+
.target = b.resolveTargetQuery(.{
314+
.cpu_arch = .wasm32,
315+
.os_tag = .wasi,
316+
}),
317+
.optimize = .ReleaseSmall,
318+
.single_threaded = true,
319+
.link_libc = false,
301320
}),
302-
.optimize = .ReleaseSmall,
303-
.single_threaded = true,
304-
.link_libc = false,
305321
});
306322

307323
super_wasm_lsp.root_module.addImport("superhtml", superhtml);

build.zig.zon

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
.fingerprint = 0xc5e9aede3c1db363,
55
.minimum_zig_version = "0.14.0",
66
.dependencies = .{
7-
.lsp_codegen = .{
8-
.url = "git+https://github.com/zigtools/zig-lsp-codegen.git#eab79f82a583cf537c59009840f00d686b32d49a",
9-
.hash = "lsp_codegen-0.1.0-CMjjo61BCgB43M7Rfw_zGkIn_zigAe7MMlE_Cu9p3HZ6",
10-
},
117
.afl_kit = .{
12-
.url = "git+https://github.com/kristoff-it/zig-afl-kit#39c33d45dbe3605a9ef7cab863620d1ca78a3623",
13-
.hash = "zig_afl_kit-0.1.0-3k74fQAdAABrirJM84Lo-lnl9mnUMwtJCSPPyIJ0OzAr",
8+
.url = "git+https://github.com/kristoff-it/zig-afl-kit#8ef04d1db48650345dca68da1e1b8f2615125c40",
9+
.hash = "afl_kit-0.1.0-NdJ3cvscAACLEvjZTB017IAks_Uq5ux1qpA-klDe384Y",
1410
.lazy = true,
1511
},
1612
.known_folders = .{
@@ -21,9 +17,13 @@
2117
.url = "git+https://github.com/kristoff-it/tracy#67d2d89e351048c76fc6d161e0ac09d8a831dc60",
2218
.hash = "tracy-0.0.0-4Xw-1pwwAABTfMgoDP1unCbZDZhJEfict7XCBGF6IdIn",
2319
},
20+
.lsp_kit = .{
21+
.url = "git+https://github.com/zigtools/lsp-kit#e58d398b4058eea09d984d5d039eddd243e535ad",
22+
.hash = "lsp_kit-0.1.0-bi_PL5IyCgCh6ZNq1VaDklFqV0u23xNSXONjfDpYceJr",
23+
},
2424
.scripty = .{
25-
.url = "git+https://github.com/kristoff-it/scripty#131704ebf9b3557c9480248787bd7b640a6ac98d",
26-
.hash = "scripty-0.1.0-LKK5O83DAACoGpVDkm8JxzgevTE76bkf0n3mHyTej9nb",
25+
.url = "git+https://github.com/kristoff-it/scripty#3d56bb62a1aec0b07b634aea42ec46e72e017e33",
26+
.hash = "scripty-0.1.0-LKK5O2zEAADkO2rJa_QbMWwC_YmFnUKC384wwMeBGOQv",
2727
},
2828
},
2929
.paths = .{

0 commit comments

Comments
 (0)