-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile entire project & run server on Linux #995
Conversation
If it should not be merged why not making it a draft? |
@Jannify Because you cannot do so after clicking the button slightly too quickly? (Pedantic much...) Rather, I'm looking for comments/feedback on the changes and suggestions for the TODO items. |
I am also migrating to linux and had some thoughts for linux migration some time ago. At the moment i don't know any elegant way to solve the above problems. Maybe a mono app that just patches, runs the client and unpatches is the best way until we can use Harmony with dotnet. |
This fix is really only to compile and run the server. The launcher is being rewritten in electron at the moment (looks like it will be written in js and call .net to patch and start the game.) Also, unity uses mono for all platforms afaik so there shouldn't be any problems with Harmony. |
Rebased this PR on top of master to solve conflicts, fix more capitalization issues 🙈 and implement a compile-time barrier for NitroxTest and NitroxLauncher. The barrier is simple but cannot be applied to a |
Build-tested on Windows, still works fine. Let the review process commence 😁 |
This looks fine to me although I don't know anything about linux compilation. If you can update then we can merge. |
Capitailization with the vsproj file has to match on case-sensitive file systems/os-es.
VS doesn't seem able to keep these xml files clean and understandable. A followup <PropertyGroup> without conditions sets the OutputType to Library again.
AssetTools-NET is said to handle this properly but it doesn't, so :shrug:
Mono doesn't support WPF
Tests reference Microsoft.VisualStudio.TestTools.UnitTesting which is not available under Mono. Rather than attempting to "rewrite" all tests to use a different framework, disable it for now until someone finds the time and courage to do so.
This reverts commit 8ed0fef618b75b2e57cbb168809a2aab524819da.
Normalize filename capitalization to match the class name, just like ServerProtoBufSerializer.cs.
This file has been recapitalized to match the classname, but the csproj was conveniently forgotten about.
@Sunrunner37 Unfortunately this needs validation on Windows again. Multiple issues and capitalization needed to be fixed even if it was just a few patches behind. I expect Linux building is going to be broken 90% of the time if work persists like this. Referring back to an earlier rant about transitive dependencies not properly including |
The simple solution is obviously to run the tests on Linux as well using GH Actions. Smooth sailing so far (not), the only thing left is making the depot downloader cross-compatible and then everything should work. Let's do that in a different PR though. |
Logging is used in Main() and ConfigureConsoleWindow() before the logger is set up, resulting in a nice NullReferenceException. Reorder the code to ensure we can use it as early as possible without having any sort of CultureInfo issues with formatting.
These patches allow compiling the entire project (currently minus
NitroxTest
andNitroxLauncher
) under Linux usingxbuild
/msbuild
. The server starts just fine but I am unable time-wise to test any client with it.TODO:
NitroxLauncher
NitroxTest
to platform/VS-agnostic test frameworkResources/
capitalization in AssetTools, where I've been told this should be addressed.Note that there'll be loads more fun when Subnautica Experimental drops to stable 😉. Dependency capitalization changed once again, aside a hoist of other changes.
How-to:
This assumes have all the necessary packages installed (
mono
,xbuild
/msbuild
,nuget
) for your favorite distribution. In the cloned folder, run: