-
-
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
[resolved] Failing to sign app on macOS #1892
Comments
Resolved, it was due to symlinks pointing to inexistent files. |
What changes were necessary to fix this issue? I'm experiencing the same problem |
In my case, it was because of broken symlinks. Once them deleted, i could sign the app
El 7 ago 2017 7:47 +0200, mharrisn <[email protected]>, escribió:
… What changes were necessary to fix this issue? I'm experiencing the same problem
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Your log output looks identical to what I have so I believe I'm having he same problem. How did you determine which symlinks were broken? Which symlinks were broken in your case? |
I ran this command from the root folder
find . -type l ! -exec test -e {} \; -print
In my case, I had a node_modules folder (not the original one) full of broken symlinks trying to point to original modules. No idea how it appears there.
I deleted it and all goes well.
El 7 ago 2017 13:24 +0200, mharrisn <[email protected]>, escribió:
… Your log output looks identical to what I have so I believe I'm having he same problem. How did you determine which symlinks were broken? Which symlinks were broken in your case?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thank you for the information I see the same thing. I also don't know why these files are being included in the app. It seem wrong to include the electron lib again. I will need to try the 'two package' solution to see if that could work for me. In my case I have three broken symlinks: I deleted them but each time I build, the broken symlinks appear again. But I was able to avoid the error by setting the |
Electron must be not in the production deps. Use npm ls --production To inspect. |
I had the same issue. However, I was able to resolve it by removing all the symlinks from my concerned folder. Note: Remove all the symlinks found by I hope it would help someone. |
@iamsush Thanks Sushant, you are great! It helped me! |
for anyone who's looking for a script.. you can make this as module.exports = async ({ electronPlatformName, appOutDir, packager }) => {
// only macos
if (electronPlatformName !== `darwin`) return;
const appName = packager.appInfo.productFilename;
const appPath = `${appOutDir}/${appName}.app`;
await removeInvalidSymlinks({ appPath });
}
async function removeInvalidSymlinks({
// string
appPath,
}) {
const invalidSymlinksInManyLines = await new Promise((resolve, reject) => {
exec(`find ${appPath}/Contents -type l ! -exec test -e {} \\; -print`, (error, stdout, stderr) => {
console.log(`command: find ${appPath}/Contents -type l ! -exec test -e {} \\; -print`)
if (error) {
console.error(`error: ${error.message}`);
return reject(error);
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return reject(stderr);
}
console.log(`stdout: ${stdout}`);
resolve(stdout);
})
});
console.log("======invalidSymlinksInManyLines======")
console.log(invalidSymlinksInManyLines)
console.log("===========================")
const invalidSymlinksInArray = invalidSymlinksInManyLines.split("\n")
.map((invalidSymlink) => invalidSymlink.trim())
.filter((maybeEmptyPath) => maybeEmptyPath !== '');
console.log("======invalidSymlinksInArray======")
console.log(invalidSymlinksInArray)
console.log("===========================")
const waitUntilAllInvalidSymlinksRemoved = invalidSymlinksInArray.map((invalidSymlink) => {
return new Promise((resolve) => {
exec(`rm ${invalidSymlink}`, (error, stdout, stderr) => {
console.log(`command: rm ${invalidSymlink}`)
if (error) {
console.error(`error: ${error.message}`);
return reject(error);
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return reject(stderr);
}
console.log(`stdout: ${stdout}`);
resolve(stdout);
})
})
})
try {
await Promise.all(waitUntilAllInvalidSymlinksRemoved);
} catch (e) {
console.log(`error happened while removing all invalid symlinks. message: ${e.message}`);
}
return;
} |
Hi,
I think this was not happening in previous versions.
I tried to remove the quote and the space from the app name, without success.
I never had this problem before and did tons of release :(
Edit: The problem may come from that I just updated by my system from macOS 10.12.4 to 10.12.6
I just discovered that when removing --string from codesign commands, it works
Edit2: it works when running manually the codesign command, but fails with electron-builder that is know failing on this:
Command failed: spctl --assess --type execute --verbose --ignore-cache --no-cache /Users/danielfebrero/Git/addaps_desktop/dist/mac/Addaps.app
/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addaps.app: rejected (invalid destination for symbolic link in bundle)
override=security disabled
`Error: Command failed: codesign --verify --deep --verbose=2 --strict /Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app
--prepared:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/Addap's beta Helper EH.app
--validated:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/Addap's beta Helper EH.app
--prepared:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/Addap's beta Helper NP.app
--prepared:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/Addap's beta Helper.app
--validated:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/Addap's beta Helper NP.app
--validated:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/Addap's beta Helper.app
--prepared:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/Electron Framework.framework/Versions/Current/.
--validated:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/Electron Framework.framework/Versions/Current/.
--prepared:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/Mantle.framework/Versions/Current/.
--prepared:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/Squirrel.framework/Versions/Current/.
--validated:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/Mantle.framework/Versions/Current/.
--validated:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/Squirrel.framework/Versions/Current/.
--prepared:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/Current/.
--validated:/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/Current/.
/Users/danielfebrero/Git/addaps_desktop/dist/mac/Addap's beta.app: No such file or directory
From previous event:
at MacPackager.sign (/Users/danielfebrero/Git/addaps_desktop/node_modules/electron-builder/out/macPackager.js:268:11)
at /Users/danielfebrero/Git/addaps_desktop/node_modules/electron-builder/src/macPackager.ts:93:26
From previous event:
at /Users/danielfebrero/Git/addaps_desktop/node_modules/electron-builder/src/macPackager.ts:93:10
at next (native)
From previous event:
at MacPackager.pack (/Users/danielfebrero/Git/addaps_desktop/node_modules/electron-builder/out/macPackager.js:190:11)
at /Users/danielfebrero/Git/addaps_desktop/node_modules/electron-builder/src/packager.ts:244:24
From previous event:
at Packager.doBuild (/Users/danielfebrero/Git/addaps_desktop/node_modules/electron-builder/out/packager.js:317:11)
at /Users/danielfebrero/Git/addaps_desktop/node_modules/electron-builder/src/packager.ts:175:52
at next (native)
at runCallback (timers.js:574:20)
at tryOnImmediate (timers.js:554:5)
at processImmediate [as _immediateCallback] (timers.js:533:5)
From previous event:
at Packager.build (/Users/danielfebrero/Git/addaps_desktop/node_modules/electron-builder/out/packager.js:236:11)
at /Users/danielfebrero/Git/addaps_desktop/node_modules/electron-builder/src/builder.ts:266:40
at next (native)
From previous event:
at build (/Users/danielfebrero/Git/addaps_desktop/node_modules/electron-builder/out/builder.js:69:21)
at Object.args [as handler] (/Users/danielfebrero/Git/addaps_desktop/node_modules/electron-builder/src/cli/cli.ts:46:4)
at Object.self.runCommand (/Users/danielfebrero/Git/addaps_desktop/node_modules/yargs/lib/command.js:233:22)
at Object.Yargs.self._parseArgs (/Users/danielfebrero/Git/addaps_desktop/node_modules/yargs/yargs.js:1018:24)
at Object.get [as argv] (/Users/danielfebrero/Git/addaps_desktop/node_modules/yargs/yargs.js:927:19)
at Object. (/Users/danielfebrero/Git/addaps_desktop/node_modules/electron-builder/src/cli/cli.ts:41:15)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3`
The text was updated successfully, but these errors were encountered: