forge: Make for target dmg fails after Mac OS update to 12.3.1
Pre-flight checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project uses.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
Electron Forge version
6.0.0-beta.61
Electron version
15.3.0
Operating system
macOS 12.3.1 Arm 64
Last known working Electron Forge version
6.0.0-beta.61
Expected behavior
I recently applied the OS update recommended by MacOS. The current version of the OS is 12.3.1.
Before the update, the build was working fine as expected.
Actual behavior
After the update, the build fails with the following message:
✔ Resolving Forge Config
We need to package your application before we can make it
✔ Preparing to Package Application for arch: arm64
✔ Preparing native dependencies: 2 / 2
✔ Packaging Application
Making for the following targets: dmg, zip
✖ Making for target: dmg - On platform: darwin - For arch: arm64
An unhandled error has occurred inside Forge:
An error occured while making for target: dmg
Command failed: bless --folder /Volumes/Trici --openfolder /Volumes/Trici
bless: The 'openfolder' is not supported on Apple Silicon devices.
Error: Command failed: bless --folder /Volumes/Trici --openfolder /Volumes/Trici
bless: The 'openfolder' is not supported on Apple Silicon devices.
at makeError (/Users/shashi/projects/trici-desktop-mac/node_modules/appdmg/node_modules/execa/index.js:174:9)
at /Users/shashi/projects/trici-desktop-mac/node_modules/appdmg/node_modules/execa/index.js:278:16
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Steps to reproduce
Update the macOS to the latest version and that should cause it to break.
Other libraries have reported same issue: https://github.com/tauri-apps/tauri/issues/3719 https://github.com/create-dmg/create-dmg/issues/127
Additional information
Command used:
electron-forge publish --arch=arm64
const fs = require('fs');
const packageJson = require('./package.json');
const { version } = packageJson;
const config = {
hooks: {
},
packagerConfig: {
name: 'Trici',
executableName: 'Trici',
asar: false,
icon: path.resolve(__dirname, 'resources', 'images', 'trici_icon'),
appBundleId: 'com.gettrici.trici',
usageDescription: {
Camera:
'Access is needed by certain built-in fiddles in addition to any custom fiddles that use the Camera',
Microphone:
'Access is needed by certain built-in fiddles in addition to any custom fiddles that use the Microphone',
},
appCategoryType: 'public.app-category.developer-tools',
osxSign: {
identity: 'Developer ID Application: Shashi Singh (XXXXXXXXX)',
hardenedRuntime: true,
'gatekeeper-assess': false,
entitlements: 'build/entitlements.plist',
'entitlements-inherit': 'build/entitlements.plist',
'signature-flags': 'library',
},
extendInfo: {
"LSUIElement": true
},
},
makers: [
{
name: '@electron-forge/maker-dmg',
config:{
format: 'ULFO'
}
},
{
name: '@electron-forge/maker-zip',
}
],
publishers: [
{
name: '@electron-forge/publisher-s3',
platforms: ['darwin'],
config: {
bucket: 'bucket.gettrici.com',
folder: 'darwin-x64',
accessKeyId: 'XXXXxxxxxx',
secretAccessKey:'xxxxxxxxxxxxxxxx',
region:'ap-south-1'
}
}
],
};
function notarizeMaybe() {
if (process.platform !== 'darwin') {
return;
}
if (!process.env.APPLE_ID || !process.env.APPLE_ID_PASSWORD) {
console.warn(
'Should be notarizing, but environment variables APPLE_ID or APPLE_ID_PASSWORD are missing!',
);
return;
}
config.packagerConfig.osxNotarize = {
appBundleId: 'com.gettrici.trici',
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD,
ascProvider: 'XXXXXXX',
};
}
notarizeMaybe();
// Finally, export it
module.exports = config;
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (7 by maintainers)
@greenbeam-ita the reason you’re getting the error described in this issue is because you have an x64 version of Node.js installed on your arm64 machine. Node is not aware of your host system architecture if it’s running on the wrong arch.
I would reinstall an arm64 version of Node to solve the issue.
@erickzhao I found the problem:
in àppdmg’ npm package I solve commenting out following code:
args.push('--openfolder', global.temporaryMountPath)
doesn’t work in my machine.I try to run
electron-installer-dmg
just for test, the error is still the same as I get with electron-forge make.I updated the electron-installer-dmg to the version 4.0.0.
After updating when I tried to make or publish I was getting the following error:
The code signing was failing. This was due the fact that a testapp binary was available in the location shown above. For older versions of appdmg that was not the case. For now I deleted the testapp binary from that location and the signature error does not happen anymore.
Not sure why the testapp binary is there for the latest version. The commits in the appdmg repo dont give any indication that this changed.