-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management
Milestone
Description
Zig Version
0.11.0-dev.1782+b52be973d
Steps to Reproduce and Observed Behavior
fn createModule(b: *std.Build) *std.Build.Module {
const recursive_module = b.createModule(
.{ .source_file = .{ .path = "module/module.zig" } },
);
return b.createModule(.{
.source_file = .{ .path = "module/module.zig" },
.dependencies = &.{
.{ .name = "module", .module = recursive_module },
},
});
}using a function like the above to create a module that can import its own root file worked on version 0.11.0-dev.1711+dc1f50e50 but now results in errors like:
$ zig build run
module/module.zig:1:1: error: file exists in multiple modules
module/module.zig:1:1: note: root of module root.module.module
module/module.zig:1:1: note: root of module root.module
Expected Behavior
It should be possible for a module to import its own root file whether that is supporting this hack that I have been using or something akin to @import("root") like @import("module_root")
This allows modules to have deeply nested structures but not have to use the fragile @import("../../../module_root.zig").thing.i.want
nektro
Metadata
Metadata
Assignees
Labels
zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management