Is there a way to speed up build process on Mac?
See original GitHub issue- Version: 22.9.1
- Electron Version: 11.1.0
- Electron Type (current, beta, nightly):
- Target: macOS (dmg & zip)
I am noticing that it takes a lot of time (close to 45 - 50 minutes) to make a build for macOS. Just wondering if that process can be sped up.
For the build, I am using standard build configuration which prepares a dmg and a zip file. The process is fairly standard. Here are the steps, the build process goes through:
- Compile code & sign binaries (takes approximately 5 minutes)
- Notarize application (takes approximately 10 minutes)
- Build artifacts [zip, dmg, and dmg.blockmap] (takes approximately 20 minutes). The most of the time is spent in building dmg.blockmap file. Other artifacts are built pretty fast.
- Upload artifacts in Azure Storage (takes approximately 10 - 15 minutes depending on the Internet speed).
Now, 2 and 4 are not really in our control as a lot of the time spent in these steps depends on internet connectivity. What I am wondering is if we can somehow speed up step 3?
Here’s the build script I am using:
const builder = require('electron-builder');
const buildCommonConfig = require('./common-build-config.js');
console.log('Building installer for OSX (x64). Please wait....');
const osxConfig = {
category: 'public.app-category.developer-tools',
icon: './resources/osx/icon.icns',
artifactName: 'AppName.${ext}',
hardenedRuntime: true,
gatekeeperAssess: false,
entitlements: './resources/osx/entitlements.mac.plist',
entitlementsInherit: './resources/osx/entitlements.mac.inherit.plist',
target: {
target: 'default',
arch: ['x64']
}
};
const osxBuildConfig = Object.assign({
afterSign: './build-scripts/after-sign-hook.js'//This is where notarization happens.
}, buildCommonConfig);
osxBuildConfig.mac = osxConfig;
builder.build({
config: osxBuildConfig
})
.then((result) => {
console.log('Done building OSX (x64) installer....');
console.log(result);
})
.catch((error) => {
console.log('Error building OSX (x64) installer....');
console.log(error);
});
To compare, building for Windows (NSIS) and Linux (AppImage) takes about 15 - 20 minutes.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:12
Top Results From Across the Web
Improving the speed of incremental builds - Apple Developer
Before you perform any build optimizations, always gather timing information to see where optimizations might be most effective. Open your project in Xcode...
Read more >Speeding Up Xcode Builds - Ricardo Castellanos - Medium
This option allows Xcode to speed up total build time by building targets that do not depend on each other at the same...
Read more >How to speed up a slow Mac - Macworld
1. One of the most obvious things you can do if your Mac has slowed down is restart it. However, we understand that...
Read more >Why Is My Mac So Slow? | 9 Fixes to Speed Up Your Mac - Avast
This is the easiest way to speed up your iMac, Mac mini, and Mac Pro. Turn off your Mac completely and unplug the...
Read more >18 tips for speeding up a slow Mac - Setapp
Essentially everything you touch within your computer leaves cache files: system, browsers, apps, user preferences, etc. Over time, the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @mmaietta. Thanks for all your help. I really appreciate it. So I asked a team member of mine to do the build on his Mac (which is a newer machine) and on his machine the build completed in 15 minutes (no notarization and uploading in storage, just build). So it looks like an issue with just my computer.
However let me keep this issue open for now. Over this weekend I will try to do what you suggested. I will report with my findings.
@gmantri try applying this patch to your project and report back with the results, preferably also with the compilation duration delta between with & without the patch.
app-builder-lib+22.10.5.patch