Skip to content

file exists in multiple modules with circular path-based dependencies #23597

@Vexu

Description

@Vexu

Zig Version

0.15.0-dev.355+206bd1ced

Steps to Reproduce and Observed Behavior

To reproduce:

mkdir foo; cd foo
cat << EOF > build.zig.zon
.{
    .name = .foo,
    .version = "0.0.0",
    .fingerprint = 0x8c736521100e1b90,
    .minimum_zig_version = "0.15.0-dev.355+206bd1ced",
    .dependencies = .{
        .bar = .{
            .path = "bar",
        },
    },
    .paths = .{""},
}
EOF
touch build.zig

mkdir bar
cat << EOF > bar/build.zig.zon
.{
    .name = .bar,
    .version = "0.0.0",
    .fingerprint = 0x76ff8caa84040005,
    .minimum_zig_version = "0.15.0-dev.355+206bd1ced",
    .dependencies = .{
        .foo = .{
            .path = "../",
        },
    },
    .paths = .{""},
}
EOF

zig build
$ ./repro.sh
/home/vexu/Documents/zig/translate-c/foo/build.zig:1:1: error: file exists in multiple modules
/home/vexu/Documents/zig/translate-c/foo/build.zig:1:1: note: root of module root.@dependencies..
/home/vexu/Documents/zig/translate-c/foo/build.zig:1:1: note: root of module root.@build

Expected Behavior

I'm not sure if this is supposed to work but I ran into this in ziglang/translate-c@a1fdfc6 so at least there is a use case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorzig build systemstd.Build, the build runner, `zig build` subcommand, package management

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions