Skip to content

fix(install): avoid false musl detection on WSL/glibc systems#823

Merged
fengmk2 merged 2 commits intovoidzero-dev:mainfrom
hadronomy:install-wsl
Mar 13, 2026
Merged

fix(install): avoid false musl detection on WSL/glibc systems#823
fengmk2 merged 2 commits intovoidzero-dev:mainfrom
hadronomy:install-wsl

Conversation

@hadronomy
Copy link
Copy Markdown
Contributor

Fixes a false musl detection 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.1 as 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>.tgz

instead of:

vite-plus-cli-linux-x64-gnu-<version>.tgz

This then fails during extraction with:

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

Minimal reproduction

Environment used for reproduction:

  • WSL
  • glibc-based distro (Ubuntu)
  • musl also installed, so /lib/ld-musl-x86_64.so.1 exists

1. Verify the environment is actually glibc-based

Run:

ldd --version | head -1
getconf GNU_LIBC_VERSION

Expected output is something like:

ldd (Ubuntu GLIBC 2.39-0ubuntu8.7) 2.39
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
glibc 2.39

This shows the correct target should be linux-x64-gnu, not linux-x64-musl.

2. Run the installer as-is

curl -fsSL https://vite.plus | bash

Observed output:

Setting up VITE+...

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

At this point the installer does not show which tarball URL failed, because the
download path uses a silent curl and tar only reports the extraction error.

3. To see the actual failing package URL, patch the installer locally

Save the installer locally, then change the curl line inside
download_and_extract() from:

curl -sL "$url" -o "$temp_file"

to:

echo "Downloading: $url" >&2
curl -fsSL "$url" -o "$temp_file"

Then run the local copy:

bash install.sh

Expected output now shows the real issue:

Setting up VITE+...
Downloading: https://registry.npmjs.org/@voidzero-dev/vite-plus-cli-linux-x64-musl/-/vite-plus-cli-linux-x64-musl-0.1.11.tgz
error: Network error (curl exit code 22)

  This may be caused by:
    - Network connectivity issues
    - Firewall or proxy blocking the connection
    - DNS configuration problems

  Failed URL: https://registry.npmjs.org/@voidzero-dev/vite-plus-cli-linux-x64-musl/-/vite-plus-cli-linux-x64-musl-0.1.11.tgz

  To debug, run:
    curl -v "https://registry.npmjs.org/@voidzero-dev/vite-plus-cli-linux-x64-musl/-/vite-plus-cli-linux-x64-musl-0.1.11.tgz"

This reveals that the installer is incorrectly inferring linux-x64-musl, and fails because there's no musl package in the registry.

4. Expected behavior

For the same environment, the installer should resolve the GNU package instead:

https://registry.npmjs.org/@voidzero-dev/vite-plus-cli-linux-x64-gnu/-/vite-plus-cli-linux-x64-gnu-0.1.11.tgz

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 13, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit b3ebdb8
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69b3e68dd489c300088befa1

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_VERSION before any musl heuristics.
  • Enhance ldd --version parsing 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.

Comment thread packages/cli/install.sh Outdated
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>
@fengmk2 fengmk2 merged commit 2223726 into voidzero-dev:main Mar 13, 2026
28 checks passed
@fengmk2 fengmk2 added the bug Something isn't working label Mar 13, 2026
@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Mar 13, 2026

@hadronomy https://vite.plus is in effect, thanks for the fix 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants