-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorzig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management
Description
Zig Version
0.12.0-dev.3381+7057bffc1
Steps to Reproduce and Observed Behavior
Unexpected error importing a package dependencie in build scripts.
build.zig.zon:
.{
.name = "my_extension",
.version = "0.1.0",
.paths = .{
"src",
},
.dependencies = .{
.pgzx = .{
.url = "https://github.com/xataio/pgzx/archive/main.tar.gz",
.hash = "1220af8396f144d87259e959493e54d27f52006bab3905a349d2bc96130b437faaed",
},
},
}
build.zig:
const std = @import("std");
const pgzx = @import("pgzx");
pub fn build(b: *std.Build) void {
_ = b;
_ = pgzx;
}
Error message:
$ zig/build/stage3/bin/zig build
xxxx/build.zig:2:22: error: no module named 'pgzx' available within module root.@build
const pgzx = @import("pgzx");
Expected Behavior
According to #14279 it seems that it shall be possible to import package dependencies in build scripts. This allows projects to share some common build utilities with downstream projects. We used that mechanism, but it seems to have been regressed recently.
Note: It is still possible to import a package that is referenced by path:
.dependencies = .{
.pgzx = .{
.path = "./../pgzx",
},
},
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorzig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management