Hey folks!
I spent a long time today debugging an issue with electron-packager. I've resolved it, but I wanted to post an issue here so others don't get stuck on the same issue.
I use electron-packager on Travis to package and codesign a Mac OS X build of an Electron app. Recently I needed to upgrade the Travis image to Mac OS Sierra by adding osx_image: xcode8.3 to my .travis.yml file. After making this change, I discovered that electron-packager appeared to hang forever. The builds just timed out after ~45 minutes.
I edited the Travis configuration to invoke electron-packager and the rest of the build process with DEBUG=electron-packager,electron-osx-sign. This showed the last line that was logged before the process hung:
Mon, 14 Aug 2017 20:38:17 GMT electron-osx-sign Executing... codesign --sign 487B46D1C8E4FC8B7DB8666133B6A553E951B66A --force /var/folders/bb/n7t3rs157850byt_jfdcq9k80000gn/T/nylas-build/electron-packager/darwin-x64/Merani-darwin-x64/Merani.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework
I set up my local environment so I could package and codesign the app on my machine, complete with the "temporary keychain" setup used on the build machine. It turns out that starting in Mac OS X Sierra, codesign displays a UI prompt for permission to access the keychain, even if it's unlocked. Since Travis is headless, the build process locked forever at the permission dialog.

To fix this, I followed instructions here (https://stackoverflow.com/questions/39868578/security-codesign-in-sierra-keychain-ignores-access-control-settings-and-ui-p) and added this line to my keychain setup script:
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k <<keychainPass>> <<keychainName>>
I think this issue is pretty rare because Travis still uses an older version of Mac OS X by default. When / if Travis starts defaulting to Sierra, this might be a common problem!
Hey folks!
I spent a long time today debugging an issue with electron-packager. I've resolved it, but I wanted to post an issue here so others don't get stuck on the same issue.
I use electron-packager on Travis to package and codesign a Mac OS X build of an Electron app. Recently I needed to upgrade the Travis image to Mac OS Sierra by adding
osx_image: xcode8.3to my.travis.ymlfile. After making this change, I discovered thatelectron-packagerappeared to hang forever. The builds just timed out after ~45 minutes.I edited the Travis configuration to invoke electron-packager and the rest of the build process with
DEBUG=electron-packager,electron-osx-sign. This showed the last line that was logged before the process hung:I set up my local environment so I could package and codesign the app on my machine, complete with the "temporary keychain" setup used on the build machine. It turns out that starting in Mac OS X Sierra,
codesigndisplays a UI prompt for permission to access the keychain, even if it's unlocked. Since Travis is headless, the build process locked forever at the permission dialog.To fix this, I followed instructions here (https://stackoverflow.com/questions/39868578/security-codesign-in-sierra-keychain-ignores-access-control-settings-and-ui-p) and added this line to my keychain setup script:
I think this issue is pretty rare because Travis still uses an older version of Mac OS X by default. When / if Travis starts defaulting to Sierra, this might be a common problem!