Closed GlitchedCode closed 2 years ago
Is this issue reproducible in official Godot builds? No.
Are you sure about this? The provided log doesn't contain any Goost classes. Could you share the full log?
This may be a regression in Godot.
Note that I no longer provide Mono builds officially. However, contributions to fix Mono-related bugs are welcomed.
I often rebase my fork (which does not touch Mono support) with the latest additions to Godot's 3.x
branch, and it builds fine with Mono support. Building Godot with the same scons arguments works fine.
build.log
@GlitchedCode do you use other modules in your custom Godot build (beside Goost)? Without actually testing this myself yet, I don't see how compiling Godot + Goost could lead to this kind of problem to be honest.
Clone Goost and symlink custom godot source tree inside Goost local repository.
Instead of symlink, you could specify GODOT_SOURCE_PATH
environment variable.
You may try to build from within Godot root instead (build Godot + Goost via custom_modules
option). I'd actually recommend to build this way for production, especially if you plan to build Godot with other modules.
Thank you for pointing me to more resources, i tried out a few more times and, sadly, building from godot's source tree using custom_modules
i get the same result from above, though i am now noticing the following errors are thrown when i try to generate the glue after the first build.
ERROR: Condition "getter->return_type.cname != setter->arguments.back()->get().type.cname" is true. Returned: ERR_BUG
at: _generate_cs_property (modules/mono/editor/bindings_generator.cpp:1419)
ERROR: Failed to generate property 'format' for class 'MidiFile'.
at: _generate_cs_type (modules/mono/editor/bindings_generator.cpp:1290)
ERROR: Generation of the Core API C# project failed.
at: generate_cs_api (modules/mono/editor/bindings_generator.cpp:1110)
ERROR: --generate-mono-glue: Failed to generate the C# API.
at: handle_cmdline_options (modules/mono
And yes, Goost is the only module i'm adding to Godot in this build.
CC @filipworksdev, looks like MidiFile
has inconsistent return type somewhere which fails C# Mono glue generation.
@GlitchedCode If this only affects MidiFile
and you're not interested in it, as a workaround you could try to compile Goost without audio component for now (both when building with and without Mono glue):
scons goost_audio_enabled=no
I could fix this myself but given Russia's invasion in Ukraine, it's difficult for me to do any kind of development at the moment, but I'll likely fix this issue myself eventually after Godot 3.5 is released.
Ahh sorry guys I don't do any Mono whatsoever. Someone who does Mono would need to fix this. I have completely dropped Mono from my custom build.
The changes in my PR fix the aforementioned issue, but there is an additional problem with these errors being thrown during the final step of a Mono build
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(188,73): error CS1503: Argomento 2: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(188,77): error CS1503: Argomento 3: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(216,73): error CS1503: Argomento 2: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(216,77): error CS1503: Argomento 3: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(231,73): error CS1503: Argomento 2: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(231,77): error CS1503: Argomento 3: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(245,73): error CS1503: Argomento 2: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(245,77): error CS1503: Argomento 3: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(263,73): error CS1503: Argomento 2: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(263,77): error CS1503: Argomento 3: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(279,73): error CS1503: Argomento 2: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(279,77): error CS1503: Argomento 3: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(295,73): error CS1503: Argomento 2: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Debug2D.cs(295,77): error CS1503: Argomento 3: non è possibile convertire da 'double' a 'float' [/home/glitchedcode/repos/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
Which are caused by the way Godot's code generation algorithm generates the glue, passing double constants (the default in C#) to Color's constructor which accepts floats. This can be worked around by adding the following constructor to the Color class in godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
:
/// <summary>
/// Constructs a <see cref="Color"/> from RGBA values, typically on the range of 0 to 1.
/// </summary>
/// <param name="r">The color's red component, typically on the range of 0 to 1.</param>
/// <param name="g">The color's green component, typically on the range of 0 to 1.</param>
/// <param name="b">The color's blue component, typically on the range of 0 to 1.</param>
/// <param name="a">The color's alpha (transparency) value, typically on the range of 0 to 1. Default: 1.</param>
public Color(double r, double g, double b, double a = 1.0f)
{
this.r = (float)r;
this.g = (float)g;
this.b = (float)b;
this.a = (float)a;
}
But if you're particularly pedantic about the semantics of floating-point maths this is not optimal. I'm going to open an issue to Godot's repo and eventually a PR to get this sorted out. On the bright side, Godot and Goost with Mono support now gets compiled just fine.
Goost and Godot version: latest
gd3
commit, and custom Godot build based on latest3.x
commitOS/platform/device including version:
Arch Linux
Issue description: I want to build Goost against my custom Godot build with Mono support. Compiling with mono glue enabled fails with the following errors:
Steps to reproduce: Clone Goost and symlink custom godot source tree inside Goost local repository. Use scons as described in the Goost and Godot documentation for building from source: i compile with mono enabled and no glue, then i generate the glue, and then i recompile with glue.
Is this issue reproducible in official Godot builds? No.
Minimal reproduction project: N/A