Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package zvm for openSUSE:Factory checked in at 2026-04-10 17:54:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/zvm (Old) and /work/SRC/openSUSE:Factory/.zvm.new.21863 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "zvm" Fri Apr 10 17:54:32 2026 rev:10 rq:1345829 version:0.8.17 Changes: -------- --- /work/SRC/openSUSE:Factory/zvm/zvm.changes 2026-04-04 19:07:04.392278301 +0200 +++ /work/SRC/openSUSE:Factory/.zvm.new.21863/zvm.changes 2026-04-10 18:04:07.753372399 +0200 @@ -1,0 +2,10 @@ +Fri Apr 10 13:02:54 UTC 2026 - Lucas Mulling <[email protected]> + +- Update to 0.8.17: + * Added version command because even I was getting sick of forgetting +- Includes changes from 0.8.16 and 0.8.15: + * Fixed issue with incorrect unarchive path for Windows install script + * Fixed dereferencing a nil pointer that was breaking upgrade.go and Go installs + * Add support for minimum_zig_version in the run and use commands + +------------------------------------------------------------------- Old: ---- zvm-0.8.14.tar.gz New: ---- zvm-0.8.17.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ zvm.spec ++++++ --- /var/tmp/diff_new_pack.JtoSBf/_old 2026-04-10 18:04:08.325395995 +0200 +++ /var/tmp/diff_new_pack.JtoSBf/_new 2026-04-10 18:04:08.325395995 +0200 @@ -17,7 +17,7 @@ Name: zvm -Version: 0.8.14 +Version: 0.8.17 Release: 0 Summary: Easily install/upgrade between different versions of Zig License: MIT ++++++ vendor.tar.xz ++++++ ++++ 2862 lines of diff (skipped) ++++++ zvm-0.8.14.tar.gz -> zvm-0.8.17.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/.github/workflows/go.yml new/zvm-0.8.17/.github/workflows/go.yml --- old/zvm-0.8.14/.github/workflows/go.yml 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/.github/workflows/go.yml 2026-04-08 19:49:07.000000000 +0200 @@ -10,15 +10,31 @@ branches: ["master"] jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.22" + + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: latest + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.22 + go-version: "1.22" + - name: Install dependencies run: | go get . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/CLAUDE.md new/zvm-0.8.17/CLAUDE.md --- old/zvm-0.8.14/CLAUDE.md 1970-01-01 01:00:00.000000000 +0100 +++ new/zvm-0.8.17/CLAUDE.md 2026-04-08 19:49:07.000000000 +0200 @@ -0,0 +1,53 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +ZVM (Zig Version Manager) is a CLI tool written in Go for installing and managing multiple Zig compiler versions. It also supports installing ZLS (Zig Language Server). Built with `urfave/cli/v3`. + +## Build & Test Commands + +```bash +go build -v . # Build the binary +go test -v ./... # Run all tests +go test -v ./cli/ -run TestName # Run a single test +go vet ./... # Static analysis +go fmt ./... # Format code +``` + +Build without self-upgrade capability (for package manager distributions): +```bash +go build -tags noAutoUpgrades . +``` + +## Architecture + +**Entry point:** `main.go` — defines the CLI app with `urfave/cli/v3`. A `Before` hook initializes a global `ZVM` instance that all command handlers share. + +**Core type:** `cli.ZVM` (in `cli/config.go`) holds `baseDir` (default `~/.zvm`) and `Settings`. Initialized via `Initialize()` which creates the directory structure and loads `~/.zvm/settings.json`. + +**Key flows:** +- **Install** (`cli/install.go`): fetches version map → downloads tarball → verifies minisign signature + SHA256 → extracts to `~/.zvm/<version>/`. Most complex file (~600 lines). Handles mirrors, ZLS co-installation, and platform-specific extraction. +- **Use** (`cli/use.go`): switches active version by symlinking `~/.zvm/bin` → `~/.zvm/<version>` via `meta.Link()`. +- **Upgrade** (`cli/upgrade.go`): self-upgrade from GitHub releases. Guarded by `!noAutoUpgrades` build tag. +- **Sync** (`cli/sync.go`): reads `build.zig.zon` for `//! zvm-lock: <version>` and switches to that version. + +**Platform abstraction:** `cli/meta/link_unix.go` and `cli/meta/link_win.go` abstract symlinks (Unix) vs junctions (Windows). Similarly `cli/fileperms_unix.go` / `cli/fileperms_win.go` for permission checks. + +**Version constant:** `cli/meta/version.go` — bump `VERSION` here for releases. + +## Environment Variables + +- `ZVM_PATH` — override default `~/.zvm` base directory +- `ZVM_DEBUG` — enable debug logging +- `ZVM_SET_CU` — disable background upgrade checker +- `ZVM_SKIP_TLS_VERIFY` — skip TLS verification for restricted networks + +## Conventions + +- Platform-specific code uses build tags (`//go:build windows`, `//go:build linux`, etc.) in paired files, not runtime switches. +- HTTP requests set `User-Agent: zvm <version>` and custom `X-Client-Os`/`X-Client-Arch` headers. +- Download integrity is verified with minisign signatures using Zig's public key, then SHA256 checksums. +- Errors are defined as sentinel values in `cli/error.go` and composed with `errors.Join()`. +- Tests use table-driven patterns with struct slices. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/README.md new/zvm-0.8.17/README.md --- old/zvm-0.8.14/README.md 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/README.md 2026-04-08 19:49:07.000000000 +0200 @@ -261,6 +261,23 @@ your binary lives (though if you have your binary in a privileged folder, you may have to run this command with `sudo`). +### Install via Package Manager + +ZVM (> v0.8.14) can also be built without its auto upgrader (`zvm upgrade`). +This is to make installing ZVM via a package manager easier for those who prefer +this method. + +When you run a build of ZVM with the autoupgrader disabled, you will see a +builder-specified message when you run `zvm upgrade`. + +<img width="1041" height="73" alt="image" src="https://github.com/user-attachments/assets/4143436a-8838-438e-9e15-9aab63b378a3" /> + +```go +go build -ldflags=-w -s -X 'main.BuildUpgradeMessage=Command to upgrade ZVM goes here.' +``` + +Remember, ZVM is an open source project. Anyone can customize and distribute it. + ## Clean up build artifacts ```sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/build.ts new/zvm-0.8.17/build.ts --- old/zvm-0.8.14/build.ts 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/build.ts 2026-04-08 19:49:07.000000000 +0200 @@ -6,6 +6,7 @@ import { Tar } from "https://deno.land/[email protected]/archive/mod.ts"; import { copy } from "https://deno.land/[email protected]/streams/copy.ts"; import { parseArgs } from "@std/cli/parse-args"; +import * as zip from "@zip-js/zip-js"; // Command to count final build results // find ./build -type f \( -name "*.tar" -o -name "*.zip" \) | wc -l @@ -126,22 +127,35 @@ if (os === "windows") { console.time(`Compress zvm (zip): ${label}`); - const zip = new Deno.Command("zip", { - args: [ - `${label}.zip`, - `${label}/zvm.exe`, - `${label}/elevate.cmd`, - `${label}/elevate.vbs`, - ], - cwd: buildDir, - }); - - const { code, stderr } = await zip.output(); - if (code !== 0) { - console.error(`Failed to zip ${label}:`); - console.error(new TextDecoder().decode(stderr)); + + const targets: ZipFile[] = [ + // { path: `${label}.zip`, mimetype: "application/zip" }, + { + path: `${buildDir}/${label}/zvm.exe`, + mimetype: "application/octet-stream", + }, + // { + // path: `${buildDir}/${label}/elevate.cmd`, + // mimetype: "application/x-msdos-program", + // }, + // { + // path: `${buildDir}/${label}/elevate.vbs`, + // mimetype: "application/x-vbs", + // }, + ]; + + for (const f of targets) { + f.path = await Deno.realPath(f.path); } + + const zipBlob = await zipFiles(targets); + + const zipSlice = await zipBlob.arrayBuffer(); + + console.timeEnd(`Compress zvm (zip): ${label}`); + await Deno.writeFile(`${buildDir}/${label}.zip`, new Uint8Array(zipSlice)); + return; } @@ -169,3 +183,22 @@ compileResults.map((dir) => Deno.remove(dir, { recursive: true })), ); console.timeEnd("Remove build artifacts"); + +interface ZipFile { + path: string; + mimetype: string; +} + +async function zipFiles(files: ZipFile[]): Promise<Blob> { + const blobWriter = new zip.BlobWriter("applicaton/zip"); + const writer = new zip.ZipWriter(blobWriter); + + for (const file of files) { + const f_bytes = await Deno.readFile(file.path); + const f_blob = new Blob([f_bytes], { type: file.mimetype }); + const entryName = file.path.split(/[/\\]/).pop()!; + await writer.add(entryName, new zip.BlobReader(f_blob)); + } + + return writer.close(); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/cli/error.go new/zvm-0.8.17/cli/error.go --- old/zvm-0.8.14/cli/error.go 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/cli/error.go 2026-04-08 19:49:07.000000000 +0200 @@ -33,4 +33,8 @@ ErrMissingShasum = errors.New("shasum not found") // ErrZigNotInstalled is returned when the `zig` executable cannot be found in the PATH. ErrZigNotInstalled = errors.New("exec `zig` not found on $PATH") + + ErrMissingArgument = errors.New("missing argument") + + ErrInvalidAlias = errors.New("invalid version alias") ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/cli/meta/version.go new/zvm-0.8.17/cli/meta/version.go --- old/zvm-0.8.14/cli/meta/version.go 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/cli/meta/version.go 2026-04-08 19:49:07.000000000 +0200 @@ -9,7 +9,7 @@ ) const ( - VERSION = "v0.8.14" + VERSION = "v0.8.16" // VERSION = "v0.0.0" // For testing zvm upgrade diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/cli/run.go new/zvm-0.8.17/cli/run.go --- old/zvm-0.8.14/cli/run.go 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/cli/run.go 2026-04-08 19:49:07.000000000 +0200 @@ -20,14 +20,7 @@ func (z *ZVM) Run(version string, cmd []string) error { log.Debug("Run", "version", version, "cmds", strings.Join(cmd, ", ")) if len(version) == 0 { - return fmt.Errorf("no zig version provided. If you want to run your set version of Zig, please use 'zig'") - // zig, err := z.zigPath() - // log.Debug("Run", "zig path", zig) - // if err != nil { - // return fmt.Errorf("%w: no Zig version found; %w", ErrMissingBundlePath, err) - // } - - // return z.runZig("bin", cmd) + return fmt.Errorf("%w: no zig version provided. If you want to run your set version of Zig, please use 'zig'", ErrMissingArgument) } installedVersions, err := z.GetInstalledVersions() @@ -46,7 +39,7 @@ _, err = getTarPath(version, &rawVersionStructure) if err != nil { if errors.Is(err, ErrUnsupportedVersion) { - return fmt.Errorf("%s: %q", err, version) + return fmt.Errorf("%w: %q", err, version) } else { return err } @@ -65,6 +58,15 @@ } } +func (z *ZVM) IsInstalled(version string) bool { + installedVersions, err := z.GetInstalledVersions() + if err != nil { + log.Debug("isInstalled", "error", err) + return false + } + + return slices.Contains(installedVersions, version) +} // runZig executes the Zig compiler for the specified version with the given arguments. func (z *ZVM) runZig(version string, cmd []string) error { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/cli/sync.go new/zvm-0.8.17/cli/sync.go --- old/zvm-0.8.14/cli/sync.go 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/cli/sync.go 2026-04-08 19:49:07.000000000 +0200 @@ -27,7 +27,7 @@ buildFile, err := os.Open(buildZigPath) if err != nil { - return fmt.Errorf("error opening build.zig: %q", err) + return fmt.Errorf("error opening build.zig: %w", err) } defer buildFile.Close() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/cli/upgrade.go new/zvm-0.8.17/cli/upgrade.go --- old/zvm-0.8.14/cli/upgrade.go 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/cli/upgrade.go 2026-04-08 19:49:07.000000000 +0200 @@ -69,7 +69,7 @@ resp, err := http.Get(downloadUrl) if err != nil { - errors.Join(ErrFailedUpgrade, err) + return errors.Join(ErrFailedUpgrade, err) } defer resp.Body.Close() @@ -124,7 +124,7 @@ if err := replaceExe(newDownload, zvmPath); err != nil { log.Warn("This command might break if ZVM is installed outside of ~/.zvm/self/") - return fmt.Errorf("upgrade error: %q", err) + return fmt.Errorf("upgrade error: %w", err) } // fmt.Println("Run the following to complete your upgrade on Windows.") // fmt.Printf("- Command Prompt:\n\tmove /Y '%s' '%s'\n", secondaryZVM, zvmPath) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/cli/use.go new/zvm-0.8.17/cli/use.go --- old/zvm-0.8.14/cli/use.go 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/cli/use.go 2026-04-08 19:49:07.000000000 +0200 @@ -10,6 +10,7 @@ "fmt" "os" "path/filepath" + "regexp" "strings" @@ -82,3 +83,32 @@ answer := strings.TrimSpace(strings.ToLower(text)) return answer == "y" || answer == "ye" || answer == "yes" } + +var minZigVersionRe = regexp.MustCompile(`(?m)^\s*\.minimum_zig_version\s*=\s*"([^"]+)"`) + +func ExtractMinimumZigVersion() (string, error) { + + // this is the new part. + cwd, err := os.Getwd() + if err != nil { + cwd = "./" + } + zigBuildfile := filepath.Join(cwd, "build.zig.zon") + log.Debug("build.zig.zon check", "cwd", zigBuildfile) + + // only fetches uncommented minimum_zig_versions + data, err := os.ReadFile(zigBuildfile) + if err != nil { + return "", fmt.Errorf("couldn't read build.zig.zon: %w", err) + } + + matches := minZigVersionRe.FindSubmatch(data) + if len(matches) < 2 { + return "", fmt.Errorf("build.zig.zon minimum_zig_version is unparsable. Please provide a valid Zig version as an argument for `use`") + } + answer := string(matches[1]) + log.Debug("build.zig.zon exists!", "minimum_zig_version", answer) + versionArg := strings.TrimPrefix(answer, "v") + + return versionArg, nil +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/cli/version.go new/zvm-0.8.17/cli/version.go --- old/zvm-0.8.14/cli/version.go 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/cli/version.go 2026-04-08 19:49:07.000000000 +0200 @@ -13,11 +13,13 @@ "net/url" "os" "path/filepath" + "strconv" "strings" "github.com/tristanisham/zvm/cli/meta" + "github.com/charmbracelet/log" ) @@ -180,3 +182,4 @@ } // statelessFetchVersionMap is the same as fetchVersionMap but it doesn't write to disk. Will probably be depreciated and nuked from orbit when my + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/deno.jsonc new/zvm-0.8.17/deno.jsonc --- old/zvm-0.8.14/deno.jsonc 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/deno.jsonc 2026-04-08 19:49:07.000000000 +0200 @@ -5,6 +5,7 @@ }, "imports": { "@std/cli": "jsr:@std/cli@^1.0.28", - "@std/path": "jsr:@std/path@^0.219.1" + "@std/path": "jsr:@std/path@^0.219.1", + "@zip-js/zip-js": "jsr:@zip-js/zip-js@^2.8.24" } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/deno.lock new/zvm-0.8.17/deno.lock --- old/zvm-0.8.14/deno.lock 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/deno.lock 2026-04-08 19:49:07.000000000 +0200 @@ -6,7 +6,8 @@ "jsr:@std/fmt@^1.0.9": "1.0.9", "jsr:@std/internal@^1.0.12": "1.0.12", "jsr:@std/path@~0.219.1": "0.219.1", - "jsr:@zip-js/zip-js@*": "2.7.72" + "jsr:@zip-js/zip-js@*": "2.7.72", + "jsr:@zip-js/zip-js@^2.8.24": "2.8.24" }, "jsr": { "@std/[email protected]": { @@ -33,6 +34,9 @@ }, "@zip-js/[email protected]": { "integrity": "b72877f90aaefa1f1bd265d51f354bb58b6dd0d0e2799c865584acf49eae9115" + }, + "@zip-js/[email protected]": { + "integrity": "3e5744893e2b08f82ec3706ffad05398ee03ab2628457d805e449efda354994b" } }, "remote": { @@ -121,7 +125,8 @@ "workspace": { "dependencies": [ "jsr:@std/cli@^1.0.28", - "jsr:@std/path@~0.219.1" + "jsr:@std/path@~0.219.1", + "jsr:@zip-js/zip-js@^2.8.24" ] } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/go.mod new/zvm-0.8.17/go.mod --- old/zvm-0.8.14/go.mod 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/go.mod 2026-04-08 19:49:07.000000000 +0200 @@ -4,38 +4,37 @@ require ( github.com/charmbracelet/lipgloss v1.1.0 - github.com/charmbracelet/log v0.4.2 + github.com/charmbracelet/log v1.0.0 github.com/jedisct1/go-minisign v0.0.0-20241212093149-d2f9f49435c7 github.com/nyaosorg/go-windows-junction v0.2.0 github.com/schollz/progressbar/v3 v3.19.0 github.com/tristanisham/clr v0.0.0-20221004001624-00ee60046d85 - golang.org/x/mod v0.33.0 - golang.org/x/sys v0.41.0 + golang.org/x/mod v0.34.0 + golang.org/x/sys v0.42.0 ) require ( github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/charmbracelet/colorprofile v0.4.2 // indirect + github.com/charmbracelet/colorprofile v0.4.3 // indirect github.com/charmbracelet/x/ansi v0.11.6 // indirect github.com/charmbracelet/x/cellbuf v0.0.15 // indirect github.com/charmbracelet/x/term v0.2.2 // indirect - github.com/clipperhouse/displaywidth v0.10.0 // indirect - github.com/clipperhouse/stringish v0.1.1 // indirect + github.com/clipperhouse/displaywidth v0.11.0 // indirect github.com/clipperhouse/uax29/v2 v2.7.0 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - golang.org/x/crypto v0.48.0 // indirect + golang.org/x/crypto v0.49.0 // indirect ) require ( github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/go-logfmt/logfmt v0.6.1 // indirect - github.com/lucasb-eyer/go-colorful v1.3.0 // indirect + github.com/lucasb-eyer/go-colorful v1.4.0 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.21 // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/muesli/termenv v0.16.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect - github.com/urfave/cli/v3 v3.6.2 - golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect - golang.org/x/term v0.40.0 // indirect + github.com/urfave/cli/v3 v3.8.0 + golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect + golang.org/x/term v0.41.0 // indirect ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/go.sum new/zvm-0.8.17/go.sum --- old/zvm-0.8.14/go.sum 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/go.sum 2026-04-08 19:49:07.000000000 +0200 @@ -2,42 +2,22 @@ github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/charmbracelet/colorprofile v0.3.3 h1:DjJzJtLP6/NZ8p7Cgjno0CKGr7wwRJGxWUwh2IyhfAI= -github.com/charmbracelet/colorprofile v0.3.3/go.mod h1:nB1FugsAbzq284eJcjfah2nhdSLppN2NqvfotkfRYP4= -github.com/charmbracelet/colorprofile v0.4.1 h1:a1lO03qTrSIRaK8c3JRxJDZOvhvIeSco3ej+ngLk1kk= -github.com/charmbracelet/colorprofile v0.4.1/go.mod h1:U1d9Dljmdf9DLegaJ0nGZNJvoXAhayhmidOdcBwAvKk= -github.com/charmbracelet/colorprofile v0.4.2 h1:BdSNuMjRbotnxHSfxy+PCSa4xAmz7szw70ktAtWRYrY= -github.com/charmbracelet/colorprofile v0.4.2/go.mod h1:0rTi81QpwDElInthtrQ6Ni7cG0sDtwAd4C4le060fT8= +github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex9t5KX76i20Q= +github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q= github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY= github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30= -github.com/charmbracelet/log v0.4.2 h1:hYt8Qj6a8yLnvR+h7MwsJv/XvmBJXiueUcI3cIxsyig= -github.com/charmbracelet/log v0.4.2/go.mod h1:qifHGX/tc7eluv2R6pWIpyHDDrrb/AG71Pf2ysQu5nw= -github.com/charmbracelet/x/ansi v0.11.2 h1:XAG3FSjiVtFvgEgGrNBkCNNYrsucAt8c6bfxHyROLLs= -github.com/charmbracelet/x/ansi v0.11.2/go.mod h1:9tY2bzX5SiJCU0iWyskjBeI2BRQfvPqI+J760Mjf+Rg= -github.com/charmbracelet/x/ansi v0.11.4 h1:6G65PLu6HjmE858CnTUQY1LXT3ZUWwfvqEROLF8vqHI= -github.com/charmbracelet/x/ansi v0.11.4/go.mod h1:/5AZ+UfWExW3int5H5ugnsG/PWjNcSQcwYsHBlPFQN4= +github.com/charmbracelet/log v1.0.0 h1:HVVVMmfOorfj3BA9i8X8UL69Hoz9lI0PYwXfJvOdRc4= +github.com/charmbracelet/log v1.0.0/go.mod h1:uYgY3SmLpwJWxmlrPwXvzVYujxis1vAKRV/0VQB7yWA= github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF7ihZW8= github.com/charmbracelet/x/ansi v0.11.6/go.mod h1:2JNYLgQUsyqaiLovhU2Rv/pb8r6ydXKS3NIttu3VGZQ= -github.com/charmbracelet/x/cellbuf v0.0.14 h1:iUEMryGyFTelKW3THW4+FfPgi4fkmKnnaLOXuc+/Kj4= -github.com/charmbracelet/x/cellbuf v0.0.14/go.mod h1:P447lJl49ywBbil/KjCk2HexGh4tEY9LH0/1QrZZ9rA= github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI= github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q= github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI= github.com/chengxilo/virtualterm v1.0.4 h1:Z6IpERbRVlfB8WkOmtbHiDbBANU7cimRIof7mk9/PwM= github.com/chengxilo/virtualterm v1.0.4/go.mod h1:DyxxBZz/x1iqJjFxTFcr6/x+jSpqN0iwWCOK1q10rlY= -github.com/clipperhouse/displaywidth v0.6.1 h1:/zMlAezfDzT2xy6acHBzwIfyu2ic0hgkT83UX5EY2gY= -github.com/clipperhouse/displaywidth v0.6.1/go.mod h1:R+kHuzaYWFkTm7xoMmK1lFydbci4X2CicfbGstSGg0o= -github.com/clipperhouse/displaywidth v0.7.0 h1:QNv1GYsnLX9QBrcWUtMlogpTXuM5FVnBwKWp1O5NwmE= -github.com/clipperhouse/displaywidth v0.7.0/go.mod h1:R+kHuzaYWFkTm7xoMmK1lFydbci4X2CicfbGstSGg0o= -github.com/clipperhouse/displaywidth v0.10.0 h1:GhBG8WuerxjFQQYeuZAeVTuyxuX+UraiZGD4HJQ3Y8g= -github.com/clipperhouse/displaywidth v0.10.0/go.mod h1:XqJajYsaiEwkxOj4bowCTMcT1SgvHo9flfF3jQasdbs= -github.com/clipperhouse/stringish v0.1.1 h1:+NSqMOr3GR6k1FdRhhnXrLfztGzuG+VuFDfatpWHKCs= -github.com/clipperhouse/stringish v0.1.1/go.mod h1:v/WhFtE1q0ovMta2+m+UbpZ+2/HEXNWYXQgCt4hdOzA= -github.com/clipperhouse/uax29/v2 v2.3.0 h1:SNdx9DVUqMoBuBoW3iLOj4FQv3dN5mDtuqwuhIGpJy4= -github.com/clipperhouse/uax29/v2 v2.3.0/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsVRgg6W7ihQeh4g= -github.com/clipperhouse/uax29/v2 v2.3.1 h1:RjM8gnVbFbgI67SBekIC7ihFpyXwRPYWXn9BZActHbw= -github.com/clipperhouse/uax29/v2 v2.3.1/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsVRgg6W7ihQeh4g= +github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8= +github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0= github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -48,14 +28,12 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/jedisct1/go-minisign v0.0.0-20241212093149-d2f9f49435c7 h1:FWpSWRD8FbVkKQu8M1DM9jF5oXFLyE+XpisIYfdzbic= github.com/jedisct1/go-minisign v0.0.0-20241212093149-d2f9f49435c7/go.mod h1:BMxO138bOokdgt4UaxZiEfypcSHX0t6SIFimVP1oRfk= -github.com/lucasb-eyer/go-colorful v1.3.0 h1:2/yBRLdWBZKrf7gB40FoiKfAWYQ0lqNcbuQwVHXptag= -github.com/lucasb-eyer/go-colorful v1.3.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/lucasb-eyer/go-colorful v1.4.0 h1:UtrWVfLdarDgc44HcS7pYloGHJUjHV/4FwW4TvVgFr4= +github.com/lucasb-eyer/go-colorful v1.4.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw= -github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= -github.com/mattn/go-runewidth v0.0.20 h1:WcT52H91ZUAwy8+HUkdM3THM6gXqXuLJi9O3rjcQQaQ= -github.com/mattn/go-runewidth v0.0.20/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= +github.com/mattn/go-runewidth v0.0.21 h1:jJKAZiQH+2mIinzCJIaIG9Be1+0NR+5sz/lYEEjdM8w= +github.com/mattn/go-runewidth v0.0.21/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc= @@ -66,50 +44,26 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/schollz/progressbar/v3 v3.18.0 h1:uXdoHABRFmNIjUfte/Ex7WtuyVslrw2wVPQmCN62HpA= -github.com/schollz/progressbar/v3 v3.18.0/go.mod h1:IsO3lpbaGuzh8zIMzgY3+J8l4C8GjO0Y9S69eFvNsec= github.com/schollz/progressbar/v3 v3.19.0 h1:Ea18xuIRQXLAUidVDox3AbwfUhD0/1IvohyTutOIFoc= github.com/schollz/progressbar/v3 v3.19.0/go.mod h1:IsO3lpbaGuzh8zIMzgY3+J8l4C8GjO0Y9S69eFvNsec= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tristanisham/clr v0.0.0-20221004001624-00ee60046d85 h1:zD4b2hs7jZ2sJtgtNdpMZyo4D4/Ifct8SMxvPNNkHzs= github.com/tristanisham/clr v0.0.0-20221004001624-00ee60046d85/go.mod h1:cKn2HV8Beq81OHjb2gja2ZiU4HAEQ6LSuxyaIT5Mg7o= -github.com/urfave/cli/v3 v3.6.1 h1:j8Qq8NyUawj/7rTYdBGrxcH7A/j7/G8Q5LhWEW4G3Mo= -github.com/urfave/cli/v3 v3.6.1/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso= -github.com/urfave/cli/v3 v3.6.2 h1:lQuqiPrZ1cIz8hz+HcrG0TNZFxU70dPZ3Yl+pSrH9A8= -github.com/urfave/cli/v3 v3.6.2/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso= +github.com/urfave/cli/v3 v3.8.0 h1:XqKPrm0q4P0q5JpoclYoCAv0/MIvH/jZ2umzuf8pNTI= +github.com/urfave/cli/v3 v3.8.0/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= -golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= -golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= -golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= -golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= -golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= -golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39 h1:DHNhtq3sNNzrvduZZIiFyXWOL9IWaDPHqTnLJp+rCBY= -golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0= -golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= -golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= -golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a h1:ovFr6Z0MNmU7nH8VaX5xqw+05ST2uO1exVfZPVqRC5o= -golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a/go.mod h1:K79w1Vqn7PoiZn+TkNpx3BUWUQksGO3JcVX6qIjytmA= -golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk= -golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc= -golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= -golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= -golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= -golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= +golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= +golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= +golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 h1:jiDhWWeC7jfWqR9c/uplMOqJ0sbNlNWv0UkzE0vX1MA= +golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90/go.mod h1:xE1HEv6b+1SCZ5/uscMRjUBKtIxworgEcEi+/n9NQDQ= +golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= +golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= -golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= -golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= -golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY= -golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww= -golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= -golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU= +golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/install.ps1 new/zvm-0.8.17/install.ps1 --- old/zvm-0.8.14/install.ps1 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/install.ps1 2026-04-08 19:49:07.000000000 +0200 @@ -31,7 +31,7 @@ try { $lastProgressPreference = $global:ProgressPreference $global:ProgressPreference = 'SilentlyContinue'; - Expand-Archive "$ZipPath" "$ZVMSelf" -Force + Expand-Archive "$ZipPath" "$ZVMSelf\$UnzippedPath" -Force $global:ProgressPreference = $lastProgressPreference if (!(Test-Path "${ZVMSelf}\$UnzippedPath\zvm.exe")) { throw "The file '${ZVMSelf}\$UnzippedPath\zvm.exe' does not exist. Download is corrupt / Antivirus intercepted?`n" @@ -103,9 +103,9 @@ $PROCESSOR_ARCH = $env:PROCESSOR_ARCHITECTURE.ToLower() if ($PROCESSOR_ARCH -eq "x86") { - Write-Output "Install Failed - ZVM requires a 64-bit environment." - Write-Output "Please ensure that you are running the 64-bit version of PowerShell or that your system is 64-bit.`n" - exit 1 + Write-Output "Install Failed - ZVM requires a 64-bit environment." + Write-Output "Please ensure that you are running the 64-bit version of PowerShell or that your system is 64-bit.`n" + exit 1 } # Parse --no-env flag if present diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zvm-0.8.14/main.go new/zvm-0.8.17/main.go --- old/zvm-0.8.14/main.go 2026-03-26 22:04:15.000000000 +0100 +++ new/zvm-0.8.17/main.go 2026-04-08 19:49:07.000000000 +0200 @@ -140,7 +140,18 @@ versionArg := strings.TrimPrefix(cmd.Args().First(), "v") if versionArg == "" { - return fmt.Errorf("command 'use' requires 1 valid Zig version as an argument") + emptyArgErrs := fmt.Errorf("command 'use' requires 1 valid Zig version as an argument") + minZig, err := cli.ExtractMinimumZigVersion() + if err != nil { + // so if there is no arg, it checks to see if it can get a value from build.zig.zon + // if that value isn't found, it returns both errors. + // if it is found, it pushes up the value and runs use like normal. + emptyArgErrs = errors.Join(emptyArgErrs, err) + return emptyArgErrs + } + + versionArg = minZig + } if err := zvm.Use(versionArg); err != nil { @@ -160,7 +171,25 @@ Action: func(ctx context.Context, cmd *opts.Command) error { versionArg := strings.TrimPrefix(cmd.Args().First(), "v") cmds := cmd.Args().Tail() - return zvm.Run(versionArg, cmds) + + log.Debug("run cmd", "version", versionArg, "args...", cmds) + + if err := zvm.Run(versionArg, cmds); err != nil { + if errors.Is(err, cli.ErrUnsupportedVersion) || errors.Is(err, cli.ErrMissingArgument) { + minZig, err := cli.ExtractMinimumZigVersion() + if err != nil { + return fmt.Errorf("version %q is not a known Zig version and no minimum_zig_version found: %w", versionArg, err) + } + log.Debug("falling back to minimum_zig_version", "version", versionArg, "minZig", minZig) + redoneArgs := []string{cmd.Args().First()} + redoneArgs = append(redoneArgs, cmds...) + log.Debug("running with minZig", "minZig", minZig, "args", redoneArgs) + return zvm.Run(minZig, redoneArgs) + } + return err + } + + return nil }, },
