authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-02 20:35:14-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-02 20:43:01-07:00
log18091b440676737829cb4da154f9dd595449374b
tree75ce9ab420868035c35089c635f226bb8dfe4cad
parenta17505c71109361b7b4bd13125871299de53e4e0

std.Build: use a runtime panic for wrong dependency API

This makes it easier to debug and avoids a false positive compile error in the build script.

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/Build.zig+1-1
......@@ -1858,7 +1858,7 @@ pub fn dependency(b: *Build, name: []const u8, args: anytype) *Dependency {
18581858 if (mem.eql(u8, decl.name, pkg_hash)) {
18591859 const pkg = @field(deps.packages, decl.name);
18601860 if (@hasDecl(pkg, "available")) {
1861 @compileError("dependency is marked as lazy in build.zig.zon which means it must use the lazyDependency function instead");
1861 std.debug.panic("dependency '{s}{s}' is marked as lazy in build.zig.zon which means it must use the lazyDependency function instead", .{ b.dep_prefix, name });
18621862 }
18631863 return dependencyInner(b, name, pkg.build_root, if (@hasDecl(pkg, "build_zig")) pkg.build_zig else null, pkg.deps, args);
18641864 }