Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# module compilation fail with deprecated=no compile flag #84426

Closed
leandro-benedet-garcia opened this issue Nov 3, 2023 · 1 comment · Fixed by #96570
Closed

C# module compilation fail with deprecated=no compile flag #84426

leandro-benedet-garcia opened this issue Nov 3, 2023 · 1 comment · Fixed by #96570

Comments

@leandro-benedet-garcia
Copy link

leandro-benedet-garcia commented Nov 3, 2023

Godot version

Master branch, 5ee9831

System information

Gentoo - Linux 6.1.57

Issue description

Following this instructions, https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_with_dotnet.html#example-linux-bsd with the exception that I was testing with deprecated=no

The compilation fails with these errors:

Running MSBuild:  /usr/bin/dotnet msbuild /home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp.sln /restore /t:Build /p:Configuration=Debug /p:NoWarn=1591
MSBuild version 17.7.3+8ec440e68 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  Godot.SourceGenerators.Internal -> /home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/bin/Debug/netstandard2.0/Godot.SourceGenerators.Internal.dll
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Compat.cs(33,12): error CS0246: The type or namespace name 'AnimationMethodCallMode' could not be found (are you missing a using directive or an assembly reference?) [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Compat.cs(49,12): error CS0246: The type or namespace name 'AnimationProcessCallback' could not be found (are you missing a using directive or an assembly reference?) [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/TextEdit.cs(746,34): warning CS0108: 'TextEdit.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Compat.cs(60,12): error CS0246: The type or namespace name 'AnimationProcessCallback' could not be found (are you missing a using directive or an assembly reference?) [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/RichTextLabel.cs(399,34): warning CS0108: 'RichTextLabel.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/ArrayMesh.cs(64,32): warning CS0108: 'ArrayMesh.BlendShapeMode' hides inherited member 'Mesh.BlendShapeMode'. Use the new keyword if hiding was intended. [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/GltfAccessor.cs(280,18): warning CS0108: 'GltfAccessor.GetType()' hides inherited member 'object.GetType()'. Use the new keyword if hiding was intended. [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/GltfAccessor.cs(569,43): warning CS0108: 'GltfAccessor.MethodName.GetType' hides inherited member 'object.GetType()'. Use the new keyword if hiding was intended. [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Button.cs(170,34): warning CS0108: 'Button.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Label.cs(244,34): warning CS0108: 'Label.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/LineEdit.cs(608,34): warning CS0108: 'LineEdit.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/LinkButton.cs(85,34): warning CS0108: 'LinkButton.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/MenuBar.cs(77,34): warning CS0108: 'MenuBar.TextDirection' hides inherited member 'Control.TextDirection'. Use the new keyword if hiding was intended. [/home/leandrobg/Projects/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]

Steps to reproduce

Compile like this:

  1. scons p=linuxbsd target=editor deprecated=no module_mono_enabled=yes
  2. bin/godot.li nuxbsd.editor.dev.x86_64.llvm.mono --headless --generate-mono-glue modules/mono/glue
  3. ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd

Minimal reproduction project

N/A

@Drako
Copy link
Contributor

Drako commented Sep 3, 2024

I would remove the platform tag, as this has nothing to do with Linux.

The issue here is, that when compiling the engine with deprecated=no obsolete classes are not included in the build.
When using the resulting editor to generate the C# glue code, the C# bindings for these obsolete classes are also not generated.

GodotSharp contains a Compat.cs however, which is an unconditional part of GodotSharp and which always refers to these two:

    public enum AnimationProcessCallback : long
    {
        [Obsolete("See 'Godot.AnimationMixer.AnimationCallbackModeProcess.Physics'.")]
        Physics = 0,
        [Obsolete("See 'Godot.AnimationMixer.AnimationCallbackModeProcess.Idle'.")]
        Idle = 1,
        [Obsolete("See 'Godot.AnimationMixer.AnimationCallbackModeProcess.Manual'.")]
        Manual = 2
    }

    public enum AnimationMethodCallMode : long
    {
        [Obsolete("See 'Godot.AnimationMixer.AnimationCallbackModeMethod.Deferred'.")]
        Deferred = 0,
        [Obsolete("See 'Godot.AnimationMixer.AnimationCallbackModeMethod.Immediate'.")]
        Immediate = 1
    }

As a result, GodotSharp cannot be built, when the editor has been built without deprecated functionality.

@akien-mga akien-mga changed the title C# module compilation fail with certain compile flags C# module compilation fail with deprecated=no compile flag Sep 4, 2024
Drako added a commit to Drako/godot that referenced this issue Sep 4, 2024
Drako added a commit to Drako/godot that referenced this issue Sep 4, 2024
Drako added a commit to Drako/godot that referenced this issue Sep 4, 2024
Drako added a commit to Drako/godot that referenced this issue Sep 4, 2024
@akien-mga akien-mga added this to the 4.4 milestone Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants