Skip to content
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

[BUG] - Failure of build on the Linux System #1108

Open
loopyd opened this issue Sep 1, 2024 · 1 comment
Open

[BUG] - Failure of build on the Linux System #1108

loopyd opened this issue Sep 1, 2024 · 1 comment
Labels
CLI Tools Concerning OpenKH.Command.* Documentation Concerning Documents. Enhancement Request for, or a pull request of, a new feature or enhancement to an existing one. GUI Tools Concerning OpenKH.Tools.*

Comments

@loopyd
Copy link

loopyd commented Sep 1, 2024

OpenKH Build
More work is required to get the build working in Linux due to Monogame dependency on XNA framework.

OpenKH Program
Indicates missing XNA framework -- Cannot work in Mono as project files specify:

  System.NotImplementedException: The method or operation is not implemented.
    at Microsoft.Xna.Framework.Content.Pipeline.Processors.EffectProcessor.Process (Microsoft.Xna.Framework.Content.Pipeline.Graphics.EffectContent input, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context) [0x00000] in <69d3b57a271142a786440f6e2203a8c6>:0 
    at Microsoft.Xna.Framework.Content.Pipeline.ContentProcessor`2[TInput,TOutput].Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process (System.Object input, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context) [0x0002f] in <69d3b57a271142a786440f6e2203a8c6>:0 
    at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent (MonoGame.Framework.Content.Pipeline.Builder.PipelineBuildEvent pipelineEvent) [0x00146] in <69d3b57a271142a786440f6e2203a8c6>:0 
/home/saber7ooth/.nuget/packages/monogame.content.builder/3.7.0.9/build/MonoGame.Content.Builder.targets(73,5): error MSB3073: The command "mono "/home/saber7ooth/.nuget/packages/monogame.content.builder/3.7.0.9/tasks/netstandard2.0/../../build/MGCB/build/MGCB.exe" /@:"/home/saber7ooth/Documents/repos/OpenKh/OpenKh.Game/Content/Content.mgcb" /platform:DesktopGL /quiet /outputDir:"bin/DesktopGL/Content" /intermediateDir:"obj/DesktopGL/Content"" exited with code 1. [/home/saber7ooth/Documents/repos/OpenKh/OpenKh.Game/OpenKh.Game.csproj]
  OpenKh.Command.ImgTool -> /home/saber7ooth/Documents/repos/OpenKh/OpenKh.Command.ImgTool/bin/Release/net6.0/OpenKh.Command.ImgTool.dll
/home/saber7ooth/Documents/repos/OpenKh/OpenKh.Game/Content/KingdomShader.fx : error : Processor 'EffectProcessor' had unexpected failure! [/home/saber7ooth/Documents/repos/OpenKh/OpenKh.Game/OpenKh.Game.csproj]
  System.NotImplementedException: The method or operation is not implemented.
    at Microsoft.Xna.Framework.Content.Pipeline.Processors.EffectProcessor.Process (Microsoft.Xna.Framework.Content.Pipeline.Graphics.EffectContent input, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context) [0x00000] in <69d3b57a271142a786440f6e2203a8c6>:0 
    at Microsoft.Xna.Framework.Content.Pipeline.ContentProcessor`2[TInput,TOutput].Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process (System.Object input, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context) [0x0002f] in <69d3b57a271142a786440f6e2203a8c6>:0 
    at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent (MonoGame.Framework.Content.Pipeline.Builder.PipelineBuildEvent pipelineEvent) [0x00146] in <69d3b57a271142a786440f6e2203a8c6>:0 
/home/saber7ooth/.nuget/packages/monogame.content.builder/3.7.0.9/build/MonoGame.Content.Builder.targets(73,5): error MSB3073: The command "mono "/home/saber7ooth/.nuget/packages/monogame.content.builder/3.7.0.9/tasks/netstandard2.0/../../build/MGCB/build/MGCB.exe" /@:"/home/saber7ooth/Documents/repos/OpenKh/OpenKh.Game/Content/Content.mgcb" /platform:DesktopGL /quiet /outputDir:"bin/DesktopGL/Content" /intermediateDir:"obj/DesktopGL/Content"" exited with code 1. [/home/saber7ooth/Documents/repos/OpenKh/OpenKh.Game/OpenKh.Game.csproj]

Describe the Bug

Build script on Linux uses mono, but mono is incompatible with XNA framework / MonoGame. Must use wine prefix or Windows VM (defeats the purpose of advertising proper Linux support) to successfully build game assets. For example, can use Linux version of MonoGame to build game assets, THEN cross compile with Linux version of .net.

i.e.: If you need to run in Wine prefix with XNA framework and MonoGame installed via nuget with SDKs intact to build with Monogame, this is not native Linux support. Its Linux support via wine.

To Reproduce
Steps to reproduce the behavior:

git clone 'https://github.com/OpenKH/OpenKh.git' --recursive
cd OpenKh/
chmod +x ./build.sh
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x ./dotnet-install.sh

# Install .net SDKs
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
./dotnet-install.sh --version latest
./dotnet-install.sh --channel 6.0
rm -f ./dotnet-install.sh

# Install mono runtime (ubuntu) and all assemblies
sudo apt-get install libmono-*4.0-cil mono-runtime -y

# Build
./build.sh

Expected behavior
Alternative solution configuration selected that averts MonoGame inclusion and thus will allow you to run OpenKH natively on Linux.

-or-

Sets up a wine prefix the right way using winetricks, and builds in it.

-or-

Builds inside of a Windows compatible Dockerfile.

Additional context
If anything make documentation more clear about support Linux. Its support Linux via wine *. The script does not look for wine, use winetricks to create a proper prefix for building, etc. I feel that it should due to its dependency on XNA framework via MonoGame which does require wine, not mono.

I suggest dedicated guide for Linux as it requires additional setup via a wine prefix to resolve this bug.

@OpenKH OpenKH deleted a comment Sep 2, 2024
@OpenKH OpenKH deleted a comment Sep 2, 2024
@Vladabdf Vladabdf added Enhancement Request for, or a pull request of, a new feature or enhancement to an existing one. GUI Tools Concerning OpenKH.Tools.* CLI Tools Concerning OpenKH.Command.* Documentation Concerning Documents. labels Sep 10, 2024
@Vladabdf
Copy link
Collaborator

Vladabdf commented Sep 10, 2024

Additional context
If anything make documentation more clear about support Linux. Its support Linux via wine *. The script does not look for wine, use winetricks to create a proper prefix for building, etc. I feel that it should due to its dependency on XNA framework via MonoGame which does require wine, not mono.

Where is it unclear? The readme distinctly says GUI programs may require WINE to work under Linux, BSD, Mac, etc., whereas CLI programs have historically compiled and run just fine. I was able to compile everything using the shell script on three separate Linux installs across three separate sets of hardware:

  • My Steam Deck
  • My laptop running MX Linux
  • My previous dual-boot setup on my desktop running Zorin

My setup also involved simply installing WINE and installing the appropriate .NET runtime to the default prefix, and then running the programs as normal. That being said, I would appreciate knowing where it is being misrepresented that OpenKH works "natively" across other platforms, as implied in your bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Tools Concerning OpenKH.Command.* Documentation Concerning Documents. Enhancement Request for, or a pull request of, a new feature or enhancement to an existing one. GUI Tools Concerning OpenKH.Tools.*
Projects
None yet
Development

No branches or pull requests

2 participants