Fix Run macOs#84
Open
bhrama-br wants to merge 2 commits into
Open
Conversation
Collaborator
|
please change comments to English in the code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue 1 — MGCB failure: "Wine is not installed"
Problem: The MonoGame 3.8.4.x HLSL shader compiler uses Wine on macOS to run fxc.exe (the DirectX compiler). Without Wine installed, all .fx file compilations failed.
Solution: Modified MuMac.csproj to detect the Operating System:
On Windows/CI: Runs MGCB normally (compiling the shaders).
On macOS: Skips MGCB and copies the pre-compiled .xnb files directly from the Client.Main/MGContent/bin/DesktopGL/Content/ folder.
Issue 2 — appsettings.json not found
Problem: Path.GetFullPath("appsettings.json") was resolving relative to the terminal's current working directory (e.g., /Users/bramante/) instead of the executable's directory.
Solution: Replaced with AppContext.BaseDirectory in MuGame.cs, which consistently points to the directory where the executable is located.
Important Note — Missing Shaders
The .xnb files for the .fx shaders (AlphaRGB, FXAA, Shadow, etc.) do not exist yet in the pre-compiled folder. They must be generated at least once on Windows/CI. When the CI runs build-macos (which already executes on windows-latest), the shaders will be compiled. After that, simply commit the generated .xnb files to the repository (the .gitignore has already been configured to track these files).