apple build stops before the archive in an SSH / non-GUI session (errSecInternalComponent) with how to run it in the logged-in session, --allow-ssh to skip; relative credential paths resolve from the project and xcodebuild gets an absolute ASC key path; tests, pitfall 101

This commit is contained in:
CRTkafa 2026-10-22 02:38:45 +08:00
parent 467bacc00a
commit b97f23701f
7 changed files with 72 additions and 6 deletions

View file

@ -242,3 +242,11 @@ export function distributionErrors(output: string, tmp: string = process.env.TMP
}
return logs[0] ? { log: logs[0], lines: [] } : null;
}
/** Why this is not the Mac's logged-in GUI session (SSH, or a launchd manager other than Aqua), else null: codesign
* cannot reach the login keychain there (errSecInternalComponent). */
export function remoteBuildSession(env: Record<string, string | undefined>, managerName: string): string | null {
if (env.SSH_CONNECTION || env.SSH_CLIENT || env.SSH_TTY) return 'this is an SSH session';
if (managerName && managerName !== 'Aqua') return `this is not the logged-in GUI session (launchctl manager: ${managerName})`;
return null;
}