From 18091b440676737829cb4da154f9dd595449374b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 2 Feb 2024 20:35:14 -0700 Subject: [PATCH] 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. --- lib/std/Build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/Build.zig b/lib/std/Build.zig index 0de6f3329b..d962a82d89 100644 --- a/lib/std/Build.zig +++ b/lib/std/Build.zig @@ -1858,7 +1858,7 @@ pub fn dependency(b: *Build, name: []const u8, args: anytype) *Dependency { if (mem.eql(u8, decl.name, pkg_hash)) { const pkg = @field(deps.packages, decl.name); if (@hasDecl(pkg, "available")) { - @compileError("dependency is marked as lazy in build.zig.zon which means it must use the lazyDependency function instead"); + 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 }); } return dependencyInner(b, name, pkg.build_root, if (@hasDecl(pkg, "build_zig")) pkg.build_zig else null, pkg.deps, args); }