ArchiSteamFarm icon indicating copy to clipboard operation
ArchiSteamFarm copied to clipboard

osx-arm64 build doesn't work

Open purpose-pending opened this issue 4 years ago • 4 comments

Checklist

ASF version

Latest stable release

ASF variant

osx-arm64

Bug description

I've tried using osx-arm64 build of ASF and it doesn't work on M1 MacBook Air, macOS Monterey Version 12.1.

Expected behavior

After installing prerequisite dotnet - I expected to be able to run osx-arm64 version same way I'm able to run osx-x64 version - ./ArchiSteamFarm. But osx-arm64 doesn't work, only osx-x64 build work via Rosetta.

Actual behavior

After running - it immediately gets killed.

./ArchiSteamFarm
[1]    7545 killed     ./ArchiSteamFarm

Adding debug flag didn't help, it instantly gets killed without printing any useful logs.

Steps to reproduce

  • Download V5.2.0.10 ASF-osx-arm64.zip release.
  • Download Microsoft.NETCore.App 6.0.1 runtime
  • Try to run ArchiSteamFarm- get warning about macOS not allowing to run unsecure apps - allow running apps downloaded from Github via System Preferences.
  • Try to run again - error happens.

Possible reason/solution

No response

Can you help us with this bug report?

Somehow, I can test and offer feedback, but can't code

Full log.txt recorded during reproducing the problem

./ArchiSteamFarm
[1]    7545 killed     ./ArchiSteamFarm


### Global ASF.json config file

```json
{
  "Statistics": false,
  "SteamOwnerID": 76561198146189450,
  "debug": true
}

BotName.json config of all affected bot instances

No response

Additional info

I tried fresh downloading osx-x64 build - similar thing happens.
First run:

./ArchiSteamFarm
[1]    7169 killed     ./ArchiSteamFarm

But after allowing to run apps from downloaded from Github - on second run osx-x64 build starts nornally:

./ArchiSteamFarm
2021-12-19 11:46:05|ArchiSteamFarm-7192|INFO|ASF|InitCore() ArchiSteamFarm V5.2.0.10 (osx-x64/c7e50c31-4ae6-4a53-bfa3-f6018e5ff3f6 | .NET 6.0.0-rtm.21522.10; osx.11.1-x64; Darwin 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101)
2021-12-19 11:46:05|ArchiSteamFarm-7192|INFO|ASF|InitCore() Copyright © 2015-2021 JustArchiNET
2021-12-19 11:46:06|ArchiSteamFarm-7192|INFO|ASF|InitPlugins() Initializing Plugins...
2021-12-19 11:46:06|ArchiSteamFarm-7192|INFO|ASF|InitPlugins() Loading SteamTokenDumperPlugin V5.2.0.10...
2021-12-19 11:46:06|ArchiSteamFarm-7192|INFO|ASF|InitPlugins() SteamTokenDumperPlugin has been loaded successfully!
2021-12-19 11:46:06|ArchiSteamFarm-7192|INFO|ASF|UpdateAndRestart() ASF will automatically check for new versions every 1 day.
2021-12-19 11:46:06|ArchiSteamFarm-7192|INFO|ASF|Update() Checking for new version...
2021-12-19 11:46:07|ArchiSteamFarm-7192|INFO|ASF|Update() Local version: 5.2.0.10 | Remote version: 5.2.0.10
2021-12-19 11:46:07|ArchiSteamFarm-7192|INFO|ASF|OnASFInit() SteamTokenDumperPlugin is currently disabled according to your configuration. If you'd like to help SteamDB in data submission, please check out our wiki.
2021-12-19 11:46:07|ArchiSteamFarm-7192|INFO|ASF|StartInteractiveConsole() Interactive console is now active, type 'c' in order to enter command mode.
2021-12-19 11:46:07|ArchiSteamFarm-7192|INFO|ASF|Start() Starting IPC s
......

But osx-arm64 build just get killed every time I try to run, even after allowing it. That's strange.

purpose-pending avatar Dec 19 '21 10:12 purpose-pending

I'm not OS X expert, neither I have any machine to try it on, so chance is I won't be able to help much, but we can always try.

osx-arm64 is a new toy in the arsenal of .NET, it's possible that it doesn't work yet as good as it should, and therefore would need some kind of special treatment.

I've created 4 test builds for you:

  • single-file + trim, this is original ASF build, try it to ensure that requirements didn't change and it still doesn't work.
  • trim, this one has only trimming enabled.
  • single-file, this has only single file enabled.
  • neither, this is the most compatible OS-specific build, if that doesn't work there is not much else we can do.

Let me know which of the builds worked for you, and which did not. Thanks!

JustArchi avatar Dec 19 '21 11:12 JustArchi

So, I did some testing, found out this: First of all - none of the builds work straight out . And Console tool says reason isn't the software itself per se:

  • single-file + trim, this is original ASF build, try it to ensure that requirements didn't change and it still doesn't work.
Process: 
Kernel 
Message: 
ASP: Security policy would not allow process: 8682, /Users/velfess/Downloads/ZTf2/ArchiSteamFarm
  • trim, this one has only trimming enabled.
Process: 
Kernel 
Message: 
ASP: Security policy would not allow process: 8807, /Users/velfess/Downloads/uY-B/ArchiSteamFarm
Process: 
Kernel 
Message: 
ASP: Security policy would not allow process: 8840, /Users/velfess/Downloads/SQew/ArchiSteamFarm
  • neither, this is the most compatible OS-specific build, if that doesn't work there is not much else we can do.
Process: 
Kernel 
Message: 
ASP: Security policy would not allow process: 8650, /Users/velfess/Downloads/Wgl-/ArchiSteamFarm

That's strange behaviour, since indeed running application is instantly blocked, but I explicitly allow it to run -> it asks again if I would like to run -> but OS still blocks even after explicitly allowing it, twice. Screenshot 2021-12-19 at 13 55 13

Screenshot 2021-12-19 at 13 55 33 Screenshot 2021-12-19 at 13 55 51

For some reason x86 application "don't get same treatment" - one has to simply allow it once - and x86 build works just fine. But it seems Apple is blocking arm64 applications from unknown developers even after manually allowing them to run.

Did a bit of digging - one can disable System Integrity Protection from recovery mode.
After disabling SIP and rebooting - arm64 builds started working. Launches without problems, WEB-UI works also fine.
So for now it's walkaround for anyone who isn't afraid of Failure to reenable SIP when you are done testing leaves your computer vulnerable to malicious code. warning message.

As for why it's happening in first place - can't help with that, I'm relatively new to macOS. From what I understand ASP - AppleSystemPolicy - on new versions of macOS blocks everything what isn't somehow signed.. Thanks for the help figuring out the problem!

purpose-pending avatar Dec 19 '21 12:12 purpose-pending

Thanks for very helpful information. If by any chance somebody isn't willing to disable additional security, he should be able to install .NET SDK for osx-arm64 and run ASF's generic variant just fine taking advantage of arm64 instructions inside. Unfortunately, when dealing with OS-specific packages, I must produce native code which to the best of my knowledge can't be signed easily to allow builds on macOS to "just run". Thanks for confirming that osx-arm64 builds work fine on your machine, this proves there is no issue on ASF part in regards to that, but obviously the builds can't run right away due to security policy.

Due to the fact that I don't see anything I could do to improve ASF further in this regard, I'll close the issue.

JustArchi avatar Dec 19 '21 13:12 JustArchi

I'm having trouble using the arm64 build too. Just an additional info, the exit code of the build is 137 (out of memory) image

jackblk avatar Dec 22 '21 03:12 jackblk