authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2024-04-18 11:24:42-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-04-18 11:24:42-07:00
log1b4ea80654a71324faba01da0cc04c09fb7e7f77
treebb7f23614e2694675ad063ba58c98508632fd7d4
parent0820aa4a46ee346282269f2a273f1059418e8702
signaturebadge-check Signed by PGP key B5690EEEBB952194

do more robust import

Co-authored-by: Carl Åstholm <carl@astholm.se>

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

  • foldertest
test/standalone/dependencyFromBuildZig/build.zig+1-5
......@@ -6,11 +6,7 @@ pub fn build(b: *std.Build) void {
66
77 const dep1 = b.dependency("other", .{});
88
9 const build_runner = @import("root");
10 const deps = build_runner.dependencies;
11 const zon_decls = @typeInfo(deps.packages).Struct.decls;
12 const pkg = @field(deps.packages, zon_decls[0].name);
13 const dep2 = b.dependencyFromBuildZig(pkg.build_zig, .{});
9 const dep2 = b.dependencyFromBuildZig(@import("other"), .{});
1410
1511 std.debug.assert(dep1.module("add") == dep2.module("add"));
1612}