How do you compile Godot with mono in a CI/CD? I can't find many examples -- the modules I could find (godex, sg_physics), omit compiling mono altogether.
Is Godot's own CI/CD for making releases available somewhere?
(EDIT: It looks like Godot users their build-containers repo to build their release builds. Unfortunately it can't be run on github actions because building the dockerfiles takes too long.)
Using Godot's documentation I'm hitting a problem compiling Godot windows, ios, and web builds. For all my compilations I'm using precompiled versions of mono made by the godot-mono-builds repo to compile for every platform. I'm also using Github Actions as my CI/CD.
Here's my repository for reference (I'm attempting to build mono versions of Godot containing snopek games' SGPhysics module): https://github.com/Fractural/SGPhysics2D
For the windows build, I'm running on a windows runner. But when I build, it can't seem to find the mono library -- even though I verified that it was downloaded successfully. I get the following error:
Found Mono root directory: %ProgramFiles%\Mono\desktop-windows-x86_64-release
RuntimeError: Could not find mono library in: %ProgramFiles%\Mono\desktop-windows-x86_64-release\lib:
File "D:\a\SGPhysics2D\SGPhysics2D\SConstruct", line 716:
SConscript("modules/SCsub")
EDIT: The prebuilt mono releases from the godot-mono-builds repo is for linux systems only. After cross compiling windows on ubuntu, I'm getting a new error:
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmini_la-mini-windows.o):(.text+0x2dc): undefined reference to `__imp_timeGetDevCaps'
/usr/bin/x86_64-w64-mingw32-ld: /home/runner/mono-installs/desktop-windows-x86_64-release/lib/libmonosgen-2.0.a(libmini_la-mini-windows.o):(.text+0x334): undefined reference to `__imp_timeSetEvent'
For the iOS build, I'm getting missing files when I bundle them together using lipo.
fatal error: /Applications/Xcode_13.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: bin/libmonosgen-2.0.iphone.arm64.a (No such file or directory)
EDIT: I ran
echo $(basename bin/*)during the bundling step and found out I was building arm instead of arm64, which caused the output to bebin/lipmonosgen-2.0.iphone.arm.a. Right now I'm not sure what the difference is between arm64 and arm, as if I attempt tolipointo onefat.afile, it throws an error saying both have the same architecture ofarm64.
For the web build, I'm running on an ubuntu 20.04 runner. But when I build, it get duplicate symbols, which throws this error:
wasm-ld: error: duplicate symbol: getpwnam_r
>>> defined in /home/runner/mono-installs/wasm-runtime-release/lib/libmonosgen-2.0.a(libmini_la-mini-wasm.o)
>>> defined in /home/runner/work/SGPhysics2D/SGPhysics2D/emsdk-cache/emsdk-main/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libstubs.a(emscripten_libc_stubs.o)
wasm-ld: error: duplicate symbol: getpwuid_r
>>> defined in /home/runner/mono-installs/wasm-runtime-release/lib/libmonosgen-2.0.a(libmini_la-mini-wasm.o)
>>> defined in /home/runner/work/SGPhysics2D/SGPhysics2D/emsdk-cache/emsdk-main/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libstubs.a(emscripten_libc_stubs.o)
wasm-ld: error: duplicate symbol: getgrnam
>>> defined in /home/runner/mono-installs/wasm-runtime-release/lib/libmonosgen-2.0.a(libmini_la-mini-wasm.o)
>>> defined in /home/runner/work/SGPhysics2D/SGPhysics2D/emsdk-cache/emsdk-main/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libstubs.a(emscripten_libc_stubs.o)
wasm-ld: error: duplicate symbol: getgrgid
>>> defined in /home/runner/mono-installs/wasm-runtime-release/lib/libmonosgen-2.0.a(libmini_la-mini-wasm.o)
>>> defined in /home/runner/work/SGPhysics2D/SGPhysics2D/emsdk-cache/emsdk-main/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libstubs.a(emscripten_libc_stubs.o)
wasm-ld: error: duplicate symbol: pthread_sigmask
>>> defined in /home/runner/mono-installs/wasm-runtime-release/lib/libmonosgen-2.0.a(libmini_la-mini-wasm.o)
>>> defined in /home/runner/work/SGPhysics2D/SGPhysics2D/emsdk-cache/emsdk-main/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libc.a(pthread_sigmask.o)
EDIT: This was fixed by using EXACTLY Emscripten 1.39.9. I'm building for Godot 3.x for reference, so this may be different for 4.x.