raulsntos / godot-dotnet

MIT License
82 stars 13 forks source link

Build fails with missing Godot types #12

Open emmauss opened 5 months ago

emmauss commented 5 months ago

Godot version

4.2

Godot .NET packages version

e876acc9d5fffbc1f295db7d2395da47ad0c341b

System information

Windows 11AMD Ryzen 5 4800H

.NET information

8.0.200

Issue description

On a clean build, the following commands fails with missing Godot Types; ./build.sh --productBuild --pushNupkgsLocal ./nugets

It initially fails with Accessibility Modifiers error;

D:\ryujinx\godot-dotnet\src\Godot.BindingsGenerator\BindingsGenerator\BindingsData.CollectionContext.cs(9,15): error IDE0040: Accessibility modifiers required (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0040) [D:\ryujinx\godot-dotnet\src\Godot.BindingsGenerator\Godot.BindingsGenerator.csproj]
D:\ryujinx\godot-dotnet\src\Godot.BindingsGenerator\BindingsGenerator\BindingsData.RegisterKnownTypes.cs(7,15): error IDE0040: Accessibility modifiers required (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0040) [D:\ryujinx\godot-dotnet\src\Godot.BindingsGenerator\Godot.BindingsGenerator.csproj]
    0 Warning(s)
    2 Error(s)

On fixing that, it fails with a whole lot of missing godot types. Log is found here, https://pastebin.com/fVhcXeYd .

The build scripts hasn't been modified in any way, and the dotnet version used is the one downloaded by the script.

Steps to reproduce

  1. Do a clean clone of the repo
  2. Run ./build.sh --productBuild --pushNupkgsLocal ./nugets in a bash terminal. (Same thing occurs with powershell or cmd scripts)

Minimal reproduction project

N/A

raulsntos commented 5 months ago

Godot version 4.2

This is likely not going to work since we use some GDExtension API introduced in 4.3 (like the Callable API).

It initially fails with Accessibility Modifiers error;

That's just a warning, we are treating warnings as errors by default so it fails compilation. We'll eventually fix these warnings but for now use --warnAsError false.

On fixing that, it fails with a whole lot of missing godot types.

It looks like you didn't run the Godot.BindingsGenerator. You can use /p:GenerateGodotBindings=true so it's run as part of building the Godot.Bindings project. Eventually this will happen automatically, but we need to make the task incremental first.

./build.sh --productBuild --pushNupkgsLocal ./nugets --warnAsError false /p:GenerateGodotBindings=true
emmauss commented 5 months ago

Godot version 4.2

This is likely not going to work since we use some GDExtension API introduced in 4.3 (like the Callable API).

It initially fails with Accessibility Modifiers error;

That's just a warning, we are treating warnings as errors by default so it fails compilation. We'll eventually fix these warnings but for now use --warnAsError false.

On fixing that, it fails with a whole lot of missing godot types.

It looks like you didn't run the Godot.BindingsGenerator. You can use /p:GenerateGodotBindings=true so it's run as part of building the Godot.Bindings project. Eventually this will happen automatically, but we need to make the task incremental first.

./build.sh --productBuild --pushNupkgsLocal ./nugets --warnAsError false /p:GenerateGodotBindings=true

I don't know which version this project currently targets, but this is an attempt at a clean build from cloning, no custom godot api exports. I'll try with the generation flag

emmauss commented 5 months ago

The following command works; ./build.sh --productBuild --pushNupkgsLocal ./nugets --warnAsError false //p:GenerateGodotBindings=true