Skip to content

handle the case of build.zig dependency loops #14287

@andrewrk

Description

@andrewrk

Extracted from #14265.

This situation needs to be tested and dealt with:

  1. Dependency Foo depends on Dependency Bar, which runs Bar's build.zig.
  2. Dependency Bar depends on Dependency Foo, which runs Foo's build.zig.
  3. Infinite loop occurs.

This would not be an issue when depending on zig packages without executing build.zig logic (#14282).

Marking as "bug" because I'm pretty sure this will be an infinite loop, when instead it should be a nice error message.

The user is supposed to avoid this problem by putting their call to dependency() inside an if statement to break the loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorenhancementSolving this issue will likely involve adding new logic or components to the codebase.zig build systemstd.Build, the build runner, `zig build` subcommand, package management

    Type

    No type

    Projects

    Status

    Quality Assurance

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions