Skip to content
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

all: use the (experimental) Zig package manager #721

Closed
25 of 33 tasks
slimsag opened this issue Mar 16, 2023 · 1 comment
Closed
25 of 33 tasks

all: use the (experimental) Zig package manager #721

slimsag opened this issue Mar 16, 2023 · 1 comment
Milestone

Comments

@slimsag
Copy link
Member

slimsag commented Mar 16, 2023

This is a tracking issue for adopting the new experimental Zig package manager. Also see #719 which will help this effort.

Major Zig issues

  1. package manager cannot download large tar archives, like the Dawn sources or even this 3.3MB tar file:
  2. file exists in multiple modules - you cant have 2 modules (freetype and harfbuzz) depend on a common module (brotli) yet, because the package manager believes they're the same module so it thinks they're duplicate.
  3. error: EndOfStream when using build.zig.zon in the main repo to depend on a pure-Zig dependency

Minor Zig issues

Things we have workarounds for, or have accepted for now.

  1. package manager use case: a Zig module can express it needs to be linked against a C library artifact ziglang/zig#16206
  2. No way to fetch/use a binary version of Dawn by default
    • Solution: @mlugg is reworking Zig modules a bit; "say you wanted to have a binary dependency on a package containing libepic.a. what you'd have is a package containing a build.zig and a libepic.a, and the build.zig sets up and exposes one module, with that module containing libepic.a through addObjectFile (which should be renamed or expanded)"
  3. No support for optional dependencies; which will mean users must download the Dawn source dependency which is large/wasteful
    • Solution: none yet

Mach blockers

  1. Begin using mach-gamemode in the main repo
  2. https://github.com/hexops/glfw/blob/master/build.zig.zon references commits that do not exist in the repo
  3. Begin using mach-dusk in the main repo
  4. Begin using mach-sysjs in the main repo
  5. Begin using mach-ecs in the main repo
  6. Begin using mach-earcut in the main repo
  7. Merge pending ECS changes
  8. Support latest Zig version; Swap step.install() with b.installArtifact(step);

Migration status by project

@slimsag slimsag changed the title Use the (experimental) Zig package manager all: use the (experimental) Zig package manager Mar 16, 2023
@slimsag slimsag added this to the Mach 0.2 milestone May 27, 2023
slimsag added a commit that referenced this issue Jul 2, 2023
helps #721

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
@slimsag
Copy link
Member Author

slimsag commented Jul 31, 2023

We are nearly fully on the package manager now; though there are some follow-ups to be had: https://github.com/hexops/mach/issues?q=is%3Aissue+is%3Aopen+label%3Apackage-manager

@slimsag slimsag closed this as completed Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant