Zig compiler ↔ OS package manager: Safe rollback after a failed upgrade?
0 reputation · 03 Aug 2022, 21:06 UTC
Goal
Determine whether a Zig compiler upgrade that breaks existing projects can be reverted automatically without manual intervention.
Constraints
Zig releases are distributed as binary‑only packages; the compiler itself offers no native rollback command. Package managers such as Homebrew, apt, or zig‑up install new binaries in place, overwriting the previous binary and discarding any previous state. External version managers can coexist with multiple binaries, but none coordinate an atomic rollback when a build fails.
Unresolved Decision
The Zig community has proposed a potential “zig revert” mechanism, but no official design or implementation exists. Consequently, CI/CD pipelines that pull the latest Zig version have no documented path to revert to a known‑good release if a build fails.
Key Questions
- Does the Zig compiler provide any metadata or hooks that could be leveraged by a package manager to detect a failed build and trigger a rollback?
- Can an external tool (e.g., zig‑up) be extended to support atomic upgrades and rollbacks in a way that is transparent to the user and CI environments?
- What interoperability model would best integrate Zig’s upgrade process with existing OS package managers to ensure safe recovery?