Skip to content

Commit 47030d5

Browse files
committed
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 3fc0620 commit 47030d5

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

node/flatpak_node_generator/providers/special.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,19 @@ 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+
# (when they added musl detection logic)
309+
use_gnu_aarch64 = SemVer.parse(package.version) < SemVer.parse('1.13.0')
310+
306311
ripgrep_arch_map = {
307312
'x86_64': 'x86_64-unknown-linux-musl',
308313
'i386': 'i686-unknown-linux-musl',
309314
'arm': 'arm-unknown-linux-gnueabihf',
310-
'aarch64': 'aarch64-unknown-linux-gnu',
315+
'aarch64': 'aarch64-unknown-linux-gnu' if use_gnu_aarch64 else 'aarch64-unknown-linux-musl',
316+
'ppc64': 'powerpc64le-unknown-linux-gnu',
317+
'riscv64': 'riscv64gc-unknown-linux-gnu',
318+
's390x': 's390x-unknown-linux-gnu',
311319
}
312320
destdir = self.gen.data_root / 'tmp' / f'vscode-ripgrep-cache-{package.version}'
313321
for arch, ripgrep_arch in ripgrep_arch_map.items():

0 commit comments

Comments
 (0)