patrickwieth / YMCA

OpenRA RTS Autobattler
GNU General Public License v3.0
5 stars 2 forks source link

Cannot run on arm64 macOS #5

Open babo4d opened 2 weeks ago

babo4d commented 2 weeks ago

Not working on macOS (M1/arm64). I tried version 0.95.36 ("MacOS version working again") and cannot run the game.

No issues with running other openra mods.

exception_<timestamp>.log:

OpenRA engine version 1a22d86dfdbffa1497c835a9cfafc207eeded3c2
OpenRA Language: en
Date: 2024-08-28 02:53:11Z
Operating System: OSX (Unix 14.6.1)
Runtime Version: .NET CLR 6.0.32
Installed Language: en (Installed) en (Current) en (Current UI)
Exception of type `System.InvalidOperationException`: Failed to initialize platform-integration library. Check graphics.log for details.
   at OpenRA.Game.Initialize(Arguments args) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Game/Game.cs:line 361
   at OpenRA.Game.InitializeAndRun(String[] args) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Game/Game.cs:line 304
   at OpenRA.Launcher.Program.Main(String[] args) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Launcher/Program.cs:line 32

graphics.log:

System.DllNotFoundException: Unable to load shared library 'SDL2' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libSDL2, 0x0001): tried: 'libSDL2' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibSDL2' (no such file), '/usr/lib/libSDL2' (no such file, not in dyld cache), 'libSDL2' (no such file), '/usr/local/lib/libSDL2' (no such file), '/usr/lib/libSDL2' (no such file, not in dyld cache)
   at SDL2.SDL.SDL_Init(UInt32 flags)
   at OpenRA.Platforms.Default.Sdl2PlatformWindow.CanCreateGLWindow(GLProfile profile, List`1 errorLog) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs:line 525
   at OpenRA.Platforms.Default.Sdl2PlatformWindow.<>c__DisplayClass49_0.<.ctor>b__0(GLProfile profile) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs:line 156
   at System.Linq.Enumerable.WhereListIterator`1.ToArray()
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at OpenRA.Platforms.Default.Sdl2PlatformWindow..ctor(Size requestEffectiveWindowSize, WindowMode windowMode, Single scaleModifier, Int32 batchSize, Int32 videoDisplay, GLProfile requestProfile, Boolean enableLegacyGL) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs:line 155
   at OpenRA.Platforms.Default.DefaultPlatform.CreateWindow(Size size, WindowMode windowMode, Single scaleModifier, Int32 batchSize, Int32 videoDisplay, GLProfile profile, Boolean enableLegacyGL) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Platforms.Default/DefaultPlatform.cs:line 21
   at OpenRA.Renderer..ctor(IPlatform platform, GraphicSettings graphicSettings) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Game/Renderer.cs:line 79
   at OpenRA.Game.Initialize(Arguments args) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Game/Game.cs:line 382
System.DllNotFoundException: Unable to load shared library 'SDL2' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libSDL2, 0x0001): tried: 'libSDL2' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibSDL2' (no such file), '/usr/lib/libSDL2' (no such file, not in dyld cache), 'libSDL2' (no such file), '/usr/local/lib/libSDL2' (no such file), '/usr/lib/libSDL2' (no such file, not in dyld cache)
   at SDL2.SDL.SDL_Init(UInt32 flags)
   at OpenRA.Platforms.Default.Sdl2PlatformWindow.CanCreateGLWindow(GLProfile profile, List`1 errorLog) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs:line 525
   at OpenRA.Platforms.Default.Sdl2PlatformWindow.<>c__DisplayClass49_0.<.ctor>b__0(GLProfile profile) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs:line 156
   at System.Linq.Enumerable.WhereListIterator`1.ToArray()
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at OpenRA.Platforms.Default.Sdl2PlatformWindow..ctor(Size requestEffectiveWindowSize, WindowMode windowMode, Single scaleModifier, Int32 batchSize, Int32 videoDisplay, GLProfile requestProfile, Boolean enableLegacyGL) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs:line 155
   at OpenRA.Platforms.Default.DefaultPlatform.CreateWindow(Size size, WindowMode windowMode, Single scaleModifier, Int32 batchSize, Int32 videoDisplay, GLProfile profile, Boolean enableLegacyGL) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Platforms.Default/DefaultPlatform.cs:line 21
   at OpenRA.Renderer..ctor(IPlatform platform, GraphicSettings graphicSettings) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Game/Renderer.cs:line 79
   at OpenRA.Game.Initialize(Arguments args) in /Users/runner/work/YMCA/YMCA/engine/OpenRA.Game/Game.cs:line 382
babo4d commented 2 weeks ago

It is missing the embedded SDL2.dylib for arm64.

> find /Applications/OpenRA\ -\ YMCA.app/Contents -name 'SDL*'
/Applications/OpenRA - YMCA.app/Contents/MacOS/mono/SDL2.dylib
/Applications/OpenRA - YMCA.app/Contents/MacOS/mono/SDL2-CS.dll
/Applications/OpenRA - YMCA.app/Contents/MacOS/mono/SDL2-CS.dll.config
/Applications/OpenRA - YMCA.app/Contents/MacOS/arm64/SDL2-CS.dll
/Applications/OpenRA - YMCA.app/Contents/MacOS/arm64/SDL2-CS.dll.config
/Applications/OpenRA - YMCA.app/Contents/MacOS/x86_64/SDL2.dylib
/Applications/OpenRA - YMCA.app/Contents/MacOS/x86_64/SDL2-CS.dll
/Applications/OpenRA - YMCA.app/Contents/MacOS/x86_64/SDL2-CS.dll.config

It is also missing: lua51.dylib, soft_oal.dylib, freetype6.dylib. After copying these from another openra mod, it works.

patrickwieth commented 5 days ago

Oh thank you for the bug report. I don't understand much of the build pipeline of openRA and I don't have a mac, which makes it hard to test, but I will try to find a solution!