RhubarbVR / RhubarbVR_Old

GNU General Public License v3.0
13 stars 5 forks source link

Linux support + build instructions #37

Closed iamgreaser closed 2 years ago

iamgreaser commented 3 years ago

Apparently I'm the first person to actually put this one particular request in.

Is your feature request related to a problem? Please describe. This doesn't appear to build on Linux, and the build docs appear to be incomplete.

Describe the solution you'd like I'd like to be able to build and run this on Linux, and also have some basic build instructions that have a chance of getting intended build results out of them.

This request needs to pass the "Works On My Machine" test for at least one machine. Personally I don't care if this doesn't support VR as I don't have a VR headset, but if it does end up working then that will be a big plus.

So far the build instructions stop past installing the Net5 SDK. Now, I'm guessing step 4 is probably dotnet build RhubarbVR.sln, but here's what happens:

[ben@flamethrower RhubarbVR]$ dotnet build RhubarbVR.sln 
Microsoft (R) Build Engine version 16.10.1+2fd48ab73 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
/home/ben/Downloads/libs/dotnet/sdk/5.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(63,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/ben/Downloads/gamez/RhubarbVR/RhubarbVRLauncher/RhubarbVRLauncher.csproj]

Build FAILED.

/home/ben/Downloads/libs/dotnet/sdk/5.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(63,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/ben/Downloads/gamez/RhubarbVR/RhubarbVRLauncher/RhubarbVRLauncher.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.72
[ben@flamethrower RhubarbVR]$

This may merely be a project configuration issue.

Describe alternatives you've considered Fumbling around with .NET in Wine.

Faolan-Rad commented 3 years ago

I am going through and trying to get it squared away at the moment

iamgreaser commented 3 years ago

Thanks for filling in the instructions, here's the next part where it gets stuck:

[ben@flamethrower RhubarbVR]$ dotnet build RhubarbVR --no-restore /p:Platform=x64
Microsoft (R) Build Engine version 16.10.1+2fd48ab73 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Numerics -> /home/ben/Downloads/gamez/RhubarbVR/Numerics/bin/x64/Debug/net5.0/Numerics.dll
  SteamAudio.NET -> /home/ben/Downloads/gamez/RhubarbVR/SteamAudio.NET/bin/x64/Debug/net5.0/SteamAudio.NET.dll
  RhubarbCloudApi -> /home/ben/Downloads/gamez/RhubarbVR/RhubarbCloudApi/bin/x64/Debug/net5.0/RhubarbCloudApi.dll
/home/ben/.nuget/packages/nerdbank.gitversioning/3.3.37/build/Nerdbank.GitVersioning.Inner.targets(17,5): error MSB4018: The "Nerdbank.GitVersioning.Tasks.GetBuildVersion" task failed unexpectedly.
/home/ben/.nuget/packages/nerdbank.gitversioning/3.3.37/build/Nerdbank.GitVersioning.Inner.targets(17,5): error MSB4018: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
/home/ben/.nuget/packages/nerdbank.gitversioning/3.3.37/build/Nerdbank.GitVersioning.Inner.targets(17,5): error MSB4018:  ---> System.PlatformNotSupportedException: void-x64

I'm not sure if the complaint is due to the fact that I'm using Void Linux, but it does seem to be based on the one search result I could find, which is from late 2020: https://gitter.im/dotnet/Nerdbank.GitVersioning?at=5f9c3201bf955735eb4bdf9f

Which one would think this is the library to blame: https://github.com/dotnet/Nerdbank.GitVersioning

And then one looks at this: https://github.com/libgit2/libgit2sharp/

And now I want to punch whoever thought that splitting things up based on Linux distro was a good idea.

And looking at libgit2sharp, there's nothing indicating that that is to blame based on how the library loading works, so we're back to the Nerdbank library.

RuntimeIdMap doesn't appear anywhere there, so...

... oh look, the offending pile of flaming garbage was removed back in November 2020: https://github.com/dotnet/Nerdbank.GitVersioning/commit/0544144625415d229f534a34f056bd6ded625fa3

And it's in a bunch of 3.4 versions.

So the insistence of using the quite frankly broken version of 3.3.37 is due to Veldrid. But Veldrid does appear to be sticking to a >= 3.3.37 constraint, and assuming that SemVer is being used, it may be happy with v3.4.

What would it take to force using at the very least v3.4 of Nerdbank.GitVersioning while Veldrid currently doesn't use it? v3.4.190 seems to be the earliest release version we can use.

Faolan-Rad commented 3 years ago

At the current moment rhubarb doesn't really want to run on Linux do to cefsharp not being compatible

iamgreaser commented 3 years ago

Ah damn.

I pushed a bit harder last night and got it to build and run to the point where there was a stack overflow in what looked like OpenAL:

Stack overflow.
   at RhubarbEngine.Managers.AudioManager.OpenALUpdate()
   at RhubarbEngine.Managers.AudioManager.OpenALUpdater()
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()

I'll leave it at that for now. Thanks for having a go at it anyway.

Faolan-Rad commented 3 years ago

Are you running the Lastest master because it seems that issue should have already been fixed one of the last commits

iamgreaser commented 3 years ago

Was one commit behind latest at the time of writing. Updating and rebuilding still gives me the apparently-OpenAL-related stack overflow.

There are some issues with path separators using backslashes instead of forwardslashes. This results in a fair bit of crapping up of directories. That will need to be resolved for this to be practical on Linux. I'm somewhat tempted to get a PR in to clean this up so I don't end up with a file called .config\RhubarbVR\locker.lock in my home directory (yes, that's the full filename directly placed into home).

Faolan-Rad commented 2 years ago

The Linux builds and the docs are okay to instruct you on how to compile

iamgreaser commented 2 years ago

Updating a bit on this, on my machine it actually works as long as it fails to actually use OpenAL and therefore no sound ends up happening or something like that.

Faolan-Rad commented 2 years ago

I am redoing the audio so that issue should be fixed