Skip to content

handle the case of build.zig dependency loops #14287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Tracked by #14265
andrewrk opened this issue Jan 13, 2023 · 1 comment
Open
Tracked by #14265

handle the case of build.zig dependency loops #14287

andrewrk opened this issue Jan 13, 2023 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system std.Build, the build runner, `zig build` subcommand, package management
Milestone

Comments

@andrewrk
Copy link
Member

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.

@andrewrk andrewrk added bug Observed behavior contradicts documented or intended behavior enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system std.Build, the build runner, `zig build` subcommand, package management labels Jan 13, 2023
@andrewrk andrewrk added this to the 0.11.0 milestone Jan 13, 2023
@andrewrk andrewrk mentioned this issue Jan 13, 2023
32 tasks
@matu3ba
Copy link
Contributor

matu3ba commented Jan 13, 2023

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

@andrewrk andrewrk modified the milestones: 0.11.0, 0.11.1 Jul 20, 2023
@andrewrk andrewrk modified the milestones: 0.11.1, 0.12.0 Jan 29, 2024
@andrewrk andrewrk modified the milestones: 0.12.0, 0.13.0 Feb 14, 2024
@mlugg mlugg moved this to Quality Assurance in Package Manager Aug 22, 2024
@andrewrk andrewrk modified the milestones: 0.14.0, 0.15.0 Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
Status: Quality Assurance
Development

No branches or pull requests

2 participants