I can't build the app on MacOS anymore due to Can't locate Mac/Memory.pm in @INC (you may need to install the Mac::Memory module).
Related: https://github.com/electron-userland/electron-builder/issues/3990
__Describe the Bug__
Log
electron-builder -c.forceCodeSigning=false --publish=never -c.artifactName=${name}-${version}-${os}-${arch}.${ext} -c.dmg.artifactName=${name}-${version}-${os}.${ext} -c.nsis.artifactName=${name}-${version}-${os}-setup.${ext} -c.nsisWeb.artifactName=${name}-${version}-${os}-web-setup.${ext}
• electron-builder version=20.28.4
• loaded configuration file=/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/electron-builder.json
• writing effective config file=dist/builder-effective-config.yaml
• no native production dependencies
• packaging platform=darwin arch=x64 electron=3.1.12 appOutDir=dist/mac
• skipped macOS application code signing reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, see https://electron.build/code-signing allIdentities=
0 identities found
Valid identities only
0 valid identities found
• building target=DMG arch=x64 file=dist/camunda-modeler-3.3.5-mac.dmg
• building target=macOS zip arch=x64 file=dist/camunda-modeler-3.3.5-mac.zip
Error: Exit code: 2. Command failed: /usr/bin/perl /private/var/folders/kb/by0f9f1j52dbfsqsrwlfxgb80000gn/T/t-1i2E3J/1-dmgProperties.pl
Can't locate Mac/Memory.pm in @INC (you may need to install the Mac::Memory module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /private/var/folders/kb/by0f9f1j52dbfsqsrwlfxgb80000gn/T/t-1i2E3J/1-dmgProperties.pl line 4.
BEGIN failed--compilation aborted at /private/var/folders/kb/by0f9f1j52dbfsqsrwlfxgb80000gn/T/t-1i2E3J/1-dmgProperties.pl line 4.
Can't locate Mac/Memory.pm in @INC (you may need to install the Mac::Memory module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /private/var/folders/kb/by0f9f1j52dbfsqsrwlfxgb80000gn/T/t-1i2E3J/1-dmgProperties.pl line 4.
BEGIN failed--compilation aborted at /private/var/folders/kb/by0f9f1j52dbfsqsrwlfxgb80000gn/T/t-1i2E3J/1-dmgProperties.pl line 4.
at /Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/builder-util/src/util.ts:128:16
at ChildProcess.exithandler (child_process.js:301:5)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
From previous event:
at applyProperties (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/dmg-builder/out/dmgUtil.js:176:18)
at /Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/dmg-builder/src/dmg.ts:305:9
From previous event:
at customizeDmg (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/dmg-builder/out/dmg.js:209:18)
at /Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/dmg-builder/src/dmg.ts:41:7
at /Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/dmg-builder/src/dmgUtil.ts:37:31
From previous event:
at attachAndExecute (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/dmg-builder/out/dmgUtil.js:114:17)
at /Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/dmg-builder/src/dmg.ts:41:7
at Generator.next (<anonymous>)
From previous event:
at DmgTarget.build (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/dmg-builder/src/dmg.ts:73:7)
at Function.buildAsyncTargets (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/app-builder-lib/src/platformPackager.ts:139:36)
at MacPackager.packageInDistributableFormat (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/app-builder-lib/src/platformPackager.ts:118:24)
at nonMasPromise.then.then (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/app-builder-lib/src/macPackager.ts:90:26)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
From previous event:
at /Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/app-builder-lib/src/macPackager.ts:90:10
at Generator.next (<anonymous>)
From previous event:
at MacPackager.pack (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/app-builder-lib/src/macPackager.ts:80:95)
at /Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/app-builder-lib/src/packager.ts:376:24
at Generator.next (<anonymous>)
at xfs.stat (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
at /Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/graceful-fs/polyfills.js:285:20
at FSReqWrap.oncomplete (fs.js:154:5)
From previous event:
at Packager.doBuild (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/app-builder-lib/src/packager.ts:344:39)
at /Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/app-builder-lib/src/packager.ts:314:57
at Generator.next (<anonymous>)
at /Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/graceful-fs/graceful-fs.js:111:16
at /Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/graceful-fs/graceful-fs.js:45:10
at FSReqWrap.args [as oncomplete] (fs.js:140:20)
From previous event:
at Packager._build (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/app-builder-lib/src/packager.ts:285:133)
at /Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/app-builder-lib/src/packager.ts:281:23
at Generator.next (<anonymous>)
From previous event:
at Packager.build (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/app-builder-lib/src/packager.ts:238:14)
at build (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/app-builder-lib/src/index.ts:58:28)
at build (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/electron-builder/src/builder.ts:227:10)
at then (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/electron-builder/src/cli/cli.ts:42:48)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
From previous event:
at Object.args [as handler] (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/electron-builder/src/cli/cli.ts:42:48)
at Object.runCommand (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/yargs/lib/command.js:238:44)
at Object.parseArgs [as _parseArgs] (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/yargs/yargs.js:1089:24)
at Object.get [as argv] (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/yargs/yargs.js:1004:21)
at Object.<anonymous> (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/electron-builder/src/cli/cli.ts:25:28)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/execa/index.js:347
throw err;
^
Error: Command failed: electron-builder -c.forceCodeSigning=false --publish=never -c.artifactName=${name}-${version}-${os}-${arch}.${ext} -c.dmg.artifactName=${name}-${version}-${os}.${ext} -c.nsis.artifactName=${name}-${version}-${os}-setup.${ext} -c.nsisWeb.artifactName=${name}-${version}-${os}-web-setup.${ext}
at makeError (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/execa/index.js:174:9)
at module.exports.sync (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/node_modules/execa/index.js:338:15)
at Object.<anonymous> (/Users/maciej.barelkowski/workspace/bpmn-io/camunda-modeler/tasks/distro.js:127:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:distro: `node tasks/distro.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:distro script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/maciej.barelkowski/.npm/_logs/2019-10-10T17_42_04_008Z-debug.log
ERROR: "build:distro --" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `run-s client:build "build:distro -- {@}" "build:test-distro -- {@}" --`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/maciej.barelkowski/.npm/_logs/2019-10-10T17_42_04_073Z-debug.log
ERROR: "build --" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] all: `run-s clean lint test "build -- {@}" --`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] all script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/maciej.barelkowski/.npm/_logs/2019-10-10T17_42_04_105Z-debug.log
__Steps to Reproduce__
npm run all__Expected Behavior__
App builds.
__Environment__
develop, any in factChild of https://github.com/camunda/camunda-modeler/issues/1584
Updating the electron-builder to the latest version (21.2.0) seems to fix the build (as it bundles all files, the application is runnable via the .dmg file), but break the test-distro command.
FAILURE Error: invalid comment length. expected: 55271. found: 0
at /Users/niklas.kiefer/bpmn-io/camunda-modeler/node_modules/yauzl/index.js:133:25
at /Users/niklas.kiefer/bpmn-io/camunda-modeler/node_modules/yauzl/index.js:631:5
at Immediate.<anonymous> (/Users/niklas.kiefer/bpmn-io/camunda-modeler/node_modules/fd-slicer/index.js:202:5)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
Indeed, the zipping seems to be still broken:

Cf. https://github.com/electron-userland/electron-builder/issues/4179
Yes, the zip files problem has not been fixed yet: https://github.com/electron-userland/electron-builder/issues/3534
This is not a critical issue for us as long as releases can still be built our releases on Travis. As it looks like Travis still uses 10.12 so we are fine (cf. build log).
It is annoying and a potential time sink, though, as our Mac developers cannot test the built app anymore.
@pinussilvestrus You mentioned a manual workaround, could you investigate if that exists / works for the time being?
Sure, I'll check this soon.
So the manual workaround for fixing the .zip file would basically look like:
.app file from dist/LOL
Anyway, what currently would work by upgrading the electron-builder dependency, it's that it is building a working .dmg file. The only thing which is broken is the .zip file. It seems like they are actively looking for a solution right now: https://github.com/electron-userland/electron-builder/issues/4299
So I think, as it is currently possible for us, the Mac Developers, to build the application locally by upgrading the electron-builder to v21.2.0 version, we should just wait for the actual zipping fix for closing this issue here.
If you guys think we should do an intermediate step by updating to v21.2.0 and another update later, we can also do it this way.
A new pre-release version of the build tools are published (v22.1.0) but doesn't fix the broken zipping.
Maybe, but don't know for sure, adding a notarization could touch this one as well.
Same issue. Upgrading electron-builder to the latest version (21.2.0) solved the problem.
Most helpful comment
Same issue. Upgrading
electron-builderto the latest version (21.2.0) solved the problem.