ci: add checks to verify mach-o objects architecture (#230598)

This commit is contained in:
Robo
2024-10-06 04:27:10 +09:00
committed by GitHub
parent 55e66e7936
commit 51cfc9ece4
6 changed files with 258 additions and 15 deletions

View File

@@ -7,7 +7,6 @@ import * as path from 'path';
import * as fs from 'fs';
import * as minimatch from 'minimatch';
import { makeUniversalApp } from 'vscode-universal-bundler';
import { spawn } from '@malept/cross-spawn-promise';
const root = path.dirname(path.dirname(__dirname));
@@ -54,13 +53,6 @@ async function main(buildDir?: string) {
darwinUniversalAssetId: 'darwin-universal'
});
fs.writeFileSync(productJsonPath, JSON.stringify(productJson, null, '\t'));
// Verify if native module architecture is correct
const findOutput = await spawn('find', [outAppPath, '-name', 'kerberos.node']);
const lipoOutput = await spawn('lipo', ['-archs', findOutput.replace(/\n$/, '')]);
if (lipoOutput.replace(/\n$/, '') !== 'x86_64 arm64') {
throw new Error(`Invalid arch, got : ${lipoOutput}`);
}
}
if (require.main === module) {