Skip to content
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

Codesign Error MacOS 10.13 #2125

Closed
wenxin3262 opened this issue Sep 27, 2017 · 12 comments

Comments

@wenxin3262
Copy link

commented Sep 27, 2017

  • Version: 19.30.x...19.31.x
  • Target: mac

Builder stopped working in Mac OS High Sierra. Tried with different versions got process hang, the newest version gives me this error.

Builder Log:

Packaging for darwin x64 using electron 1.4.16 to electron_dist/mac
Signing app (identity: xxxxx Developer ID Application: Company (xxxx))
Error: Command failed: codesign --sign XXXXXXXXXXXX --force /Users/user/electron_dist/mac/appname.app/Contents/MacOS/appname
/Users/user/electron_dist/mac/appname.app/Contents/MacOS/appname: resource fork, Finder information, or similar detritus not allowed

19.27.3 and Mac OS 10.12 was working.

@Skywalker13

This comment has been minimized.

Copy link

commented Oct 2, 2017

Hello,

The problem is because the zip generated by electron-builder is converting UTF-8 NFD charset to UTF-8 NFC. The new APFS filesystem supports both encodings unlike HFS+ where UTF-8 was always converted to UTF-8 NFD.

The workaround is to re-zip the .app with something else, like the zipper provided by OSX.

@develar

This comment has been minimized.

Copy link
Member

commented Oct 2, 2017

@Skywalker13 What do you mean? When .app is produced, it is signed directly, zip is not involved.

@Skywalker13

This comment has been minimized.

Copy link

commented Oct 2, 2017

The problem is not the .app, of course the .app is fine. The problem is when the zip is generated for Squirrel.Mac. This zip uses UTF-8 NFC encoding for filenames.

I'm fixing this problem just now for our customers because the updates are broken with High Sierra and this f****** change with APFS.

"mac": {
  "target": "zip"
}
@develar

This comment has been minimized.

Copy link
Member

commented Oct 2, 2017

So, your comment is not related to this issue... but about some more critical error. Could you please provide full error that your customers have?

@Skywalker13

This comment has been minimized.

Copy link

commented Oct 2, 2017

Mmmh yes sorry.. now that I re-read the issue. It seems not related even if it's a High Sierra problem too.

@develar

This comment has been minimized.

Copy link
Member

commented Oct 2, 2017

@Skywalker13 Your app has file with name includes some non-ASCII symbols?

@Skywalker13

This comment has been minimized.

Copy link

commented Oct 2, 2017

Yes like this: "Crésus"

@Skywalker13

This comment has been minimized.

Copy link

commented Oct 2, 2017

I pollute this issue (sorry) but the problem when unpacking a zip generated via electron-builder:

$ codesign -vvvv ../_synchro1.7.3/Crésus\ Synchro.app
--prepared:/Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/Squirrel.framework/Versions/Current/.
--validated:/Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/Squirrel.framework/Versions/Current/.
--prepared:/Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/Current/.
--validated:/Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/Current/.
--prepared:/Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/Electron Framework.framework/Versions/Current/.
--validated:/Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/Electron Framework.framework/Versions/Current/.
--prepared:/Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/Mantle.framework/Versions/Current/.
--validated:/Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/Mantle.framework/Versions/Current/.
../_synchro1.7.3/Crésus Synchro.app: a sealed resource is missing or invalid
file added: /Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/MacOS/Crésus Synchro
file added: /Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Resources/Crésus Synchro.icns
file added: /Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/Crésus Synchro Helper NP.app
file added: /Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/Crésus Synchro Helper.app
file added: /Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/Crésus Synchro Helper EH.app
file missing: /Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/Crésus Synchro Helper EH.app
file missing: /Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Resources/Crésus Synchro.icns
file missing: /Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/Crésus Synchro Helper NP.app
file missing: /Users/epsitec/Desktop/_synchro1.7.3/Crésus Synchro.app/Contents/Frameworks/Crésus Synchro Helper.app

I think that it's just because the zipper used by electron-builder is JS then the file index in the zip is using JS UTF-8 (NFC).

@develar

This comment has been minimized.

Copy link
Member

commented Oct 2, 2017

If I set Crésus and build zip:

macOS: 10.13.1 Beta (17B25c)
fs: APFS (in-memory disk, but doesn't matter)

  1. Without code sign I get error that no files to archive. p7zip doesn't support APFS correctly, it seems.
  2. With code signing I get error "/test/dist/mac/Crésus.app/Contents/Frameworks/Crésus Helper EH.app/Contents/MacOS/Crésus Helper EH: code object is not signed at all" It means that code sign tool from Apple has some strange issues. I have tried to unpack Electron dist using native zip instead of p7zip, but no luck.

Because of [2], I am confused. If native tool has this bug, what electron-builder can do for you...

Problem 3 — p7zip produces small ZIP compared to zip. So, not easy just replace it.

So, @Skywalker13 please clarify where did you build zip and where did you verify it (macOS version and FS). When it will be clear what to fix, I can do fixes. Until that, this issue is not considered as critical, because é and other such symbols are not widely used :) (sorry, sorry, just a fact, I don't live in the USA ;)).

@rr326

This comment has been minimized.

Copy link

commented Oct 3, 2017

Back to @wenxin3262 original question (which I also have).
The problem is listed here

I ran xattr -cr * at the root of my source code to remove all the crud and rebuilt and it worked.
(Actually, I was afraid to run it on everything so I did a xargs -lr *, took the results, turned it into a file, cleaned it up, removed files I didn't want to change, and then made a script to change each one. But same outcome - removing hidden attributes.

@develar develar closed this Oct 4, 2017

@develar develar added question and removed investigate labels Oct 4, 2017

@yoannmoinet

This comment has been minimized.

Copy link

commented Nov 8, 2017

@develar I have the same issue as your [2] but can't find any solution.

My app also have a special char ê in its name, but the issue is the exact same on the signature of Helper EH.

It appeared after the High Sierra update... I wish I didn't do it. Now I can't sign my app, and it's really problematic.

@lebsral

This comment has been minimized.

Copy link

commented Jul 1, 2018

I used the commands suggested here...
https://stackoverflow.com/questions/39652867/code-sign-error-in-macos-high-sierra-xcode-resource-fork-finder-information

specifically, this ended up working for my project
find . -type f -name '*.png' -exec xattr -c {} \;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.