godex: Unable to build Godot with C# support and Godex

From looking at the Setup and the Compiling with Mono Godot docs page, I ran the following commands to hopefully enable C# support along with Godex:

scons -j8 p=windows target=release_debug tools=yes module_mono_enabled=yes mono_glue=no custom_modules="../godex" mono_prefix="C:\Program Files\Mono"

Glue generation: .\bin\godot.windows.opt.tools.64.mono.exe --generate-mono-glue .\modules\mono\glue

WARNING: The component BtStreamedShape is not trivial copyable
     at: ECS::register_component (C:\Godot\godex\modules\bullet_physics\../../ecs.h:425)
WARNING: The component BtStreamedShape is not trivial destructible
     at: ECS::register_component (C:\Godot\godex\modules\bullet_physics\../../ecs.h:427)
WARNING: The component BtStreamedShape is not trivial copy assignable
     at: ECS::register_component (C:\Godot\godex\modules\bullet_physics\../../ecs.h:429)
WARNING: The component BtStreamedShape is not trivial move assignable
     at: ECS::register_component (C:\Godot\godex\modules\bullet_physics\../../ecs.h:431)
WARNING: The component BtStreamedShape is not trivial move constructible
     at: ECS::register_component (C:\Godot\godex\modules\bullet_physics\../../ecs.h:433)
Component: BtStreamedShape registered with ID: 11
Component: Force registered with ID: 12
Component: Torque registered with ID: 13
Component: Impulse registered with ID: 14
Component: TorqueImpulse registered with ID: 15
SystemBundle: Bullet Physics Base Only registered with ID: 0
System: BtBodyConfig registered with ID: 0
System: BtAreaConfig registered with ID: 1
System: BtApplyForces registered with ID: 2
System: BtSpacesStep registered with ID: 3
System: BtOverlapCheck registered with ID: 4
System: BtBodySync registered with ID: 5
System: BtPawnWalk registered with ID: 6
SystemBundle: Bullet Physics All Features registered with ID: 1
Component: Child registered with ID: 16
Component: Disabled registered with ID: 17
WARNING: The component MeshComponent is not trivial copyable
     at: ECS::register_component (C:\Godot\godex\components\../ecs.h:425)
WARNING: The component MeshComponent is not trivial destructible
     at: ECS::register_component (C:\Godot\godex\components\../ecs.h:427)
WARNING: The component MeshComponent is not trivial copy assignable
     at: ECS::register_component (C:\Godot\godex\components\../ecs.h:429)
WARNING: The component MeshComponent is not trivial move assignable
     at: ECS::register_component (C:\Godot\godex\components\../ecs.h:431)
WARNING: The component MeshComponent is not trivial move constructible
     at: ECS::register_component (C:\Godot\godex\components\../ecs.h:433)
Component: MeshComponent registered with ID: 18
Component: TransformComponent registered with ID: 19
WARNING: The component Shape3DComponent is not trivial copyable
     at: ECS::register_component (C:\Godot\godex\components\../ecs.h:425)
WARNING: The component Shape3DComponent is not trivial destructible
     at: ECS::register_component (C:\Godot\godex\components\../ecs.h:427)
WARNING: The component Shape3DComponent is not trivial copy assignable
     at: ECS::register_component (C:\Godot\godex\components\../ecs.h:429)
WARNING: The component Shape3DComponent is not trivial move assignable
     at: ECS::register_component (C:\Godot\godex\components\../ecs.h:431)
WARNING: The component Shape3DComponent is not trivial move constructible
     at: ECS::register_component (C:\Godot\godex\components\../ecs.h:433)
Component: Shape3DComponent registered with ID: 20
SystemBundle: Rendering 3D registered with ID: 2
System: ScenarioManagerSystem registered with ID: 7
System: MeshUpdaterSystem registered with ID: 8
System: MeshTransformUpdaterSystem registered with ID: 9
Dynamic system: PhysicsSystemDispatcher registered with ID: 10
SystemBundle: Godot Physics registered with ID: 3
System: CallPhysicsProcess registered with ID: 11
System: StepPhysicsServer3D registered with ID: 12
Mono: Log file is: 'C:\Users\yam\AppData\Roaming/Godot/mono/mono_logs/2021-06-10_13.53.17_14676.log'
ERROR: This function should never be used outside the editor, it can severely damage performance.
   at: (servers\rendering\renderer_rd\renderer_storage_rd.cpp:7875)
ERROR: This shared component is not init. So you can't use it.
   at: (C:\Godot\godex\modules\godot\nodes\shared_component_resource.cpp:30)
ERROR: Attempting to use an uninitialized RID
   at: (C:\Godot\godot\core/templates/rid_owner.h:197)
Ignoring type 'Components3DGizmoPlugin' because it's not exposed

I receive the following errors when attempting to build with the glue: scons -j8 p=windows target=release_debug tools=yes module_mono_enabled=yes mono_glue=yes custom_modules="../godex" mono_prefix="C:\Program Files\Mono"

[ 97%] Linking Static Library ==> modules\module_mono.windows.opt.tools.64.lib
[ 97%] 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"], [])
[ 97%] build_godot_net_sdk(["bin\GodotSharp\Tools\nupkgs\Godot.NET.Sdk.4.0.0-dev5.nupkg", "bin\GodotSharp\Tools\nupkgs\Godot.SourceGenerators.4.0.0-dev2.nupkg"], [])
[ 97%] MSBuild path: C:\Program Files\dotnet\dotnet.exe
[ 97%] MSBuild path: C:\Program Files\dotnet\dotnet.exe
[100%] progress_finish(["progress_finish"], [])
[100%] Microsoft (R) Build Engine version 16.10.0+4242f381a for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) Build Engine version 16.10.0+4242f381a for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

[100%]   Determining projects to restore...
  Restored C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharpEditor\GodotSharpEditor.csproj (in 53 ms).
  Restored C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj (in 53 ms).
  Determining projects to restore...
  Restored C:\Godot\godot\modules\mono\editor\Godot.NET.Sdk\Godot.SourceGenerators.Sample\Godot.SourceGenerators.Sample.csproj (in 78 ms).
  Restored C:\Godot\godot\modules\mono\editor\Godot.NET.Sdk\Godot.NET.Sdk\Godot.NET.Sdk.csproj (in 118 ms).
  Restored C:\Godot\godot\modules\mono\editor\Godot.NET.Sdk\Godot.SourceGenerators\Godot.SourceGenerators.csproj (in 125 ms).
  1 of 4 projects are up-to-date for restore.
  Godot.NET.Sdk ->
  Successfully created package 'C:\Godot\godot\modules\mono\editor\Godot.NET.Sdk\Godot.NET.Sdk\bin\Release\Godot.NET.Sdk.4.0.0-dev5.nupkg'.
  Godot.SourceGenerators -> C:\Godot\godot\modules\mono\editor\Godot.NET.Sdk\Godot.SourceGenerators\bin\Release\netstandard2.0\Godot.SourceGenerators.dll
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Array.cs(144,35): error CS0426: The type name 'Array' does not exist in the type 'System' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Array.cs(177,79): error CS0426: The type name 'Array' does not exist in the type 'System' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Array.cs(207,81): error CS0426: The type name 'Array' does not exist in the type 'System' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Array.cs(28,26): error CS0535: 'Array' does not implement interface member 'ICollection.CopyTo(Array, int)' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\Label.cs(77,38): warning CS0108: 'Label.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Dictionary.cs(134,35): error CS0426: The type name 'Array' does not exist in the type 'System' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Dictionary.cs(29,9): error CS0535: 'Dictionary' does not implement interface member 'ICollection.CopyTo(Array, int)' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Attributes\AssemblyHasScriptsAttribute.cs(9,33): error CS0426: The type name 'Type' does not exist in the type 'System' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Attributes\AssemblyHasScriptsAttribute.cs(16,51): error CS0426: The type name 'Type' does not exist in the type 'System' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\LineEdit.cs(428,38): warning CS0108: 'LineEdit.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\ArrayMesh.cs(89,36): warning CS0108: 'ArrayMesh.BlendShapeMode' hides inherited member 'Mesh.BlendShapeMode'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\LinkButton.cs(53,38): warning CS0108: 'LinkButton.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\Button.cs(82,38): warning CS0108: 'Button.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\GLTFAccessor.cs(351,20): warning CS0108: 'GLTFAccessor.GetType()' hides inherited member 'object.GetType()'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\GLTFLight.cs(163,23): warning CS0108: 'GLTFLight.GetType()' hides inherited member 'object.GetType()'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\RichTextLabel.cs(341,38): warning CS0108: 'RichTextLabel.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\TextEdit.cs(188,38): warning CS0108: 'TextEdit.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\GraphNode.cs(54,38): warning CS0108: 'GraphNode.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Array.cs(144,35): error CS0426: The type name 'Array' does not exist in the type 'System' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Array.cs(177,79): error CS0426: The type name 'Array' does not exist in the type 'System' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Array.cs(207,81): error CS0426: The type name 'Array' does not exist in the type 'System' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Array.cs(28,26): error CS0535: 'Array' does not implement interface member 'ICollection.CopyTo(Array, int)' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Dictionary.cs(134,35): error CS0426: The type name 'Array' does not exist in the type 'System' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Dictionary.cs(29,9): error CS0535: 'Dictionary' does not implement interface member 'ICollection.CopyTo(Array, int)' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Attributes\AssemblyHasScriptsAttribute.cs(9,33): error CS0426: The type name 'Type' does not exist in the type 'System' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Core\Attributes\AssemblyHasScriptsAttribute.cs(16,51): error CS0426: The type name 'Type' does not exist in the type 'System' [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\ArrayMesh.cs(89,36): warning CS0108: 'ArrayMesh.BlendShapeMode' hides inherited member 'Mesh.BlendShapeMode'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\Button.cs(82,38): warning CS0108: 'Button.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\GLTFAccessor.cs(351,20): warning CS0108: 'GLTFAccessor.GetType()' hides inherited member 'object.GetType()'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\GLTFLight.cs(163,23): warning CS0108: 'GLTFLight.GetType()' hides inherited member 'object.GetType()'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\Label.cs(77,38): warning CS0108: 'Label.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\GraphNode.cs(54,38): warning CS0108: 'GraphNode.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\LineEdit.cs(428,38): warning CS0108: 'LineEdit.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\LinkButton.cs(53,38): warning CS0108: 'LinkButton.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\RichTextLabel.cs(341,38): warning CS0108: 'RichTextLabel.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\Generated\GodotObjects\TextEdit.cs(188,38): warning CS0108: 'TextEdit.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [C:\Godot\godot\modules\mono\glue\GodotSharp\GodotSharp\GodotSharp.csproj]
C:\Program Files\dotnet\sdk\5.0.300\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5128: Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder do not have exact matches in the other location. Consult the list of actions below: [C:\Godot\godot\modules\mono\editor\Godot.NET.Sdk\Godot.SourceGenerators\Godot.SourceGenerators.csproj]
C:\Program Files\dotnet\sdk\5.0.300\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5128: - Add lib or ref assemblies for the netstandard2.0 target framework [C:\Godot\godot\modules\mono\editor\Godot.NET.Sdk\Godot.SourceGenerators\Godot.SourceGenerators.csproj]
  Successfully created package 'C:\Godot\godot\modules\mono\editor\Godot.NET.Sdk\Godot.SourceGenerators\bin\Release\Godot.SourceGenerators.4.0.0-dev2.nupkg'.
[100%] scons: *** [bin\GodotSharp\Tools\nupkgs\Godot.NET.Sdk.4.0.0-dev5.nupkg] RuntimeError : 'msbuild' exited with error code: 1
Linking Program        ==> bin\godot.windows.opt.tools.64.mono.exe
Traceback (most recent call last):
  File "C:\Godot\godot\modules\mono\build_scripts\solution_builder.py", line 103, in run_command
    subprocess.check_call(args, env=env_override)
  File "c:\program files (x86)\python37-32\lib\subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\Program Files\\dotnet\\dotnet.exe', 'msbuild', 'C:\\Godot\\godot\\modules\\mono\\editor/Godot.NET.Sdk/Godot.NET.Sdk.sln', '/restore', '/t:Build', '/p:Configuration=Release', '/p:GodotPlatform=windows']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files (x86)\python37-32\lib\site-packages\SCons\Action.py", line 1280, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "C:\Godot\godot\modules\mono\build_scripts\godot_net_sdk_build.py", line 20, in build_godot_net_sdk
    build_solution(env, solution_path, build_config, extra_msbuild_args)
  File "C:\Godot\godot\modules\mono\build_scripts\solution_builder.py", line 145, in build_solution
    run_command(msbuild_path, msbuild_args, env_override=msbuild_env, name="msbuild")
  File "C:\Godot\godot\modules\mono\build_scripts\solution_builder.py", line 105, in run_command
    raise RuntimeError("'%s' exited with error code: %s" % (name, e.returncode))
RuntimeError: 'msbuild' exited with error code: 1
scons: *** [bin\GodotSharp\Api\Debug\GodotSharp.dll] RuntimeError : 'msbuild' exited with error code: 1
Traceback (most recent call last):
  File "C:\Godot\godot\modules\mono\build_scripts\solution_builder.py", line 103, in run_command
  erride)
  File "c:\program files (x86)\python37-32\lib\subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\Program Files\\dotnet\\dotnet.exe', 'msbuild', 'C:\\Godot\\godot\\modules\\mono\\glue/GodotSharp/GodotSharp.sln', '/restore', '/t:Build', '/p:Configuration=Debug', '/p:NoWarn=1591']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files (x86)\python37-32\lib\site-packages\SCons\Action.py", line 1280, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "C:\Godot\godot\modules\mono\build_scripts\api_solution_build.py", line 21, in build_api_solution
    build_solution(env, solution_path, build_config, extra_msbuild_args=extra_msbuild_args)
  File "C:\Godot\godot\modules\mono\build_scripts\solution_builder.py", line 145, in build_solution
    run_command(msbuild_path, msbuild_args, env_override=msbuild_env, name="msbuild")
  File "C:\Godot\godot\modules\mono\build_scripts\solution_builder.py", line 105, in run_command
    raise RuntimeError("'%s' exited with error code: %s" % (name, e.returncode))
RuntimeError: 'msbuild' exited with error code: 1
   Creating library bin\godot.windows.opt.tools.64.mono.lib and object bin\godot.windows.opt.tools.64.mono.exp
scons: building terminated because of errors.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 1
  • Comments: 19 (13 by maintainers)

Most upvoted comments

We definitely don’t want to generate a class named System, because it will result in many ambiguity errors. It would be like calling your C++ class std, except C# doesn’t use :: for resolving namespaces, so the compiler can’t know if you want the class or the namespace. Placing that class in a different namespace, may not result in ambiguity errors when compiling the bindings, but it will result in that for whoever is using/importing that namespace.

One option is for the bindings’ generator to just rename System to System_, or SystemClass, or something like that, to remove ambiguity. This is the easiest solution, and it could be implemented right away today.

The other option is to generate a class named GodexSystem. I don’t suppose you want to change the name of the C++ class, so it will require some special handling by the bindings’ generator. Either we add some kind of metadata information in ClassDB that informs that a class can go into the specified namespace, our we hard-code the C# bindings’ generator to rename System to GodexSystem. The latter assumes the class comes from Godex, which may not be the case if there’s another ECS module in the future.

I’ll look into this next Saturday after I’m done with other tasks, and I need to make sure not to break code that assumes class names.

Note: We chatted about this in discord and we contacted the Godot team to have support for that, here the discord chat link: https://discord.com/channels/797456114404163625/797456114404163630/852560754611322930

Great!

FWIW, Godot 4 is in the process of moving off of mono, onto dotnet6. It still uses a similar “generated glue” approach, but it could be different enough/more modern such that it avoids this issue. I’ve been testing out the dotnet6 branch recently but haven’t tried to build godex on it. I’ve no idea if it’ll make a difference, but I’ll give it a go when I can.