@@ -140,10 +140,8 @@ function download.get_system_triple(cb)
140
140
elseif jit .os :lower () == ' windows' then
141
141
if jit .arch :lower ():match (' x64' ) then return cb (' x86_64-pc-windows-msvc' ) end
142
142
elseif jit .os :lower () == ' linux' then
143
- vim .system ({ ' uname' , ' -a' }, {}, function (out )
144
- local libc = ' gnu'
145
- if out .stdout :lower ():match (' alpine' ) then libc = ' musl' end
146
-
143
+ vim .uv .fs_stat (' /etc/alpine-release' , function (err , is_alpine )
144
+ local libc = (not err and is_alpine ) and ' musl' or ' gnu'
147
145
if jit .arch :lower ():match (' arm' ) then return cb (' aarch64-unknown-linux-' .. libc ) end
148
146
if jit .arch :lower ():match (' x64' ) then return cb (' x86_64-unknown-linux-' .. libc ) end
149
147
return cb (nil )
@@ -162,9 +160,8 @@ function download.get_system_triple_sync()
162
160
elseif jit .os :lower () == ' windows' then
163
161
if jit .arch :lower ():match (' x64' ) then return ' x86_64-pc-windows-msvc' end
164
162
elseif jit .os :lower () == ' linux' then
165
- local libc = ' gnu'
166
- local out = vim .system ({ ' uname' , ' -a' }, {}):wait ()
167
- if out .stdout :lower ():match (' alpine' ) then libc = ' musl' end
163
+ local success , is_alpine = pcall (vim .uv .fs_stat , ' /etc/alpine-release' )
164
+ local libc = (success and is_alpine ) and ' musl' or ' gnu'
168
165
169
166
if jit .arch :lower ():match (' arm' ) then return ' aarch64-unknown-linux-' .. libc end
170
167
if jit .arch :lower ():match (' x64' ) then return ' x86_64-unknown-linux-' .. libc end
0 commit comments