godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.85k stars 20.15k forks source link

Mono: mscorlib.dll.so not found #37906

Open TheKetrab opened 4 years ago

TheKetrab commented 4 years ago

Hello,

I have a problem with generating mono glue. With running command: bin/godot.linuxbsd.tools.64.mono --generate-mono-glue modules/mono/glue I get an error:

ERROR: Condition "!valid" is true. returned: false at: _populate_object_type_interfaces (modules/mono/editor/bindings_generator.cpp:2401)

Here is the log:

Config attempting to parse: '/etc/mono/config'. (in domain Mono, info)
Config attempting to parse: '/home/bartlomiej/.mono/config'. (in domain Mono, info)
Image addref mscorlib[0x91c3c30] (asmctx DEFAULT) -> /usr/lib/mono/4.5/mscorlib.dll[0x91c2780]: 2 (in domain Mono, info)
Prepared to set up assembly 'mscorlib' (/usr/lib/mono/4.5/mscorlib.dll) (in domain Mono, info)
AOT: image '/usr/lib/mono/4.5/mscorlib.dll.so' not found: /usr/lib/mono/4.5/mscorlib.dll.so: cannot open shared object file: No such file or directory (in domain Mono, info)
AOT: module (null) is unusable: not compiled for debugging. (in domain Mono, info)
Assembly mscorlib[0x91c3c30] added to domain GodotEngine.RootDomain, ref_count=1 (in domain Mono, info)
Assembly mscorlib[0x91c3c30] added to domain GodotEngine.Domain.Scripts, ref_count=2 (in domain Mono, info)

Mono version: Mono JIT compiler version 6.8.0.105 (tarball Tue Feb 4 21:20:20 UTC 2020)

  1. In /usr/lib/mono/4.5/ is only mscorlib.dll file.
  2. mscorlib.dll.so is in /usr/lib/mono/aot-cache/amd64/ directory.
  3. I tried to move the file from amd64 dir to 4.5 dir, but then I got another error:
Config attempting to parse: '/etc/mono/config'. (in domain Mono, info)
Config attempting to parse: '/home/bartlomiej/.mono/config'. (in domain Mono, info)
Image addref mscorlib[0x7d0fdf0] (asmctx DEFAULT) -> /usr/lib/mono/4.5/mscorlib.dll[0x7d0e940]: 2 (in domain Mono, info)
Prepared to set up assembly 'mscorlib' (/usr/lib/mono/4.5/mscorlib.dll) (in domain Mono, info)
AOT: module /usr/lib/mono/4.5/mscorlib.dll.so is unusable: not compiled for debugging. (in domain Mono, info)
Assembly mscorlib[0x7d0fdf0] added to domain GodotEngine.RootDomain, ref_count=1 (in domain Mono, info)
Assembly mscorlib[0x7d0fdf0] added to domain GodotEngine.Domain.Scripts, ref_count=2 (in domain Mono, info)

I thought it was because of 'garbage' after previous Mono version. I totally removed Mono (apt purge) and removed directories /usr/lib/mono & /etc/lib/mono. Then installed Mono again using https://www.mono-project.com/download/stable/

After couple hours I have no idea what else can I do to fix it. Does anyone know?

default-kramer commented 2 years ago

I believe that I'm seeing the same issue while trying to use the Mono Headless binary to build inside Docker. My mono logs contain similar messages about mscorlib.dll.so going missing. The message that appears at the CLI is "ERROR: Failed to export project: Failed to build project at: godot_icall_GD_pusherror (modules/mono/glue/gd_glue.cpp:249)". More complete CLI output is:

root@b7e209a2660b:/ff2# godot ./godot/project.godot --export "HTML5"
Godot Engine v3.4.4.stable.mono.official.419e713a2 - https://godotengine.org

Mono: Log file is: '/root/.local/share/godot/mono/mono_logs/2022-06-18_22.41.56_17.log'
mono_project_debug_build: begin: Building project solution... steps: 1
        mono_project_debug_build: step 0: Building project solution
mono_project_debug_build: end
ERROR: Failed to export project: Failed to build project
   at: godot_icall_GD_pusherror (modules/mono/glue/gd_glue.cpp:249)
System.Exception: Failed to build project
  at GodotTools.Export.ExportPlugin._ExportBeginImpl (System.String[] features, System.Boolean isDebug, System.String path, System.Int32 flags) [0x0007e] in <cf61cc81be674d2a9f24e0a47c139a44>:0
  at GodotTools.Export.ExportPlugin._ExportBegin (System.String[] features, System.Boolean isDebug, System.String path, System.Int32 flags) [0x0000b] in <cf61cc81be674d2a9f24e0a47c139a44>:0
savepack: begin: <... truncated ...>
savepack: end
raulsntos commented 2 years ago

@TheKetrab Since this is an old issue you may not have this issue anymore, can you still reproduce it in a more recent version of the engine? Also, since you are compiling the engine you should add the commit you are compiling from.

You also mention you are using Mono version 6.8, we currently use 6.12 to build the engine so an older version probably won't work.


@default-kramer Your error doesn't seem related to me, I can't see any mention of mscorlib.dll.so in the error log you provided. You should probably open a separate issue and fill the issue template.

What I can tell you from the error log is that the C# ExportPlugin is throwing an exception which could be due to many reasons so I'd recommend you to read the Mono log file in the path specified in the error log (/root/.local/share/godot/mono/mono_logs/2022-06-18_22.41.56_17.log) which may contain more detailed information about what went wrong.

However, when a project fails to export is usually because the C# project does not compile so also try exporting the game using the non-headless version of the engine if you can which will open error dialogs that may be more useful.

default-kramer commented 2 years ago

@raulsntos Sorry, I didn't include the mono log in my first post. Here is an excerpt from it:

root@dbcc163a3192:/ff2/godot# cat /root/.local/share/godot/mono/mono_logs/2022-06-18_23.49.17_16.log
Config attempting to parse: '/usr/local/bin/GodotSharp/Mono/etc/mono/config'. (in domain Mono, info)
Config attempting to parse: '/root/.mono/config'. (in domain Mono, info)
Image addref mscorlib[0x7bfbca0] (asmctx DEFAULT) -> /usr/local/bin/GodotSharp/Mono/lib/mono/4.5/mscorlib.dll[0x7bfa910]: 2 (in domain Mono, info)
Prepared to set up assembly 'mscorlib' (/usr/local/bin/GodotSharp/Mono/lib/mono/4.5/mscorlib.dll) (in domain Mono, info)
AOT: image '/usr/local/bin/GodotSharp/Mono/lib/mono/4.5/mscorlib.dll.so' not found: /usr/local/bin/GodotSharp/Mono/lib/mono/4.5/mscorlib.dll.so: cannot open shared object file: No such file or directory (in domain Mono, info)
AOT: image '/usr/local/bin/GodotSharp/Mono/lib/mono/aot-cache/amd64/mscorlib.dll.so' not found: /usr/local/bin/GodotSharp/Mono/lib/mono/aot-cache/amd64/mscorlib.dll.so: cannot open shared object file: No such file or directory (in domain Mono, info)
Assembly mscorlib[0x7bfbca0] added to domain GodotEngine.RootDomain, ref_count=1 (in domain Mono, info)
Assembly mscorlib[0x7bfbca0] added to domain GodotEngine.Domain.Scripts, ref_count=2 (in domain Mono, info)
Image addref GodotSharp[0x831ada0] (asmctx DEFAULT) -> /ff2/godot/.mono/assemblies/Debug/GodotSharp.dll[0x7ca5e00]: 2 (in domain Mono, info)
Prepared to set up assembly 'GodotSharp' (/ff2/godot/.mono/assemblies/Debug/GodotSharp.dll) (in domain Mono, info)
Assembly GodotSharp[0x831ada0] added to domain GodotEngine.Domain.Scripts, ref_count=1 (in domain Mono, info)

<... truncated, available on request ...>

Same as the OP, the file mscorlib.dll does exist, but mscorlib.dll.so does not.

raulsntos commented 2 years ago

I still feel like your issue is different since he's trying to compile the engine and you are trying to export a game project. Also, even though OP didn't specify I feel like they are using a commit of the master branch (which will be Godot 4.0) since they specified the name of the Godot binary is godot.**linuxbsd**.tools.64.mono (and in 3.x it would have been godot.**x11**.tools.64.mono). From your error log I know you are using 3.4.4 and given the many differences between the 3.x branch and the master branch I feel like it'd be better if you reported your issue separately.


Aside from that, after looking more closely to both of your mono logs it seems Godot actually does find the mscorlib assembly for both of you since the assembly is added to the engine's domain, Godot is simply trying to look for the mscorlib assembly using various paths (and if I remember correctly it tries both mscorlib.dll and mscorlib.dll.so) so it seems it eventually finds it after two tries.

The issue OP is having has to do with the C# bindings generator which is implemented in C++ and now I'm sure the issue is unrelated to yours since that C++ code will never be executed in your case.

default-kramer commented 2 years ago

@raulsntos Thanks, I believe you are correct that the message about the missing mscorlib.dll.so is not actually a problem. I just saw it in my log, wondered if it was a problem, found this issue via Google, and jumped to a conclusion. I will do more investigation and open a new issue if needed.