fix(install): avoid false musl detection on WSL/glibc systems#823
Merged
fengmk2 merged 2 commits intovoidzero-dev:mainfrom Mar 13, 2026
Merged
fix(install): avoid false musl detection on WSL/glibc systems#823fengmk2 merged 2 commits intovoidzero-dev:mainfrom
fengmk2 merged 2 commits intovoidzero-dev:mainfrom
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
fengmk2
approved these changes
Mar 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the CLI installer’s libc detection logic so glibc-based Linux systems (notably WSL/Ubuntu) don’t get misclassified as musl simply because a musl loader file exists, preventing downloads of non-existent *-musl tarballs.
Changes:
- Prefer positive glibc detection via
getconf GNU_LIBC_VERSIONbefore any musl heuristics. - Enhance
ldd --versionparsing to detect both musl and glibc explicitly. - Move musl-loader-file presence check to a final fallback step.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Pablo Hernández <17086478+hadronomy@users.noreply.github.com>
Member
|
@hadronomy https://vite.plus is in effect, thanks for the fix 🥇 |
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.
Fixes a false
musldetection in the install script on glibc-based Linux systems,especially WSL environments where musl happens to be installed.
The previous logic treated the presence of a musl loader file such as
/lib/ld-musl-x86_64.so.1as proof that the system was musl-based. On WSL/Ubuntu,that can be a false positive, which causes the installer to request the wrong
platform package:
vite-plus-cli-linux-x64-musl-<version>.tgzinstead of:
vite-plus-cli-linux-x64-gnu-<version>.tgzThis then fails during extraction with:
Minimal reproduction
Environment used for reproduction:
/lib/ld-musl-x86_64.so.1exists1. Verify the environment is actually glibc-based
Run:
ldd --version | head -1 getconf GNU_LIBC_VERSIONExpected output is something like:
This shows the correct target should be
linux-x64-gnu, notlinux-x64-musl.2. Run the installer as-is
curl -fsSL https://vite.plus | bashObserved output:
At this point the installer does not show which tarball URL failed, because the
download path uses a silent
curlandtaronly reports the extraction error.3. To see the actual failing package URL, patch the installer locally
Save the installer locally, then change the
curlline insidedownload_and_extract()from:to:
Then run the local copy:
Expected output now shows the real issue:
This reveals that the installer is incorrectly inferring
linux-x64-musl, and fails because there's nomuslpackage in the registry.4. Expected behavior
For the same environment, the installer should resolve the GNU package instead: