Rosetta 2 automated installer problem

Hi,

It appears that the automated triggering of Rosetta 2 installer is only done when a user directly clicks on an Intel only binary on silicon hardware.

I have an app that is itself a universal binary but which loads an intel only plugin. This does not cause the built in Rosetta 2 installer to launch.

I can detect that the app is running on arm64 and I can detect that Rosetta is not yet installed but I cannot programatically install it. It would be nice to have one of the following:

  • The ability to require Rosetta in the app's plist for a universal binary.
  • A system call to initiate installation.
  • For the automated installer to work however a binary is run.

The first seems like the cleanest solution. Without one of these, or some other fix, Rosetta 2 installation is incoherent.

For now the only way I can work round this issue is very ugly: include a second minimal x86_64 only app with my app as a no op installer for Rosetta, then when my app runs if I detect that Rosetta is missing on silicon, throw up an alert to ask the user to run the bundled minimal app and exit. This is less than ideal.

Can you suggest a better way to work round this issue?

or

Can you add one of the above solutions as a feature request?

Thanks

Paul

I have an app that is itself a universal binary but which loads an intel only plugin. This does not cause the built in Rosetta 2 installer to launch.

Yep.

Can you suggest a better way to work round this issue?

Does the user have to run this helper app? I would’ve thought that the Rosetta installer would kick in if you launched it via a high-level API, for example, NSWorkspace. Did you try that?

Can you add one of the above solutions as a feature request?

To get this on the to-do list, file an enhancement request describing your requirements. Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hi @eskimo

I hadn’t thought of using NSWorkspace to launch the helper app. If you think it might trigger the Rosetta installer I’ll give it a try.

Thank you

P

That worked!

As my main app is a catalyst app I first tried using UIApplication openUrl but that didn't set off the installer. To call NSWorkspace I had to first load a AppKit bundle and from that use NSWorkspace to call the bundled intel utility application. It's not very elegant underneath but to the user is not bad at all now as I can hide the utility app with the NSWorkspace config.

I opened a bug report which I will update FB11989427 as it would still be nice to have a more simple solution.

Thank you for your help.

P

I’m glad to hear that NSWorkspace gets the job done.

To call NSWorkspace I had to first load a AppKit bundle

So, to be clear, Apple doesn’t support that. From our perspective, a process is either Catalyst or not. Mixing and matching in this way can produce unexpected results.

In this case a better option is to do this from a separate process. You can either write your own command-line tool or use open. Sadly, NSTask (Process in Swift) isn’t available in Catalyst [1] so you’ll have to run that using posix_spawn. If you need help with that, let me know; I’ve got some code for it lying around somewhere.

I opened a bug report … FB11989427

Thanks.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Not for any good reason, it’s just a bug (r. 82912914).

Hi @eskimo

I have swapped out my use of NSTask to use posix_spawn instead, which seems to work fine. Thank you for that it's nice stop using something unsupported.

But I haven't been able to get Darwin's open(2) to trigger the Rosetta installer on silicon, so for now I am stuck with either using NSWorkspace via an AppKit bundle, or asking the user to manually click on a separate app to trigger the install.

Having removed NSTask it seems a shame to not be able to drop the AppKit bundle from my project. How dangerous is it to stick with the AppKit/NSWorkspace solution for now in the hope a fix comes out in the future?

P

But I haven't been able to get Darwin's open(2) to trigger the Rosetta installer

You mean open(1) right? open(2) is the system call, and that definitely won’t trigger Rosetta. You want to run the open command-line tool, which calls through to NSWorkspace under the covers.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

No - I was trying to use open(2)! I’ll try open(1) now.

P

Hi @eskimo

Using the command line open to run my small utility app doesn't seem to work either.

Calling open with posix_spawn from my catalyst app fails with an error -10669

2023-03-02 12:23:54.192327+0000 open[2470:28100] [open] LAUNCH: Launch failure with -10669/ <FSNode 0x600000558c40> { isDir = y, path = '/Users/paul/Library/Developer/Xcode/DerivedData/EditBoardCatalyst-fcsozxgrvhpstfcyxnuevzthivxj/Build/Products/Debug-maccatalyst/Edit Board.app/Contents/Resources/bin/Edit Board.app' } The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-10669 "(null)" UserInfo={_LSLine=4101, _LSFunction=_LSOpenStuffCallLocal}

If I use open from a terminal to run the app I get the same error as calling it with posix_spawn from my catalyst app.

It seems like only AppKit/NSWorkspace or a manual click works.

P

Calling open with posix_spawn from my catalyst app fails with an error -10669

In general? Or only in the case where you’re trying to trigger Rosetta?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Only when trying to trigger the Rosetta installer by running a small intel only app with open when Rosetta is not installed. Otherwise posix_spawn is working fine for me and I have replaced using NSTask with it for a couple of different things and it seems to work just as well.

The same small app will cause the same error (same code) when run using open from the terminal but runs ok and triggers the installer when manually clicked or run using NSWorkspace from my catalyst app.

Once Rosetta is installed it will run using open from the terminal.

Well, that’s strange.

If you embed your own command-line tool in your Catalyst app, have it call NSWorkspace to run your tiny Intel app, and then run it using posix_spawn, does that work?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Rosetta 2 automated installer problem
 
 
Q