Apple M1 and the new machines. Defold?

I’m curious if you guys have already tried Defold (both the engine and the editor) on the Apple Silicon devkit even under Rosetta2 and what’s the result :smiley:

1 Like

There’s an initial answer to a similar question from a couple of weeks back:
Apple Silicon/ARM support for macOS

2 Likes

Is there any update on Apple Silicon support?
Would be great to run it natively both editor and engine :slight_smile:

Sorry no update yet.

As I known @astrochili is using M1 air-book with Defold through rosetta. It’d be cool to read his experience here.

Yes that would be great.
Personally I’m waiting for a new desktop machine, but I’ve seen on a friend’s mac-mini, running Blender optimized for arm chips and the speed difference is well, big!

In fact, there is nothing special here about Defold Editor on M1 devices. It just works as usual, like any application built for the x86_64-darwin architecture.

macOS detects the lack of support for the arm64 architecture and launches the application with rosetta. There is no difference for the user, he does not know if the application is running with rosetta or not.

It’s difficult for me to objectively talk about performance, because before that I used a macbook air 2012 and obviously everything became faster rather than slower. Plus, my projects are still very small, so everything works pretty fast on both devices.

The only problem with the M1 that needs to be solved is the support for iOS applications that run on macOS, but this is not about the editor or the desktop build.

5 Likes

We got asked about this from a user. Any update on this?

No updates I’m afraid.
It’s not in our near future plans (yet), and we also need to buy hardware to the team member(s).
Another thing is that Github Actions (our CI) doesn’t yet support M1 and above.

3 Likes

Found the problem with building on M1 with bob.

java -jar bob.jar --variant debug build

The build failed for the following reasons:

ERROR game.render_script:0 /libexec/x86-darwin/luajit-32 could not be found locally, create an application manifest to build the engine remotely.

Building in the Editor works fine. Building with bob.jar also is fine after any bundling operation in the Editor. But after any code editing it broke again.

Version of both is 1.2.184

2 Likes

What if you use —platform=x86_64-darwin ?

Here’s a special bob.jar build, which prints out the architecture you’re on.
Please try it and report back the “os_name” and “arch”.

Also, the bob.jar implements the fix by always returning x86_64-darwin as the supported host platform (since we don’t support x86-darwin anymore).

bob.jar

The output with a special bob.jar build:

MAWE: getHostPlatform: os_name: mac os x   arch: aarch64
Working...MAWE: getHostPlatform: os_name: mac os x   arch: aarch64
Build Remote Engine...
MAWE: getHostPlatform: os_name: mac os x   arch: aarch64
MAWE: getHostPlatform: os_name: mac os x   arch: aarch64
Building engine...ERROR: unspecified:-1: 'com.dynamo.bob.CompileExceptionError: 'x86_64-osx' could not be built. Sdk version: 'ef879961c127c1b1e533b87ce60423387f1ef190'
Log: 'Internal Server Error''

Exception in thread "main" com.dynamo.bob.CompileExceptionError: 'x86_64-osx' could not be built. Sdk version: 'ef879961c127c1b1e533b87ce60423387f1ef190'
Log: 'Internal Server Error'
        at com.dynamo.bob.bundle.BundleHelper.buildEngineRemote(BundleHelper.java:1155)
        at com.dynamo.bob.Project.buildEngine(Project.java:793)
        at com.dynamo.bob.Project.doBuild(Project.java:996)
        at com.dynamo.bob.Project.build(Project.java:516)
        at com.dynamo.bob.Bob.mainInternal(Bob.java:633)
        at com.dynamo.bob.Bob.main(Bob.java:682)
Caused by: com.defold.extender.client.ExtenderClientException: Failed to build source.
        at com.defold.extender.client.ExtenderClient.build(ExtenderClient.java:205)
        at com.dynamo.bob.bundle.BundleHelper.buildEngineRemote(BundleHelper.java:1097)
        ... 5 more
1 Like

Thanks for the info!

My bad, I didn’t realize you were using native extensions.

You can try this build:
http://d.defold.com/archive/dev/034112d0a45c425a830194dd67f6833a8b453d59/bob/bob.jar

1 Like

Unfortunately, the error is the same but with the different sdk. Yes, I use native extensions, sorry if that was important.

Working...Build Remote Engine...
Building engine...ERROR: unspecified:-1: 'com.dynamo.bob.CompileExceptionError: 'x86_64-osx' could not be built. Sdk version: '034112d0a45c425a830194dd67f6833a8b453d59'
Log: 'Internal Server Error''

Exception in thread "main" com.dynamo.bob.CompileExceptionError: 'x86_64-osx' could not be built. Sdk version: '034112d0a45c425a830194dd67f6833a8b453d59'
Log: 'Internal Server Error'
        at com.dynamo.bob.bundle.BundleHelper.buildEngineRemote(BundleHelper.java:1155)
        at com.dynamo.bob.Project.buildEngine(Project.java:793)
        at com.dynamo.bob.Project.doBuild(Project.java:996)
        at com.dynamo.bob.Project.build(Project.java:516)
        at com.dynamo.bob.Bob.mainInternal(Bob.java:632)
        at com.dynamo.bob.Bob.main(Bob.java:681)
Caused by: com.defold.extender.client.ExtenderClientException: Failed to build source.
        at com.defold.extender.client.ExtenderClient.build(ExtenderClient.java:205)
        at com.dynamo.bob.bundle.BundleHelper.buildEngineRemote(BundleHelper.java:1097)
        ... 5 more

By the way, why does the Editor do it without errors?

Hmm, perhaps if you use the “–build-server https://build-stage.defold.com
(It is an unreleased/beta version after all)

Build server in the Editor preferences is https://build.defold.com.

Will keep in touch if there is any new clue.

Tried this special build with a project without NE:

The build failed for the following reasons:
ERROR builtins/fonts/system_font.font:0 Could not initialize class com.dynamo.bob.TexcLibrary

Created the issue #5949.

Did anyone solve to run bob.jar on M1 during this time? Can anyone confirm that they have the same problem? I really want to get my debugger working again in VSCode, but it depends on bob.jar :slight_smile:

That fix was merged about months ago, but it somehow fell out of the release notes (which I’ve now updated)

https://forum.defold.com/t/defold-1-2-185-has-been-released

4 Likes

Oh, that’s great news! It’s time to update my version of Defold!

2 Likes