From 449d573aabb4df06224bd15ffeb51e7e5d4c9b2e Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Wed, 19 Oct 2022 01:05:06 -0700 Subject: [PATCH] Add Apple Silicon notes --- docs/README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 1785444c..11a8f904 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,7 +14,9 @@ ## Installing TShock -TShock supports any system that .NET 6 supports, except for Apple Silicon. You should be able to run TShock on x86, x86_64, arm32, and arm64 on macOS, Windows, or Linux. TShock has also been used successfully on an unofficial port of TShock to FreeBSD using an unofficial version of .NET 6. Generally, TShock needs at least 1GB of memory, but alternative tile providers may be able to lower the minimum memory threshold. +TShock supports any system that .NET 6 supports. You should be able to run TShock on x86, x86_64, arm32, arm64, and arm64e on macOS, Windows, or Linux. TShock has also been used successfully on FreeBSD, using an unofficial version of .NET. + +Generally, TShock needs at least 1GB of memory, but alternative tile providers may be able to lower the minimum memory threshold. You also need a reasonably powerful computer. Raspberry Pi 4 has been used for very small servers, but in-practice, we suggest something more powerful. 1. If you're on Windows 10 or another operating system, install the [.NET Runtime version 6.x](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) or the .NET SDK 6.x if you're intending to build and develop plugins. If you're on Windows 11 22H2 or later, you probably already have .NET 6 installed. @@ -54,6 +56,28 @@ If you're upgrading from TShock 4, we suggest downloading the new release of TSh In addition, you no longer need to install `mono-complete` or `mono` on non-Windows operating systems. +### Apple Silicon + +On Apple Silicon, you can run TShock using Rosetta 2. This is done by using the `x64` versions of TShock and its associated plugins. Make sure that's the version you download. + +1. **Do not install `dotnet` from homebrew**. Instead, install the [.NET 6 SDK for x86](https://dotnet.microsoft.com/en-us/download). +1. Add the `x64` version of .NET to your path: `export PATH=$PATH:/usr/local/share/dotnet/x64/`. +1. If you haven't already installed, Rosetta 2, run `sudo softwareupdate --install-rosetta --agree-to-license` in your terminal. +1. Run `./TShock.Server` in the terminal. + * If you get a prompt indicating that you can't run `TShock.Server` because Apple can't check it for malicious software, right click on `TShock.Server` in Finder, then select "Open" and then choose Terminal. You will then be prompted to bypass system security. Click "open" on the prompt asking to bypass system security. If you've done this correctly, you can run `TShock.Server` from terminal without needing to do this again. + +If you get an error that looks like this: + +``` +rosetta error: /var/db/oah/2c885558d6a2ecad3098d24447a4071ee679371339e97846cd3d03a3b2bf5ab4/ +b45bd88b435cac41689c907440d5761e7182a4da0cbacaea5b1310d4f7e965d0/TShock.Server.aot: +attachment of code signature supplement failed: 1 +``` + +Try rebooting your Mac, redownloading the server, installing updates, or re-running `softwareupdate --install-rosetta`. + +TShock needs to run under Rosetta 2 because of `W^X` memory protection and other features that aren't yet supported by [MonoMod](https://github.com/MonoMod/MonoMod). There's an [issue on the MonoMod repository about supporting Apple Silicon](https://github.com/MonoMod/MonoMod/issues/90). + ## Experimental downloads To download experimental versions of TShock, you have two real options: AppVeyor builds or GitHub builds. Fair warning though: experimental versions of TShock are point-in-time releases that are not technically supported by us. If you have to report an issue, please make it clear which commit or branch you downloaded your build from, which service, and the build number if applicable.