You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
package manager: transitive dependencies must be listed in the top-level build.zig.zon is painful #17135
Use any package that has transitive dependencies via the package manager.
Mach, mach-core, and mach-glfw all have a handful or two of dependencies. They're logical bits of code that we've extracted into independent Zig packages, actually useful on their own, not an npm-encroaching situation. This should be good for us and the ecosystem as a whole.
But today when users import e.g. mach-glfw via the package manager following our guide, we have to tell them to make sure they meticulously copy all the dependencies from our build.zig.zon file into their own, and keep those up-to-date / correct with what we expect. This is because the Zig package manager today requires all transitive dependencies be specified in the build.zig.zon file.
Whether this is an intentional design decision or not is unclear to me.
But it is very tedious, error prone, and annoying for our users to have to manually copy this informationn over to their own build.zig.zon file. I am regularly seeing 1-3 people per week file issues and ask questions that ultimately boil down to 'I copied the dependencies wrong' or 'I didn't know I had to copy them'. We've added docs around this, created starter projects, etc. to try and reduce the annoyance on our side - but it's still painful overall for our users.
This issue is two questions:
Is this an intentional design decision, intended to e.g. encourage less dependencies?
Is an easier way to add transitive dependencies to your build.zig.zon in scope?
Without at least #2 solved, I think many package authors will be encouraged to reduce dependencies not by actually having less of them.. but rather by 'shoving multiple dependencies into one' and pretending it's one
Expected Behavior
1 & 2 above.
Reacted by xdBronch, Roman Frołow, Dominic, ilyas taouaou and Brian Kirkpatrick
Activity
mlugg commentedon Sep 13, 2023
No. (so Q2 not relevant)
Are you sure you're not just hitting the actual bug which ended up existing in #16354?
package manager: write deps in a flat format, eliminating the FQN con…
package manager: write deps in a flat format, eliminating the FQN con…
package manager: write deps in a flat format, eliminating the FQN con…
package manager: write deps in a flat format, eliminating the FQN con…
package manager: write deps in a flat format, eliminating the FQN con…