fix: resolve underlying Zig version for Mach builds in anyzls#80
Open
kimjune01 wants to merge 2 commits into
Open
fix: resolve underlying Zig version for Mach builds in anyzls#80kimjune01 wants to merge 2 commits into
kimjune01 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
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.
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