here’s my build.zig
file, in which i just added "ini"
as one of my dependencies:
const std = @import("std");
const DEPS = [_][]const u8{
"ini",
"zig-cli",
};
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "zig-em",
.root_source_file = std.Build.path(b, "src/main.zig"),
.target = target,
.optimize = optimize,
});
for (DEPS) |name| {
const dep = b.dependency(name, .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport(name, dep.module(name));
}
b.installArtifact(exe);
}
and here’s my build.zig.zon
file, which references both of dependencies:
.{
.name = "zig-em",
.version = "0.24.0",
.paths = .{"./src"},
.dependencies = .{
.ini = .{
.url = "https://github.com/ziglibs/ini/archive/e18d36665905c1e7ba0c1ce3e8780076b33e3002.tar.gz", // 0.13.0
.hash = "1220ab73fb7cc11b2308edc3364988e05efcddbcac31b707f55e6216d1b9c0da13f1" , // a temporary "wrong" hash,
},
.@"zig-cli" = .{
.url = "https://github.com/sam701/zig-cli/archive/9a94c4803a52e54c26b198096d63fb5bde752da2.tar.gz", // 0.9.0
.hash = "1220ab73fb7cc11b2308edc3364988e05efcddbcac31b707f55e6216d1b9c0da13f1"
},
},
}
not known the actual hash for the new ini
module, i was hoping to get an earlier error from zig build
which would inform me of the expected value…
when i build, however, it doesn’t appear to even process ini
upfront… and later in the build, i receive the following error:
$ zig build
thread 18468 panic: unable to find module 'ini'
C:\tools\zig-windows-x86_64-0.13.0\lib\std\Build.zig:1857:18: 0xdac1a9 in module (build.exe.obj)
panic("unable to find module '{s}'", .{name});
^
C:\Users\biosb\zig\zig-em-dev\build.zig:23:51: 0xd64e3e in build (build.exe.obj)
exe.root_module.addImport(name, dep.module(name));
^
C:\tools\zig-windows-x86_64-0.13.0\lib\std\Build.zig:2116:33: 0xd4d955 in runBuild__anon_8953 (build.exe.obj)
.Void => build_zig.build(b),
^
C:\tools\zig-windows-x86_64-0.13.0\lib\compiler\build_runner.zig:301:29: 0xd48cec in main (build.exe.obj)
try builder.runBuild(root);
^
C:\tools\zig-windows-x86_64-0.13.0\lib\std\start.zig:363:53: 0xd4fb8c in WinStartup (build.exe.obj)
std.os.windows.ntdll.RtlExitUserProcess(callMain());
^
???:?:?: 0x7ff84da67373 in ??? (KERNEL32.DLL)
???:?:?: 0x7ff84f95cc90 in ??? (ntdll.dll)
i’m still learning about build.zig
and may be missing something obvious…