fix: macOS arm64ビルドのad-hoc署名を無効化してコード署名エラーを修正#2821
Merged
sevenc-nanashi merged 3 commits intomainfrom Nov 4, 2025
Merged
Conversation
Co-authored-by: Hiroshiba <4987327+Hiroshiba@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix code signing error in macOS arm64 build
fix: macOS arm64ビルドのad-hoc署名を無効化してコード署名エラーを修正
Nov 2, 2025
Hiroshiba
reviewed
Nov 2, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR disables code signing for macOS builds by setting the identity to null, effectively preventing ad-hoc signing.
- Added
identity: nullconfiguration to the macOS build settings
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🚀 プレビュー用ページを作成しました 🚀 更新時点でのコミットハッシュ: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
electron-builder 26.1.0から、arm64/universalビルドで証明書がない場合に自動的にad-hoc署名が実行されるようになった。現在の構成では
README.txtがContents/MacOS/に配置されており、ad-hoc署名の検証が厳格化されたことで非実行ファイルの存在がエラーとして検出される。変更内容
build/electronBuilderConfig.tsのmacセクションにidentity: nullを追加してad-hoc署名を無効化:これによりarm64ビルドもx64ビルドと同様に署名をスキップし、ビルドが成功する。
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
npm.jsr.ionode /usr/local/bin/pnpm install --frozen-lockfile(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>macOS arm64ビルドがコード署名エラーで失敗する (electron-builder 26.1.0)</issue_title>
<issue_description>## 不具合の内容
electron-builderを26.1.0に更新後、macOS arm64ビルドのみがコード署名エラーで失敗する
現象・ログ
GitHub Actions の macOS arm64 ビルドが以下のエラーで失敗:
再現手順
a1940801(2025-10-31) 以降の main ブランチをビルドbuild-and-upload (macos-cpu-arm64-prepackage, ...)ジョブを確認失敗例: https://github.com/VOICEVOX/voicevox/actions/runs/18990104333/job/54258692610
期待動作
26.0.12 と同様に、arm64 ビルドも成功する
原因
1. electron-builder 26.1.0 の変更
コミット
a1940801で electron-builder 26.0.12 → 26.1.0 に更新2. PR VOICEVOX/voicevox#9007 の影響
electron-builder 26.1.0 に含まれる PR VOICEVOX/voicevox#9007 により、arm64/universal ビルドで証明書がない場合、自動的に ad-hoc 署名を実行するように変更された
3. 既存の設定問題が顕在化
build/electronBuilderConfig.ts:46:この設定により、
README.txtがContents/MacOS/に配置される。macOS アプリバンドルでは
Contents/MacOS/は実行可能ファイルのみを配置すべきだが、非実行ファイル(README.txt)が含まれている。4. 検証の厳格化
26.1.0 で更新された
@electron/osx-sign1.3.3 (PR VOICEVOX/voicevox#345) によりstrictVerifyが修正され、コード署名検証が厳格化。これにより、ad-hoc 署名実行時に
Contents/MacOS/README.txtが検出されエラーとなる。VOICEVOXのバージョン
999.999.999-develop (main ブランチ)
OSの種類/ディストリ/バージョン
GitHub Actions:
<agent_instructions>実装してください。
PRタイトルやコミットメッセージは説明は日本語で。
かつタイトルとコミットメッセージは他のPRのタイトルを参考にしつつ、contentional commit messageにしてください。</agent_instructions>
Comments on the Issue (you are @copilot in this section)
@Hiroshiba 最適な解決策はおそらく `identity: null`修正方法
build/electronBuilderConfig.tsに以下を追加:デメリットとして、adhoc署名すらしないのでGatekeeperとかに弾かれやすいかも。
でも調べた感じadhoc署名の有無だけではなにもかわらないかも・・・?
これが良さそうな理由
Details
1.
README.txtだけを移動しても不十分Contents/MacOS/には実行可能ファイルのみを配置すべきですが、現在の構成では:MacOS/README.txt← 今回のエラーMacOS/vv-engine/engine_manifest.jsonMacOS/vv-engine/licenses.jsonMacOS/vv-engine/base_library.zipなど、多数の非実行ファイルが含まれています。
README.txtをResources/に移動しても、次はvv-engine/内のファイルで同じエラーが発生する可能性が高いです。2.
vv-engine/全体の再構成は大規模な変更macOSのベストプラクティスに完全準拠するには:
Contents/Resources/.dylib→Contents/Frameworks/Contents/MacOS/しかし、これには:
getSevenZipPath()、getAppPaths()などのパス参照を変更defaultEngineDirの解決方法を変更など、広範囲なコード変更が必要です。
3.
identity: nullは26.0.12の動作に戻すidentity: null: 26.0.12と同じ動作に戻る他の解決策(+推奨しない理由)
Details
strictVerify: falsestrictVerifyは署名後の検証時に使われるが、エラーは署名時に発生README.txtのみ移動vv-engine/内の非実行ファイルが次のエラーを引き起こす可能性完全なバンドル再構成
長期的にはmacOSアプリバンドル構造を適切に再構成しつつ、署名したほうが良い。
うまくいくか不明だけど、例えばこういう感じとか?
extraResourcesを使って非実行ファイルをResources/に配置.dylibをFrameworks/に配置process.resourcesPathを使うように変更MacOS/からシンボリックリンクで対応このあたりの議論も近いかも: #2112</comment_new>
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.