Skip to content

Commit 7a7e5e4

Browse files
LorbusChrisbbhtt
authored andcommitted
node: Fix generator ripgrep binary mappings and add missing architectures
The @vscode/ripgrep package postinstall script expects specific binary variants for each architecture. This patch: 1. Adds backwards compatibility for aarch64 libc variants - Versions < 1.13.0 used gnu variant (aarch64-unknown-linux-gnu) - Versions >= 1.13.0 switched to musl (aarch64-unknown-linux-musl) - Both variants exist in different ripgrep-prebuilt releases 2. Adds missing architecture mappings for ppc64, riscv64, and s390x - These architectures are supported by @vscode/ripgrep - Uses gnu variants (only available option for these arches) This prevents the postinstall script from failing to find the cached binary and attempting to download from GitHub, which fails in offline build environments (RPM builds, air-gapped systems, etc). The mappings now match what the postinstall script expects based on the package version being used. See: https://github.com/microsoft/vscode-ripgrep/blob/main/lib/postinstall.js Assisted-by: Claude Code
1 parent fc02e3d commit 7a7e5e4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

node/flatpak_node_generator/providers/special.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,22 @@ async def get_ripgrep_tag(version: str) -> str:
303303
return match.group(1)
304304

305305
tag = await get_ripgrep_tag(package.version)
306+
307+
# vscode-ripgrep switched from -gnu to -musl for aarch64 in v1.13.0
308+
use_gnu_aarch64 = SemVer.parse(package.version) < SemVer.parse('1.13.0')
309+
306310
ripgrep_arch_map = {
307311
'x86_64': 'x86_64-unknown-linux-musl',
308312
'i386': 'i686-unknown-linux-musl',
309313
'arm': 'arm-unknown-linux-gnueabihf',
310-
'aarch64': 'aarch64-unknown-linux-gnu',
314+
'aarch64': (
315+
'aarch64-unknown-linux-gnu'
316+
if use_gnu_aarch64
317+
else 'aarch64-unknown-linux-musl'
318+
),
319+
'ppc64': 'powerpc64le-unknown-linux-gnu',
320+
'riscv64': 'riscv64gc-unknown-linux-gnu',
321+
's390x': 's390x-unknown-linux-gnu',
311322
}
312323
destdir = self.gen.data_root / 'tmp' / f'vscode-ripgrep-cache-{package.version}'
313324
for arch, ripgrep_arch in ripgrep_arch_map.items():

0 commit comments

Comments
 (0)