-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
regressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.
Milestone
Description
Zig Version
0.11.0-dev.1502+d6b430b52
Steps to Reproduce and Observed Behavior
Previously, something like the following worked, and only the tests within fs/test.zig
would get run (at least after #12939):
zig test lib/std/fs/test.zig --zig-lib-dir lib --main-pkg-path lib/std
With current master branch, however, it will error:
lib/std/std.zig:1:1: error: file exists in multiple packages
lib/std/std.zig:1:1: note: root of package std
lib/std/fs/test.zig:1:21: note: imported from package root
const std = @import("../std.zig");
^~~~~~~~~~~~
lib/std/multi_array_list.zig:1:21: note: imported from package std
const std = @import("std.zig");
^~~~~~~~~
... (omitted a lot of notes) ...
lib/std/build/LibExeObjStep.zig:2:21: note: imported from package std
const std = @import("../std.zig");
^~~~~~~~~~~~
lib/std/fs/test.zig:1:1: error: file exists in multiple packages
lib/std/fs/test.zig:1:1: note: root of package root
lib/std/fs.zig:3131:17: note: imported from package std
_ = @import("fs/test.zig");
^~~~~~~~~~~~~
This is a use-case that I use quite often but I know isn't fully endorsed (some context: #2331 (comment), #9946). I expect some change similar to what caused it to regress before #12926 / #12939 has happened again.
Expected Behavior
$ zig test lib/std/fs/test.zig --main-pkg-path lib/std --zig-lib-dir lib
All 45 tests passed.
LewisGaul and erikarvstedt
Metadata
Metadata
Assignees
Labels
regressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.