Skip to content

new(github.com/marler8997/zigup): Zig version manager (source build)#13117

Open
tannevaled wants to merge 4 commits into
pkgxdev:mainfrom
tannevaled:tannevaled/new/zigup
Open

new(github.com/marler8997/zigup): Zig version manager (source build)#13117
tannevaled wants to merge 4 commits into
pkgxdev:mainfrom
tannevaled:tannevaled/new/zigup

Conversation

@tannevaled
Copy link
Copy Markdown
Contributor

@tannevaled tannevaled commented May 30, 2026

Summary

  • Adds projects/github.com/marler8997/zigup/package.yml — a from-source build of zigup, Zig's standalone version manager.
  • Built using pantry's existing ziglang.org bottle. No vendored binaries.
  • Self-contained: zigup's build.zig.zon declares .minimum_zig_version = "0.14.0" and ships no .dependencies, so the build needs nothing beyond a Zig toolchain. No Zig-package-manager fetching is involved.
  • Complements pantry's existing ziglang.org bottle for users who want to install/switch between Zig versions on their own (zigup keeps compilers in a separate install-dir, independent of pkgx environments).

Notes for reviewers

  • Upstream tags this project as vYYYY_MM_DD (current release: v2025_05_24). libpkgx's version parser converts underscores to dots when no dots are present in the stripped tag, so 2025_05_24 becomes 2025.5.24 — valid CalVer-shaped semver. The distributable URL uses {{ version.tag }} to recover the literal upstream tag.
  • build.skip: fix-patchelf mirrors ziglang.org's pattern — zig produces static binaries.
  • Build dep is pinned to ziglang.org: ^0.14. zigup's build.zig.zon says .minimum_zig_version = "0.14.0", but the build.zig still imports std.builtin.Mode which was removed in Zig 0.15, so the 0.14 series is required until upstream updates.
  • --release is passed (not -Doptimize=ReleaseSafe) because zigup's b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseSafe }) registers the --release boolean flag instead of -Doptimize (Zig 0.14 behaviour).
  • Upstream's README contains a soft-deprecation note (the author has switched to anyzig and recommends it). zigup is still supported by upstream and remains in active use by many. This is mentioned in the recipe header comment so future maintainers have context.
  • The test is zigup --help 2>&1 | grep -qi 'usage' — usage is written to stderr by upstream, so stderr is redirected before the grep.

Test plan

  • pkgx +github.com/marler8997/zigup zigup --help on linux/x86-64
  • pkgx +github.com/marler8997/zigup zigup --help on linux/aarch64
  • pkgx +github.com/marler8997/zigup zigup --help on darwin/aarch64
  • pkgx +github.com/marler8997/zigup zigup --help on darwin/x86-64

zigup is a CLI for downloading and switching between Zig compilers. It
manages compilers in its own install-dir (independent of pkgx's
ziglang.org bottle), so users who want explicit version-manager workflows
outside pkgx environments can use it.

Built from source via pantry's ziglang.org — zigup's build.zig.zon
declares no .dependencies, so the build is self-contained (no Zig package
manager fetching). Tags ship as vYYYY_MM_DD; libpkgx's underscore->dot
heuristic parses these as CalVer, and the URL uses {{ version.tag }} to
recover the literal upstream tag.
CI on 0.15.2 hit `error: root source file struct 'builtin' has no
member named 'Mode'` — zigup's build.zig still uses `std.builtin.Mode`,
which Zig 0.15 removed. Upstream's `.minimum_zig_version = "0.14.0"`
is a floor, not a ceiling; constrain to the 0.14 series until upstream
catches up.
…Safe`

zigup's build.zig calls `b.standardOptimizeOption(.{
  .preferred_optimize_mode = .ReleaseSafe })`. When `preferred_optimize_mode`
is set, Zig 0.14 registers a `--release` boolean flag instead of the
usual `-Doptimize=...` option — so passing `-Doptimize=ReleaseSafe`
fails with `error: invalid option: -Doptimize`. `--release` opts into
the preferred mode, which is ReleaseSafe here.
Pantry's audit rejects bare GitHub-user paths:

  error: marler8997/zigup is not a valid project name. Please use a
  fully qualified URL to the canonical project page.

Relocate the recipe to the conventional path `projects/github.com/<user>/<repo>/`,
matching neighbouring recipes (e.g. `projects/github.com/eliben/pycparser`).
@tannevaled tannevaled changed the title new(marler8997/zigup): Zig version manager (source build) new(github.com/marler8997/zigup): Zig version manager (source build) May 30, 2026
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

Successfully merging this pull request may close these issues.

1 participant