Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DF not executing on Darwin ARM64 (Apple M1)  (Read 2789 times)

max2veg

  • Escaped Lunatic
    • View Profile
DF not executing on Darwin ARM64 (Apple M1)
« on: January 13, 2021, 12:26:01 am »

If using Go(lang), game should be easier to maintain - any plans on that?

Logged

A_Curious_Cat

  • Bay Watcher
    • View Profile
Re: DF not executing on Darwin ARM64 (Apple M1)
« Reply #1 on: January 13, 2021, 12:52:05 am »

First of all, you should be able to run DF on Apple M1 based systems using the Rosetta 2 app that comes with MacOS Big Sur (unless what you want is a native version, in which case I’ve already answered that for you in a previous thread).

Second, reimplementing DF in Go would require Toady One to completely rewrite the game from scratch.  This would be very time consuming (it would basically mean the past 20 years had been all for naught) and would push back milestones such as the myth and magic release by several years (if not decades).  All of this for little real benefit  And no I don’t believe Go programs are any easier to maintain than C++ ones.  Maintainability is as much about developer practices as it is about the features the language provides.  It’s very possible to write good, maintainable, code is Go and it’s equally possible to do so in C++.  Likewise, it’s very possible to write bad, unmaintainable code in C++ and it’s equally possible to do so in Go.  It all comes down to best practices and proper use of the tools a developer is given.


(And really, I think someone should buy Toady One a Mac Mini M1...)
Logged
Really hoping somebody puts this in their signature.

max2veg

  • Escaped Lunatic
    • View Profile
Re: DF not executing on Darwin ARM64 (Apple M1)
« Reply #2 on: January 13, 2021, 09:12:45 am »

you should be able to run DF on Apple M1 based systems using the Rosetta 2 app that comes with MacOS Big Sur

Got it to work w/ world gen (reproduced, total of 2 runs), but when starting in `Dwart Fortress`, crashes (exits):

Code: [Select]
Preparing game...
./df: line 17: 86451 Segmentation fault: 11  ./dwarfort.exe "$@"

Any ideas?
Logged

A_Curious_Cat

  • Bay Watcher
    • View Profile
Re: DF not executing on Darwin ARM64 (Apple M1)
« Reply #3 on: January 13, 2021, 05:55:23 pm »

you should be able to run DF on Apple M1 based systems using the Rosetta 2 app that comes with MacOS Big Sur

Got it to work w/ world gen (reproduced, total of 2 runs), but when starting in `Dwart Fortress`, crashes (exits):

Code: [Select]
Preparing game...
./df: line 17: 86451 Segmentation fault: 11  ./dwarfort.exe "$@"

Any ideas?

Not really.  I don’t have an Apple M1 based system with which to test on (I’ve just been going off the publicly available material), so I can’t say what might be causing the problem.  It could be a bug in DF (although I doubt Toady One would bother to fix a bug that only showed up when trying to run the game under an emulator), or it could be a bug in Rosetta 2 (in which case it’s Apple’s problem and not Toady’s).

Actually, there is one possibility.  If you are telling Rosetta 2 to execute ./df, which is a script file that can be executed on different processors without needing something like Rosetta 2, Rosetta 2 might be simply handing it off to the os to execute.  The problem comes when this script wants to execute compiled applications, such as dwarfort.exe, in which case it tries to execute the application without Rosetta 2 and fails.  The only so.Union here would be to rewrite ./df to run each compiled application under Rosetta 2.

Wait...  I just noticed something!

Are you sure your trying to run the MacOS version under Rosetta 2 and not the Windows version?  I’m asking because the error message you posted has a filename in it that ends with .exe, suggesting that it’s a Windows application.  Rosetta 2 doesn’t know how to run Windows applications.  You need to use the MacOS version of DF.
Logged
Really hoping somebody puts this in their signature.

max2veg

  • Escaped Lunatic
    • View Profile
Re: DF not executing on Darwin ARM64 (Apple M1)
« Reply #4 on: January 16, 2021, 10:20:35 am »

Actually, there is one possibility.  If you are telling Rosetta 2 to execute ./df, which is a script file that can be executed on different processors without needing something like Rosetta 2, Rosetta 2 might be simply handing it off to the os to execute.  The problem comes when this script wants to execute compiled applications, such as dwarfort.exe, in which case it tries to execute the application without Rosetta 2 and fails.  The only so.Union here would be to rewrite ./df to run each compiled application under Rosetta 2.

I run terminal in Rosetta2 mode (thus, explicitly), and according to that, anything (shell script, binary) executed under it runs as x64 app (Rosetta2 doesn't support 32 bit, in case someone reading this is wondering) - so my response is a simpel no, not a chance that this is an issue of the executable not being run as Intel x64 binary.


Wait...  I just noticed something!

Are you sure your trying to run the MacOS version under Rosetta 2 and not the Windows version?  I’m asking because the error message you posted has a filename in it that ends with .exe, suggesting that it’s a Windows application.  Rosetta 2 doesn’t know how to run Windows applications.  You need to use the MacOS version of DF.

That is what comes w/ the Mac version when downloading and extracting... I was thrown off by that (.exe) too, but as I explained, the game does start, run - up to the point after selecting starting loc and right after loading the world in, w/ above error.
Logged