LarpixClient/electron/node_modules/@electron/rebuild/lib/detect-libc.js
olcxja fb6c8b6ee9
All checks were successful
Android Build / publish (push) Successful in 55s
Linux Build / publish (push) Successful in 1m6s
update electron to v43
2026-07-09 22:38:33 +02:00

24 lines
No EOL
854 B
JavaScript

let cached;
/**
* Detects the libc family on the current Linux host via `process.report`.
*
* Used to resolve the `{libc}` token in prebuilt binary path templates.
*
* @returns `'glibc'` | `'musl'` | `null` (non-Linux or unable to detect)
*/
export function detectLibcFamily() {
if (cached !== undefined)
return cached;
if (process.platform !== 'linux')
return (cached = null);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const report = process.report?.getReport();
if (report?.header?.glibcVersionRuntime)
return (cached = 'glibc');
if (Array.isArray(report?.sharedObjects) &&
report.sharedObjects.some((s) => s.includes('libc.musl') || s.includes('ld-musl'))) {
return (cached = 'musl');
}
return (cached = null);
}
//# sourceMappingURL=detect-libc.js.map