Skip to content

Commit ccd223d

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 ccd223d

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

node/flatpak_node_generator/providers/special.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ async def _get_chromedriver_binary_version(self, package: Package) -> str:
155155
js = await Requests.instance.read_all(url, cachable=True)
156156
# XXX: a tad ugly
157157
match = re.search(r"exports\.version = '([^']+)'", js.decode())
158-
assert (
159-
match is not None
160-
), f'Failed to get ChromeDriver binary version from {url}'
158+
assert match is not None, (
159+
f'Failed to get ChromeDriver binary version from {url}'
160+
)
161161
return match.group(1)
162162

163163
async def _handle_electron_chromedriver(self, package: Package) -> None:
@@ -303,11 +303,20 @@ 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': 'aarch64-unknown-linux-gnu'
315+
if use_gnu_aarch64
316+
else 'aarch64-unknown-linux-musl',
317+
'ppc64': 'powerpc64le-unknown-linux-gnu',
318+
'riscv64': 'riscv64gc-unknown-linux-gnu',
319+
's390x': 's390x-unknown-linux-gnu',
311320
}
312321
destdir = self.gen.data_root / 'tmp' / f'vscode-ripgrep-cache-{package.version}'
313322
for arch, ripgrep_arch in ripgrep_arch_map.items():

0 commit comments

Comments
 (0)