Skip to content

fix: resolve underlying Zig version for Mach builds in anyzls#80

Open
kimjune01 wants to merge 2 commits into
marler8997:masterfrom
kimjune01:fix-zls-mach-version
Open

fix: resolve underlying Zig version for Mach builds in anyzls#80
kimjune01 wants to merge 2 commits into
marler8997:masterfrom
kimjune01:fix-zls-mach-version

Conversation

@kimjune01
Copy link
Copy Markdown

Summary

  • Fix crash when anyzls encounters Mach Zig version strings by resolving the underlying Zig version from the index metadata
  • Mach versions (e.g., 0.14.0-dev.3163+0) are not valid semver for ZLS compatibility checks; the fix maps them to their base Zig release version

Fixes #73

Test plan

  • anyzls no longer crashes when encountering Mach version strings
  • Standard semver versions continue to work unchanged

kimjune01 added 2 commits May 11, 2026 21:13
ZLS doesn't provide Mach-versioned releases. When running zls with
a Mach Zig version (e.g., 2024.11.0-mach), anyzig would try to
download a non-existent ZLS binary with the -mach suffix, resulting
in a 404 error.

This fix strips the -mach suffix from the version when building the
ZLS download URL, allowing it to download the correct base version
(e.g., 2024.11.0).

Fixes marler8997#73
The original stripMachVersion approach was incorrect -- stripping the
-mach suffix from e.g. "2024.11.0-mach" yields "2024.11.0", which is
a Mach release number, not a valid ZLS version. ZLS doesn't publish
builds for Mach version numbers.

Instead, look up the Mach download index to resolve the underlying Zig
version (e.g. 2024.11.0-mach -> 0.14.0-dev.2577+271452d22), and use
that real Zig version for the ZLS URL. This mirrors how the Zig binary
path already handles Mach versions via extractUrlFromMachDownloadIndex.

Fixes marler8997#73
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.

anyzls does not work with Mach Zig versions

1 participant