i’m working with two modules (zig-cli
and zig-yaml
) – both of which i’ve cloned, built, and tested with my recent version of zig build
…
following protocol, i then prepared a build.zig.zon
file with the appropriate dependencies:
.dependencies = .{
.@"zig-cli" = .{
.url = "https://github.com/sam701/zig-cli/archive/beff935fe77a0ed794e8727d48e7780485abb880.tar.gz",
.hash = "122092c8a98897c6e0946f39930ce7b48162bd62400834104c95c871f53887377aa7",
},
.@"zig-yaml" = .{
.url = "https://github.com/kubkon/zig-yaml/archive/9308a64224f32184500d8a8178be0066443d65bc.tar.gz",
.hash = "122084941d6e06491a85e1356c7cca24a078103d34155e34a10a16a53f420d6bc37b",
},
i verifed these hashes using zig fetch --save
…
in my build.zig
file, i have the following loop which adds the modules as dependencies of my main program:
const DEPS: [2][]const u8 = .{
"zig-cli",
"zig-yaml",
};
for (DEPS) |name| {
std.debug.print("name = {s}\n", .{name});
const dep = b.dependency(name, .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport(name, dep.module(name));
}
everything works fine with zig-cli
, but for some reason zig-yaml
causes the following failure from zig build
$ zig build
name = zig-cli
name = zig-yaml
thread 14488 panic: unable to find module 'zig-yaml'
C:\tools\zig-dev\lib\std\debug.zig:434:22: 0xf60965 in panicExtra__anon_15732 (build.exe.obj)
std.builtin.panic(msg, trace, ret_addr);
^
C:\tools\zig-dev\lib\std\debug.zig:409:15: 0xf348fc in panic__anon_15228 (build.exe.obj)
panicExtra(null, null, format, args);
^
C:\tools\zig-dev\lib\std\Build.zig:1804:18: 0xf0ad89 in module (build.exe.obj)
panic("unable to find module '{s}'", .{name});
^
C:\Users\biosb\gitrepos\zigem\build.zig:24:51: 0xebf859 in build (build.exe.obj)
exe.root_module.addImport(name, dep.module(name));
^
C:\tools\zig-dev\lib\std\Build.zig:2000:33: 0xe9e2c5 in runBuild__anon_8779 (build.exe.obj)
.Void => build_zig.build(b),
^
C:\tools\zig-dev\lib\compiler\build_runner.zig:310:29: 0xe9936c in main (build.exe.obj)
try builder.runBuild(root);
^
C:\tools\zig-dev\lib\std\start.zig:350:53: 0xea02ec in WinStartup (build.exe.obj)
std.os.windows.ntdll.RtlExitUserProcess(callMain());
^
???:?:?: 0x7ffc4d1d7343 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffc4d6a26b0 in ??? (ntdll.dll)
error: unable to read results of configure phase from 'C:\Users\biosb\gitrepos\zigem\zig-cache\tmp\ff50a1d5f14c31f7': FileNotFound
main.zig
trivially imports these two modules:
const cli = @import("zig-cli");
const yaml = @import("zig-yaml");
as the category says, HELP !!!