fix(desktop): skip glibc check for directory packs

This commit is contained in:
Hampus
2026-08-28 15:09:00 +02:00
committed by GitHub
parent 026ace6747
commit dc230926a4
@@ -959,8 +959,22 @@ function throwLinuxGlibcCompatibilityError(violations, formatPath) {
throw new Error(lines.join('\n')); throw new Error(lines.join('\n'));
} }
function linuxDistributableTargetNames(context) {
if (!Array.isArray(context.targets)) {
throw new Error('Cannot verify Linux glibc compatibility: electron-builder did not provide a target list.');
}
return context.targets.map((target) => target.name).filter((name) => name !== 'dir');
}
async function verifyLinuxGlibcCompatibility(context) { async function verifyLinuxGlibcCompatibility(context) {
if (context.electronPlatformName !== 'linux') return; if (context.electronPlatformName !== 'linux') return;
const distributableTargets = linuxDistributableTargetNames(context);
if (distributableTargets.length === 0) {
console.log(
`Skipped the ${linuxGlibcBaseline.name} ABI baseline check: this pack produces no distributable Linux artifact.`,
);
return;
}
const elfFiles = await findPackagedElfFiles(context.appOutDir); const elfFiles = await findPackagedElfFiles(context.appOutDir);
if (elfFiles.length === 0) { if (elfFiles.length === 0) {
throw new Error(`Linux package output contains no ELF files: ${context.appOutDir}`); throw new Error(`Linux package output contains no ELF files: ${context.appOutDir}`);