Conversation
|
Have to adjust for static flag |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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
|
@copilot review |
|
@aeneasr Do you want to have copilot re-review? |
Add
LIBCandadjust_libc()+ minor lintingCloses #243