electron-builder: Notarization fails on MacOS 10.15.3
We are trying to notarize our electron app, but the notarization is not working . It fails with the following issue :-
"issues": [ { "severity": "error", "code": null, "path": "/Contents/Resources/app/node_modules/fsevents/build/Release/.node", "message": "The binary is not signed.", "docUrl": null, "architecture": "x86_64" }, { "severity": "error", "code": null, "path": "/Contents/Resources/app/node_modules/fsevents/build/Release/.node", "message": "The signature does not include a secure timestamp.", "docUrl": null, "architecture": "x86_64" } ]
How to resolve this error, and also if we have a method for deep code signing in electron-builder?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 8
- Comments: 59 (20 by maintainers)
Our signing is all on CI and uses
CSC_LINKandCSC_KEY_PASSWORDso it’s going to be a pain to get manualcodesignworking with that.I’d rather get this fixed in
electron-builderso everyone can benefit from it.To add my two cents…
I’m also experiencing similar issues with deep code signing, this time with
@tensorflow/tfjs-node.I’ve read through this thread a couple times now and can’t quite find “the fix”. Wondering if anyone has any input, or if any help is needed to get this resolved in electron-builder itself.
Thanks!
I think there are kind of 2 questions brought up here?
The historical/original intention for hidden files is that files that
.gitignoreor.DS_Storecan be skipped because they aren’t really executable binaries. Also, funnily they don’t have an extension name because the dot-DS_Store is its name (as far aspath.basename()concerns). The actual binary executables also don’t usually have an extension. So the decision was made to skip all the hidden-file-looking files.However, this turned out to be overlook as reported in https://github.com/electron/electron-osx-sign/issues/168 not because native node modules are ignored and causing code-signing issues, but because the compiled native code modules can simply be named as
.nodeand placed in a dist directory (which was unheard of, at that time, to me). And the current version ofelectron-osx-sign@0.4.15still skips the.nodefile, but you can force-code-sign that file by passing an argument toelectron-osx-sign.Therefore, https://github.com/electron/electron-osx-sign/pull/169 is created so that we check all files if they are binary-looking and we code-sign them all. However, I didn’t have much time to test it, so it’s left as an open PR. Theoretically, it should work. I’ll be curious to hear if this PR works for people so it can be merged to master without causing troubles for existing workflows that people set up.
The
_CodeSignature/CodeResourcesare artifacts from code-signing. And you may find more information about them here: https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.htmlHope this helps!
I’ve checked the debug output with
DEBUG=electron-osx-signand it lists all the binaries it’s signing in the app. Everything looks good and there is no erroneousnode_modules/fsevents/build/Release/.nodeentry listed there.I have no idea how the erroneous entry is ending up in
_CodeSignature/CodeResourcesbecause that file is written by thecodesigntool. 🤷♂️I did this before the building and before the packing. Basically before running any build script.
I don’t know about how node_modules works in this case. I made sure I signed all files that were in the sign logs from Apple. In my case mostly
.soand.dylibfiles. You should check those logs and see which files are the problem.You can use something like this to sign them:
find . -name *.so -exec codesign -s "Company Name" --options=runtime -v {} \;@eschirtz I’m glad it worked! This is the expected behavior at the moment before https://github.com/electron/electron-osx-sign/pull/169 is merged in. If you’re interested in giving this PR a try perhaps we can make it available to everyone who may get similar issues of binary files missing codesigning.
@eschirtz Sorry about the delay. Can you open an issue at
electron-osx-signand I can take a closer look at the issue? My take on the problem you’re having right now is that the tensorflow shared objects (.so) are not codesigned. If you’re usingelectron-osx-sign, then you can explicitly provide a list of paths to these binary files to include them during codesigning.It looks like Apple tightened up notarisation on Feb 3rd and warnings became errors. Because warnings are not displayed by
electron-notarizewe’re only finding out about them now.For
electron-buildermacOS configuration there is abinariesoption but looking at it’s usage, these need to be an array of full paths to each binary.electron-builderis already detecting binaries for relocation toapp.asar.unpackedso it should ideally add these to the list of files to automatically sign.