Open ghost opened 2 years ago
In addition, I have tried to rebuild godot from sources to make sure it gets built using the versions of the tools on my system. But somehow I am still getting the same error. I followed the steps outlined here: https://docs.godotengine.org/en/stable/development/compiling/compiling_with_mono.html
Using the git branch for 3.4.4-stable, i generated the pre-build binary to generate the mono_glue, generated the mono_glue then recompiled with
scons p=x11 target=release_debug tools=yes module_mono_enabled=yes mono_glue=yes
After this i got this error:
> godot3 -e
Godot Engine v3.4.4.stable.mono.custom_build.419e713a2 - https://godotengine.org
OpenGL ES 3.0 Renderer: GeForce GT 240/PCIe/SSE2
OpenGL ES Batching: ON
Mono: Log file is: '/home/tino/.local/share/godot/mono/mono_logs/2022-05-02_17.34.15_5959.log'
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: /home/tino/3rdpartysoft/godot/bin/GodotSharp/Mono/lib/../lib64/libmono-native.so assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
at Interop+Sys..cctor () [0x00000] in <a6a5ba8fc13a4797a32a4dc4ae25c772>:0
--- End of inner exception stack trace ---
at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <a6a5ba8fc13a4797a32a4dc4ae25c772>:0
at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath) [0x00006] in <a6a5ba8fc13a4797a32a4dc4ae25c772>:0
at System.IO.File.Exists (System.String path) [0x00043] in <a6a5ba8fc13a4797a32a4dc4ae25c772>:0
at GodotTools.Utils.File.Exists (System.String path) [0x00006] in <0daea5da6c9f4eeb9930d3675498733a>:0
at GodotTools.GodotSharpEditor.EnablePlugin () [0x00130] in <0daea5da6c9f4eeb9930d3675498733a>:0
ERROR: System.TypeInitializationException: The type initializer for 'Sys' threw an exception.
at: debug_send_unhandled_exception_error (modules/mono/mono_gd/gd_mono_utils.cpp:369)
During the build, only bin/GodotSharp/Mono/lib was created, no lib64 was created by the build. So I tried symlinking it to /usr/lib64 where the library libmono_native.so resides. After this i got the exact same error as previously mentioned in the opening issue.
After examining the build, i should also mention I get this right after scons starts the build:
> scons p=x11 target=release_debug mono_glue=yes module_mono_enabled=yes tools=yes -j4
scons: Reading SConscript files ...
Checking for `thread_local` support... supported
Mono root directory not found. Using pkg-config instead
Checking for C header file mntent.h... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
[ 0%] build_api_solution(["bin/GodotSharp/Api/Debug/GodotSharp.dll", "bin/GodotSharp/Api/Debug/GodotSharp.pdb", "bin/GodotSharp/Api/Debug/GodotSharp.xml", "bin/GodotSharp/Api/Debug/GodotSharpEditor.dll", "bin/GodotSharp/Api/Debug/GodotSharpEditor.pdb", "bin/GodotSharp/Api/Debug/GodotSharpEditor.xml"], [])
MSBuild path: /usr/bin/dotnet
[ 1%] Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
[ 4%] ^CAttempting to cancel the build...
[ 4%] scons: *** [bin/GodotSharp/Api/Debug/GodotSharp.dll] Build interrupted.
scons: Build interrupted.
scons: building terminated because of errors.
scons: writing .sconsign file.
[Time elapsed: 00:00:06.653]
^C
~/3rdpartysoft/godot
I tried with mono_static=yes and found a strange bug
> scons p=x11 mono_glue=yes module_mono_enabled=yes tools=yes mono_static=yes -j4
scons: Reading SConscript files ...
Checking for `thread_local` support... supported
Found Mono root directory: /usr/lib64/pkgconfig/../../lib64/..
RuntimeError: Could not find mono library in: /usr/lib64/pkgconfig/../../lib64/../lib:
File "/home/tino/3rdpartysoft/godot/SConstruct", line 661:
SConscript("modules/SCsub")
File "/usr/lib/python3.9/site-packages/SCons/Script/SConscript.py", line 660:
return method(*args, **kw)
File "/usr/lib/python3.9/site-packages/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/usr/lib/python3.9/site-packages/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/home/tino/3rdpartysoft/godot/modules/SCsub", line 21:
SConscript(name + "/SCsub") # Built-in.
File "/usr/lib/python3.9/site-packages/SCons/Script/SConscript.py", line 660:
return method(*args, **kw)
File "/usr/lib/python3.9/site-packages/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/usr/lib/python3.9/site-packages/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/home/tino/3rdpartysoft/godot/modules/mono/SCsub", line 34:
mono_configure.configure(env, env_mono)
File "/home/tino/3rdpartysoft/godot/modules/mono/build_scripts/mono_configure.py", line 251:
raise RuntimeError("Could not find mono library in: " + mono_lib_path)
~/3rdpartysoft/godot
I changed a line in modules/mono/build_scripts/mono_configure.py
at line 243
to
mono_lib_path = os.path.join(mono_root, "lib64")
And it finally found my mono library.
Even after pointing the build to my native library, and attempting to build it statically, it still shows me the same error as the opening issue. Its clear to me that symlinking won't solve anything, but without it, godot just searches for non-existent files it didn't create during the build but expects them to be there:
Godot Engine v3.4.4.stable.mono.custom_build.419e713a2 - https://godotengine.org
OpenGL ES 2.0 Renderer: GeForce GT 240/PCIe/SSE2
OpenGL ES Batching: ON
Mono: Log file is: '/home/tino/.local/share/godot/mono/mono_logs/2022-05-02_18.26.48_14477.log'
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: /home/tino/3rdpartysoft/godot/bin/GodotSharp/Mono/lib/../lib64/libmono-native.so assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
at Interop+Sys..cctor () [0x00000] in <a6a5ba8fc13a4797a32a4dc4ae25c772>:0
--- End of inner exception stack trace ---
at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <a6a5ba8fc13a4797a32a4dc4ae25c772>:0
at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath) [0x00006] in <a6a5ba8fc13a4797a32a4dc4ae25c772>:0
at System.IO.File.Exists (System.String path) [0x00043] in <a6a5ba8fc13a4797a32a4dc4ae25c772>:0
at GodotTools.Utils.File.Exists (System.String path) [0x00007] in <2fbd5b7d279040959105492c48f93d40>:0
at GodotTools.GodotSharpEditor.EnablePlugin () [0x00149] in <2fbd5b7d279040959105492c48f93d40>:0
ERROR: System.TypeInitializationException: The type initializer for 'Sys' threw an exception.
at: debug_send_unhandled_exception_error (modules/mono/mono_gd/gd_mono_utils.cpp:369)
This file: /home/tino/3rdpartysoft/godot/bin/GodotSharp/Mono/lib/../lib64/libmono-native.so
doesn't exist and I have no idea why it doesn't get created during the build.
libmono-native.so is not built within Godot, it is obtained from your distribution, in your case it should be /usr/lib64/libmono-native.so.
I don't know yet the reason why it tries to dynamically load from this path but there is a small workaround for it:
Go to bin/GodotSharp/Mono, create lib64 folder and do the symlink inside the folder:
ln -s /usr/lib64/libmono-native.so lib64/libmono-native.so
Should fix it.
Godot version
3.4.4
System information
Linux localhost 5.15.32-gentoo-r1-x86_64 #1 SMP Mon Apr 18 21:16:59 CEST 2022 x86_64 Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz GenuineIntel GNU/Linux
Issue description
I have MSBuild-15.9 installed along with Mono-6.12.0-stable and godot just fails to build any CS file. The message its reporting is basically telling me that my version is either incompatible or I am missing some dependency.
/home/tino/bin/msbuild
is a symlink to/usr/local/bin/msbuild-15.9
I have no clue how to proceed beyond this point. Any pointers would help.
Steps to reproduce
GD.Print("");
somewhereMinimal reproduction project
test.zip