Commit d6d8368
authored
🤖 Fix keychain race condition in parallel macOS signing (#234)
## Problem
PR #227 introduced parallel builds for macOS (x64 + arm64), which caused
a race condition during code signing:
```
SecKeychainCreate: A keychain with the same name already exists.
Exit code: 48
```
Both electron-builder processes try to create the same keychain
simultaneously.
## Solution
Pre-create and configure the keychain in `setup-macos-signing.sh`
**before** running parallel builds.
### Changes
1. **Create unique keychain** with timestamp to avoid conflicts
2. **Import certificate** before parallel builds start
3. **Configure keychain permissions** for codesign access
4. **Export `CSC_KEYCHAIN`** so electron-builder uses the pre-configured
keychain
### Flow
**Before (broken):**
```
setup-macos-signing.sh → exports CSC_LINK
↓
parallel: electron-builder x64 → tries to create keychain ❌
parallel: electron-builder arm64 → tries to create keychain ❌
→ RACE CONDITION
```
**After (fixed):**
```
setup-macos-signing.sh → creates keychain + imports cert
↓
parallel: electron-builder x64 → uses existing keychain ✅
parallel: electron-builder arm64 → uses existing keychain ✅
→ NO CONFLICT
```
## Testing
This will be tested on the next release. The PR workflow doesn't test
signing (no secrets), so we can't verify in CI.
## Impact
- Fixes release workflow breakage from PR #227
- Maintains parallel build performance improvements
- No changes to build workflow (unsigned builds work as before)
_Generated with `cmux`_1 parent 05fba63 commit d6d8368
2 files changed
+34
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
31 | 41 | | |
32 | 42 | | |
| 43 | + | |
| 44 | + | |
33 | 45 | | |
34 | 46 | | |
35 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
171 | 177 | | |
172 | 178 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
178 | 190 | | |
179 | 191 | | |
180 | 192 | | |
| |||
0 commit comments