fix: resolve underlying Zig version for Mach builds in anyzls#80
fix: resolve underlying Zig version for Mach builds in anyzls#80kimjune01 wants to merge 2 commits into
Conversation
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
|
Human here. Unfortunate news: I'm moving this into drafts because my current setup uses Zig 0.16 and the |
The version number format of ZLS is not exactly the same as Zig. For Perhaps the corresponding version number of ZLS can be obtained by crawling data from |
|
The API that can be used to request ZLS version is https://releases.zigtools.org/v1/zls/select-version?zig_version=0.16.0&compatibility=only-runtime |
Summary
0.14.0-dev.3163+0) are not valid semver for ZLS compatibility checks; the fix maps them to their base Zig release versionFixes #73
Test plan