From 7351f6c21cebc3fbd99e50d8a79308af99fde336 Mon Sep 17 00:00:00 2001 From: Augusto Moura Date: Tue, 22 Feb 2022 00:00:57 -0300 Subject: [PATCH] fix: correctly identifies musl distributions Currently we always download the official linux binaries for GNU libc even in systems with different libcs, like alpine. This is a bug, nodejs supports being compiled against muslc and has basic support for pre-compiled binaries. Support for pre-compiled binaries will be added in a different commit --- bin/node-build | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/node-build b/bin/node-build index 8488aa720..3020e4f12 100755 --- a/bin/node-build +++ b/bin/node-build @@ -171,6 +171,11 @@ num_cpu_cores() { echo "${num:-2}" } +system_is_muslc() { + # Implicit return + ldd /bin/sh | grep -qw musl +} + platform() { local arch os distro @@ -181,6 +186,10 @@ platform() { i[36]86* | [ix]86pc ) arch=x86 ;; esac + if system_is_muslc; then + arch="$arch-musl" + fi + os="$(uname -s | tr '[:upper:]' '[:lower:]')" if type -p lsb_release >/dev/null; then