LinusU / node-appdmg

💾 Generate your app dmgs
MIT License
1.69k stars 152 forks source link

fix: bless on Rosetta capable environments(arm64) #223

Open SReject opened 1 year ago

SReject commented 1 year ago

Issue: - bless doesn't support --openfolder for Apple Silicon based architectures. - With Rosetta transcoding the current check of os.arch() returns x86; this is why #205 did not solve the issue. - Other node-native potential checks also fail to identify Apple Silicon environments

Fix: - Check sysctl.proc_translated and if it has a value assume the machine is Rosetta-capable and thus Apple Silicon

Implementation: - use sysctl command to retrieve the value of sysctl.proc_translated. If a value is returned it can be assumed the machine is Rosetta-capable. - Do not use --openfolder when Rosetta-capability has been assumed.

Tests: - MacBook Air, 2020 (M1) - MacBook Pro, 2021 (M1 Pro)

Addresses:

216, #218, #219

jjeff commented 1 year ago

Giving this a nudge.

By default, Github Actions Runner runs in Rosetta mode on Apple Silicon devices. This means that currently, node-appdmg won't work in a Ventura CI build environment.