MacOS ARM version requires Rosetta
On a new install of macOS without Rosetta on a M1 Mac, the ARM installer refuses to continue unless Rosetta is installed.
As far as I know, editing the file "Distribution.xml" in "builds/install/arch-specific/darwin/Distribution.xml" to adding the attribute hostArchitectures="arm64,x86_64" on
As you have different packages for the different archs, should it list hostArchitectures="arm64" in one and hostArchitectures="x86_64" in the other?
Your proposal looks like the desirable behavior. Mine was just a suggestion, because it seems to solve the problem with less effort.
To add more context,man productbuild specifies the following:
NOTE: On Apple Silicon, the macOS Installer will evaluate the product's distribution under Rosetta 2
unless the arch key includes the arm64 architecture specifier. Some distribution properties may be
evaluated differently between Rosetta 2 and native execution, such as the predicate specified by the
sysctl-requirements key. If the distribution is evaluated under Rosetta 2, any package scripts inside of
product will be executed with Rosetta 2 at install time.
I've found a post that talks about this situation, and adds another option:
The second solution is a bit easier. You can create a requirements.plist property plist file in the form:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>arch</key>
<array>
<string>x86_64</string>
<string>arm64</string>
</array>
</dict>
</plist>
Then you can provide this property list file to the productbuild command with the --product option.
> productbuild --package component.pkg --product requirements.plist distribution.pkg
This way, productbuild still generates the Distribution xml and merges in your choices from the requirements.plst.
There are other options you can add which are documented in the productbuild man page.
Looks like both options solve the problem of forcing Rosetta 2 on the arm version.
I suppose adding one string or both will depend on whether the installer is arch-specific or universal.
Please test these builds: https://github.com/FirebirdSQL/firebird/pull/8342/checks
I've just tested this version and everything looks great: Rosetta 2 is no longer required during installation and I can connect to databases and work with them.