firebird icon indicating copy to clipboard operation
firebird copied to clipboard

MacOS ARM version requires Rosetta

Open e787 opened this issue 2 years ago • 4 comments

On a new install of macOS without Rosetta on a M1 Mac, the ARM installer refuses to continue unless Rosetta is installed.

Rosetta screenshot

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 should solve the problem.

e787 avatar Nov 30 '24 13:11 e787

As you have different packages for the different archs, should it list hostArchitectures="arm64" in one and hostArchitectures="x86_64" in the other?

asfernandes avatar Nov 30 '24 17:11 asfernandes

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.

e787 avatar Dec 01 '24 17:12 e787

Please test these builds: https://github.com/FirebirdSQL/firebird/pull/8342/checks

asfernandes avatar Dec 05 '24 00:12 asfernandes

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.

e787 avatar Dec 06 '24 15:12 e787