From 88aa5277fbfb87e359838660e381b8e65a69e9fa Mon Sep 17 00:00:00 2001 From: treatybreaker <58627896+treatybreaker@users.noreply.github.com> Date: Sun, 6 Mar 2022 20:53:09 +0000 Subject: Support libc detection (#527) --- lua/nvim-lsp-installer/platform.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lua/nvim-lsp-installer/platform.lua') diff --git a/lua/nvim-lsp-installer/platform.lua b/lua/nvim-lsp-installer/platform.lua index 9ab54c6a..62c74046 100644 --- a/lua/nvim-lsp-installer/platform.lua +++ b/lua/nvim-lsp-installer/platform.lua @@ -25,6 +25,16 @@ M.is_unix = vim.fn.has "unix" == 1 M.is_mac = vim.fn.has "mac" == 1 M.is_linux = not M.is_mac and M.is_unix +-- @return string @The libc found on the system, musl or glibc (glibc if ldd is not found) +function M.get_libc() + local _, _, libc_exit_code = os.execute "ldd --version 2>&1 | grep -q musl" + if libc_exit_code == 0 then + return "musl" + else + return "glibc" + end +end + -- PATH separator M.path_sep = M.is_win and ";" or ":" -- cgit v1.2.3-70-g09d2