-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vendored version of electron-osx-builder is old and causes notarization to fail #5190
Comments
Thankfully, I was able to develop a workaround for the issue:
Here's what my afterSign.js script looks like: const electronBuilderConfig = require('../electron-builder.json');
const signAsync = require('electron-osx-sign').signAsync;
export.default = async function(context) {
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== 'darwin') {
console.log('Skipping afterSign script for non-darwin target: ' + electronPlatformName);
return;
}
if (electronBuilderConfig.mac.identity === null) {
console.log('Skipping afterSign script because identity explicitly set to null');
return;
}
const appName = context.packager.appInfo.productFilename;
await signAgainFunction(appOutDir, appName);
}
// electron-builder vendors its own private version of electron-osx-sign, but unfortunately it is
// broken (https://github.com/electron-userland/electron-builder/issues/5190). To get around this,
// we install electron-osx-sign ourselves and invoke it in electron-builder's afterSign callback:
// https://www.electron.build/configuration/configuration#aftersign.
async function signAgainFunction(appOutDir, appName) {
const identity = 'Developer ID Application: ' + electronBuilderConfig.mac.identity;
const entitlements = electronBuilderConfig.mac.entitlements;
const entitlementsInherit = electronBuilderConfig.mac.entitlementsInherit;
const hardenedRuntime = electronBuilderConfig.mac.hardenedRuntime;
const gatekeeperAssess = electronBuilderConfig.mac.gatekeeperAssess;
await signAsync({
app: `${appOutDir}/${appName}.app`,
entitlements,
hardenedRuntime,
identity,
"entitlements-inherit": entitlementsInherit,
"gatekeeper-assess": gatekeeperAssess
}).then(() => {
console.log("Second application of electron-osx-sign succeeded!");
}).catch((err) => {
console.error("Second application of electron-osx-sign failed");
console.error(err);
});
} Popular guides for notarizing electron applications instruct you to create an |
Same issue, for signing .so files: electron/osx-sign#226 |
What are the changes preventing us from replacing the vendored version of electron-osx-sign with the latest official version? Alternatively can we upstream electron/osx-sign#226 into the vendored version? |
Dare I ask, why vendor electron-osx-sign at all? |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Bumping into this issue as well on Has |
Use this to resolve : |
Bumping into this issue as well on 23.3.3. Is there any solution ?
|
You're bumping the wrong issue. Create a new one please. This ticket is related to a "vendored" (statically-copied) version of a deprecated electron-osx-sign package. It has since been migrated to |
This issue has been mentioned in #4934 and #4656, but the gist is that electron-builder isn't signing certain binary files, which causes notarization to fail with errors like those below. This issue was fixed in electron/osx-sign#169, but electron-builder vendors a copy of electron-osx-sign here. Updating the vendored version of electron-osx-sign promises to resolve this issue.
The text was updated successfully, but these errors were encountered: