({ requireGatekeeper = false } = {})
| 2 | import { nativeBinPath, targetTriple } from './paths.mjs'; |
| 3 | |
| 4 | export async function runVerifyStep({ requireGatekeeper = false } = {}) { |
| 5 | if (process.platform !== 'darwin') { |
| 6 | console.log('Verify step skipped (not macOS)'); |
| 7 | return; |
| 8 | } |
| 9 | |
| 10 | const target = targetTriple(); |
| 11 | const executable = nativeBinPath(target); |
| 12 | |
| 13 | console.log(`==> codesign -dv ${executable}`); |
| 14 | await run('codesign', ['-dv', '--verbose=2', executable]); |
| 15 | |
| 16 | if (requireGatekeeper) { |
| 17 | // spctl in 'install' mode simulates the Gatekeeper online check — only a |
| 18 | // fully notarized binary passes. Ad-hoc signed binaries fail, so this is |
| 19 | // only run under the release profile. |
| 20 | console.log(`==> spctl -a -vvv -t install ${executable}`); |
| 21 | await run('spctl', ['-a', '-vvv', '-t', 'install', executable]); |
| 22 | } else { |
| 23 | console.log('Skipping spctl check (requireGatekeeper=false)'); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | if (import.meta.url === `file://${process.argv[1]}`) { |
| 28 | const requireGatekeeper = process.env.KIMI_VERIFY_GATEKEEPER === '1'; |
no test coverage detected