Repository navigation
Zig 0.17, and Velopack 1.2.161 - #9
Merged
Merged
Conversation
Thread std.Io through the tools' fs and process calls, switch their entry points to std.process.Init, and pass b.graph.io in build.zig. allyourcodebase/squashfs-tools has no 0.16-compatible revision, so its build.zig is vendored under squashfs/ with the link calls moved to root_module.
Zig 0.17: no global --libc, pathFromRoot or getPath3; Run.addPathDir is gone; generated files are indexed; @cImport is removed. Velopack.h is now a translate-c module (`velopack_c`, `velopackCModule`). Commands that need environment changes run through tools/run_env.zig, because 0.17's setEnvironmentVariable snapshots the configure-time environment into the cached configuration. Velopack: runtime and vpk both 1.2.161 (were 0.0.1589 and 0.0.1298). vpk 1.2 targets .NET 10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Zig 0.17's maker cannot load a configuration that depends on a path
inside a directory that does not exist ("configuration failed:
FileSystemFailure"), which every *-windows-msvc build without a
.velopack-msvc/ directory hit. When the manifest is missing, declare
the nearest directory that exists; making the manifest changes it, so
the build still reconfigures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 9 tasks
Zig 0.17's LibCInstallation renamed gcc_dir to cc_dir and added
darwin_sdk_dir, and refuses a file missing any field ("missing field:
darwin_sdk_dir"): every *-windows-msvc compile against the generated
zig-libc-*.ini failed. Found by fizzy's release workflow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
foxnne
added a commit
to fizzyedit/fizzy
that referenced
this pull request
Oct 16, 2026
Part of fizzyedit/plans#5 (`plans/ZIG_0_17_PLAN.md`, step 2: the build system). **Stacked on #438** (and #437): based on `zig/017-build-steps`, so this diff is only release packaging. ## What changes **Velopack 1.2.161.** `velopack_zig` moves to graphl-tech/velopack-zig#9 (`a80b037`, its Zig 0.17 port), and with it Velopack's runtime goes from 0.0.1589 to 1.2.161. `vpk` in `.config/dotnet-tools.json` goes from 0.0.1298 to 1.2.161; `vpk` 1.2 targets .NET 10, so `release.yml` installs 10.0, not 8.0. What users gain is in velopack-zig#9: a code signature that survives updates on macOS, atomic macOS updates, the Linux locator fix, delta fixes, and 64-bit Windows bootstrappers. `Velopack.h` only gained declarations; fizzy's updater is unchanged. **The rest of the build system's 0.17 stand-ins:** - **`Velopack.h` as a module.** `@cImport` is gone. `velopack.linkVelopack(.c_modules = …)` gives each module that calls the C API a `velopack_c` import (translate-c), once per module: the integration, demo and bench tests share one `app` module. The updater imports it only when Velopack is enabled. - **`vpk pack` runs through velopack-zig's `tools/run_env.zig`** (`velopack.addVpkRun`), which sets `DOTNET_ROLL_FORWARD` and puts the bundled `mksquashfs` on `PATH` when vpk runs. So does the MSVC setup script. In 0.17, `Run.setEnvironmentVariable` freezes the configure-time environment into the cached configuration, and `Run.addPathDir` is gone. `MksquashfsBuild.bin_dir` is now `mksquashfs`'s own output directory, with no install step. - **Signing and the macOS SDK are options only.** `-Dmacos-sign-app`, `-Dmacos-sign-installer` and `-Dmacos-notary-profile` lose their `FIZZY_MACOS_*` environment fallbacks, and `SDKROOT` becomes `-Dmacos-sdk`: 0.17 caches the configuration without regard to the environment. `scripts/release.sh` and `release.yml`'s macOS job turn the same variables into the options, and `packageall` forwards them to its macOS children. - **No global `--libc`:** `-Dwindows-msvc-libc` or the managed `.velopack-msvc/` only. The managed manifest's existence and an explicit manifest's contents are declared to the configure cache. - **The MSVC translate-c shim works again.** It finds each module's translate-c step through the generated-file index and `Step.cast`, as `std.Build` does, in place of the removed `Step.id`. - **`docs/PITFALLS.md`, "The build (Zig 0.17)":** the four traps (environment reads, `setEnvironmentVariable`, undeclared configure-time reads, declared paths in missing directories), each with what fizzy does instead. After this, 36 `ZIG017` markers remain on the branch, none in the build system: the zon stand-ins, the `@typeInfo` helpers, the example-branch switch. ## SDK impact - [x] None: no `sdk/` file changes here. - [ ] Core-only or additive: reaches plugins at the next SDK release - [ ] Fingerprint moved - [ ] SDK release ## Verified - [x] macOS (arm64, 0.17.0): - `zig build package` packs a release with vpk 1.2.161: `fizzy-arm64-macos-Setup.pkg`, `-Portable.zip`, `fizzy-0.2.0-arm64-macos-full.nupkg`. The bundle carries `Contents/Resources/sq.version`, 1.x's signature-preserving layout. Unsigned: no identities on this machine. - `zig build -Dvelopack=true` links Velopack (36 `vpkc_` symbols); `zig build test-integration -Dvelopack=true` (79/79 steps). - `scripts/check-fmt.sh`, `zig build`, `zig build test`, `zig build test-integration` (77/77 steps), `zig build check-web`, `zig build test-sdk-version`. - `scripts/check-examples.sh` against the examples' `zig-0.17` branches: all 8 builds pass. - `zig build -Dtarget=x86_64-windows-msvc` configures; `-Dtarget=x86_64-windows-gnu -Dno-emit` builds. - [ ] Windows: not run. The MSVC path (`.velopack-msvc/`, the shim) needs a packaging run. - [ ] Linux: not run. The AppImage path is velopack-zig#9's `run_env --path`, which its CI passes on `ubuntu-latest`. - [ ] **A test release.** `release.yml` packaging all six targets, signed, is the real check for this PR. It has no dry-run mode: it releases an existing tag and stops at a *draft* GitHub release, which nothing auto-updates to until it is published. So the check is a test tag on this branch (e.g. `v0.2.0-zig017.1`), the workflow's draft release, then deleting both. Tagging is the maintainer's call. - [ ] An update round trip, from an installed 0.0.1589-runtime release to one packed with this, per OS. It waits for that dry run's artifacts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Leaving this unmerged on purpose. fizzy pins by commit, and both of its pins now have tags so they stay reachable:
Please don't delete the 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings velopack-zig up to Zig 0.17 and to current Velopack. Both the runtime library and the
vpkpackager move to 1.2.161; until now they were 0.0.1589 and 0.0.1298.Supersedes #1 (the 0.16 port, which
zig-0.16.0-v2carried on). This starts from that branch,mainplus the 0.16 port, so it keeps the two-call API from #7 and the version-scopedvpkinstalls from #8.Zig 0.17
minimum_zig_version = "0.17.0"here, insquashfs/and in the sample. CI runs 0.17.0, andmacos-latestagain now that Zig links against the macOS 26 SDK.Velopack.has a module.@cImportis gone, solinkVelopacknow also gives the compile's root module avelopack_cimport (the header through translate-c). The newvelopackCModule(b, target, optimize)returns the same module for any other module that calls the C API. The sample uses it.--libc.windows_msvc_libcis the only override now;b.libc_fileno longer exists. The managed.velopack-msvctoolchain is unchanged.Run.setEnvironmentVariablecopies the whole environment while the build is configured, and that copy is cached with the configuration. A variable set later never reaches the command: aDOTNET_ROOTexported after the first build was ignored here until a forced reconfigure.vpk(DOTNET_ROLL_FORWARD=Major) and the MSVC setup script now run throughtools/run_env.zig, which applies their changes at run time on top of the live environment.mksquashfsonPATH.Run.addPathDiris gone.MksquashfsBuild.bin_diris now aLazyPath(the artifact's own directory, no install step), andrun_env --pathputs it on vpk'sPATH.attachMksquashfsToVpkRunis removed;addVelopackStepdoes it.dependOnFileMetadata), so the build reconfigures when an MSVCzig-libc-*.iniappears or goes.pathFromRoot/getPath3are replaced byb.root.joinString, and optimize modes use their 0.17 names.Velopack 1.2.161
velopack_libc_1.2.161.zip, with the same 18 files and layout as before.vpkinstalls at 1.2.161 (velopack_version).Velopack.honly gained declarations:vpkc_new_source_http_url_with_options(custom headers and a timeout) andvpkc_new_update_manager_flow, with their option structs. Nothing was removed or changed, so existing callers need no change.vpk1.2 targets .NET 10. CI installs 10.0.x.What the jump brings for an app shipping through this:
Resources/so an update no longer breaks the app's code signature (velopack#705); updates apply with an atomic rename (velopack#972).IsWow64Process2(velopack#1072).For an app already shipped on the old runtime: its users must still be able to update to a release packed with 1.2.161. Velopack added a fallback for old versions updating on a Mac (velopack#924), but test an update from your current release before shipping one built with this.
Tested
./test/package.shfrom a clean state packs the sample with vpk 1.2.161 (velosample-osx-Setup.pkg,-Portable.zip,-1.0.0-osx-full.nupkg,RELEASES-osx).zig build runruns the sample linked against the 1.2.161 runtime throughvelopack_c.DOTNET_ROOT, packing fails as it should; withDOTNET_ROOTexported, the next build packs. Before the fix it kept failing until a forced reconfigure.squashfs/cross-compiles forx86_64-linux-gnu. The AppImage path (mksquashfs throughrun_env --path) is left to CI'subuntu-latest.windows-latestcovers the MSVC path, including translatingVelopack.hfor*-windows-msvc.🤖 Generated with Claude Code