Skip to content

fix(release): take the electron-builder keychain-password fix - #990

Merged
Juliusolsson05 merged 1 commit into
mainfrom
fix/signing-keychain-password
Sep 18, 2026
Merged

Juliusolsson05 merged 1 commit into
mainfrom
fix/signing-keychain-password

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Problem

The first macOS release run with signing secrets configured, 35282765891 on 1a1410ac, failed in Package macOS artifacts before anything was signed:

⨯ /usr/bin/security process failed 1
Command failed: /usr/bin/security set-key-partition-list -S apple-tool:,apple: -s -k *** <tmp>.keychain
security: SecKeychainUnlock: The user name or passphrase you entered is not correct.

The preceding security import … -P <cert password> succeeded, so the configured CSC_KEY_PASSWORD is correct.

Fixes #989

Cause

app-builder-lib@26.15.3, out/codeSign/macCodeSign.js:

  • createKeychain() creates the temporary keychain with a random password (randomBytes(32)), then create-keychain -p <keychainPassword>.
  • importCerts() imports with the certificate password (correct), then runs set-key-partition-list … -k <certificate password> — but that flag takes the keychain password. The two can never match, so every CSC_LINK-based signing run fails.

Upstream: electron-userland/electron-builder#10066, fixed by #10101, backported in #10172.

Verified by unpacking each published tarball and reading the same line:

app-builder-lib set-key-partition-list … -k
26.15.3 (before) password (certificate password)
26.15.7 password
26.16.0 password
26.16.1 (this PR) keychainPassword

Change

Lockfile plus one range. electron-builder 26.15.3 → 26.16.1, with app-builder-lib, dmg-builder, electron-publish, builder-util and dev-only transitive dependencies following. All of it is devDependencies, so nothing here ships inside the app.

The declared range moves ^26.15.3^26.16.1, because latest on npm is still 26.15.3: under the old range a fresh install resolves straight back to the broken version. That is also why npm update electron-builder alone does not fix this.

npm update's rewrite would have pruned 27 unrelated entries (node_modules/vitest/node_modules/esbuild and its @esbuild/* platform packages), which main needs because vitest's vite wants esbuild ^0.27.0 || ^0.28.0 and the deduped root is 0.25.12. The lockfile is therefore rebuilt in main's key order with those entries preserved: 0 entries added, 0 removed.

Verification

  • npm audit --omit=dev --audit-level=high --package-lock-only exits 0.
  • npm ls --package-lock-only --all reports exactly the same two pre-existing problem lines as main — no new inconsistencies.
  • Lockfile diff contains no entry additions or removals.
  • A release.yml run on this branch with publish_release=false is dispatched to exercise sign → notarize → staple → verify. Its result will be added here.

Note on the earlier run

That run also showed APPLE_ID and APPLE_APP_SPECIFIC_PASSWORD arriving empty in package-macos, despite being added to the repo six minutes before that job started. GitHub resolves secrets when the run starts, not when each job starts, so secrets added mid-run never reach later jobs. Any run must be dispatched after the secrets exist.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MpFfu5xMd77Y2sNUeytvCG

Signing with CSC_LINK never reached codesign: app-builder-lib 26.15.3
creates its temporary keychain with a random password but then passes
the CERTIFICATE password to security set-key-partition-list, so the
step died with SecKeychainUnlock 'passphrase you entered is not
correct' right after a successful import (run 35282765891).

Upstream electron-builder#10066, fixed by #10101 and backported in
#10172. Reading the published tarballs, 26.15.3, 26.15.7 and 26.16.0
all pass the certificate password; 26.16.1 passes keychainPassword.

The declared range moves to ^26.16.1 so a fresh install cannot resolve
back to a broken 26.15.x. npm's rewrite would also have pruned 27
nested vitest esbuild entries that main needs, so the lockfile keeps
main's key order and those entries are preserved.

Fixes #989

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpFfu5xMd77Y2sNUeytvCG
@Juliusolsson05
Juliusolsson05 merged commit 0b744b8 into main Sep 18, 2026
5 checks passed
@Juliusolsson05
Juliusolsson05 deleted the fix/signing-keychain-password branch September 18, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(release): macOS signing fails because electron-builder unlocks its keychain with the certificate password

1 participant