-
-
Notifications
You must be signed in to change notification settings - Fork 14
feat: support libmusl detection #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Have to adjust for static flag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds libc detection to the installer so it can download the correct release artifact on musl-based Linux distributions (e.g., Alpine), addressing issue #243.
Changes:
- Introduces
LIBCdetection andadjust_libc()to append_libmuslto Linux artifact names when needed. - Updates archive name construction and logging to incorporate libc selection.
- Applies minor formatting/linting tweaks (blank lines, shellcheck directive adjustment).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
install.sh
Outdated
| OS=$(uname_os) | ||
| ARCH=$(uname_arch) | ||
| PREFIX="$OWNER/$REPO" | ||
| LIBC=$(ldd --version 2>&1 | grep -qi musl && printf 'libmusl' || printf 'glibc') |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LIBC detection unconditionally invokes ldd --version even on non-Linux platforms. With set -e, shells like dash may emit ldd: not found to stderr (and potentially abort) because the command-not-found error is produced by the shell and can bypass the 2>&1 redirection. Consider gating libc detection behind an OS check and is_command ldd (e.g., only detect on Linux; otherwise default to glibc/empty suffix) so macOS/Windows users don't see errors and the script stays portable.
| LIBC=$(ldd --version 2>&1 | grep -qi musl && printf 'libmusl' || printf 'glibc') | |
| # Detect libc variant only where applicable; default to glibc otherwise. | |
| if [ "$OS" = "linux" ] && command -v ldd >/dev/null 2>&1; then | |
| if ldd --version 2>&1 | grep -qi musl; then | |
| LIBC='libmusl' | |
| else | |
| LIBC='glibc' | |
| fi | |
| else | |
| LIBC='glibc' | |
| fi |
- Rename LIBC to LIBMUSL - Add libmusl_check - Check $OS and `command -v ldd` before version grep - Return 0 or 1 - Set LIBMUSL based on libmusl_check - adjust_libmusl now checks $LIBMUSL && $FLAVOR are not empty before setting archive name
Add
LIBCandadjust_libc()+ minor lintingCloses #243