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

.NET: Building GodotSharp is broken in current master branch #100502

Closed
akien-mga opened this issue Dec 17, 2024 · 3 comments · Fixed by #100506
Closed

.NET: Building GodotSharp is broken in current master branch #100502

akien-mga opened this issue Dec 17, 2024 · 3 comments · Fixed by #100506

Comments

@akien-mga
Copy link
Member

Tested versions

  • Reproducible in 4.4.dev (4364ed6)
  • Not reproducible in 4.4.dev6 and earlier

System information

Fedora 41, .NET 8.0.111

Issue description

When building the GodotSharp assemblies, I get these errors:

$ ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin
Running MSBuild:  /usr/bin/dotnet msbuild /home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp.sln /restore /t:Build /p:Configuration=Debug /p:NoWarn=1591

Welcome to .NET 8.0!
---------------------
SDK Version: 8.0.111

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate, view the instructions: https://aka.ms/dotnet-https-linux

----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
MSBuild version 17.8.5+b5265ef37 for .NET
  Determining projects to restore...
  Restored /home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj (in 419 ms).
  Restored /home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharpEditor/GodotSharpEditor.csproj (in 419 ms).
  Restored /home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotPlugins/GodotPlugins.csproj (in 419 ms).
  Restored /home/akien/Godot/godot/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/Godot.SourceGenerators.Internal.csproj (in 4.05 sec).
  Godot.SourceGenerators.Internal -> /home/akien/Godot/godot/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/bin/Debug/netstandard2.0/Godot.SourceGenerators.Internal.dll
CSC : warning CS9057: The analyzer assembly '/home/akien/Godot/godot/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/bin/Debug/netstandard2.0/Godot.SourceGenerators.Internal.dll' references version '4.9.0.0' of the compiler, which is newer than the currently running version '4.8.0.0'. [/home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/NativeFuncs.cs(7,13): error CS0234: The type or namespace name 'SourceGenerators' does not exist in the namespace 'Godot' (are you missing an assembly reference?) [/home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/NativeFuncs.cs(18,6): error CS0246: The type or namespace name 'GenerateUnmanagedCallbacksAttribute' could not be found (are you missing a using directive or an assembly reference?) [/home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/NativeFuncs.cs(18,6): error CS0246: The type or namespace name 'GenerateUnmanagedCallbacks' could not be found (are you missing a using directive or an assembly reference?) [/home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/NativeFuncs.cs(185,36): error CS8795: Partial method 'NativeFuncs.godotsharp_variant_new_copy(out godot_variant, scoped in godot_variant)' must have an implementation part because it has accessibility modifiers. [/home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]
/home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/NativeFuncs.cs(319,36): error CS8795: Partial method 'NativeFuncs.godotsharp_string_name_new_copy(out godot_string_name, scoped in godot_string_name)' must have an implementation part because it has accessibility modifiers. [/home/akien/Godot/godot/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj]

etc.

Full error log:
godotsharp-errors.txt

This appears to be a recent regression, possibly from #92131?

dotnet --info
.NET SDK:
 Version:           8.0.111
 Commit:            ad116b5ce0
 Workload version:  8.0.100-manifests.7198dcc9

Runtime Environment:
 OS Name:     fedora
 OS Version:  41
 OS Platform: Linux
 RID:         fedora.41-x64
 Base Path:   /usr/lib64/dotnet/sdk/8.0.111/

.NET workloads installed:
 Workload version: 8.0.100-manifests.7198dcc9
There are no installed workloads to display.

Host:
  Version:      8.0.11
  Architecture: x64
  Commit:       9cb3b725e3

.NET SDKs installed:
  8.0.111 [/usr/lib64/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.11 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.11 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/lib64/dotnet]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Steps to reproduce

scons module_mono_enabled=yes
./bin/godot.blabla --generate-mono-glue modules/mono/glue
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin

Minimal reproduction project (MRP)

n/a

@akien-mga
Copy link
Member Author

This appears to be a recent regression, possibly from #92131?

I confirm that reverting that PR locally fixes the issue for me.

@pmoosi
Copy link

pmoosi commented Dec 17, 2024

Ran into the same problem. It seems to work with .net 9 (9.0.101).

@akien-mga
Copy link
Member Author

@raulsntos found what causes the error:

Yeah, it may be because of this change: #92131 (comment)

We should try changing that package's version to 4.8.0, which I believe is the smaller version that supports .NET 8. It's also what the dotnet/runtime repo uses.

I confirm that changing the package version to 4.8.0 solves it.

We also found that the issue happens with .NET SDK 8.0.111, but not with 8.0.404 (for some reason .NET 8.0 has 3 maintained SDK subbranches). Linux distros ship 8.0.111 it seems.

I'm trying to configure CI to use 8.0.100 in #100506, and when I get it to work (fail), I'll add the fix.

@akien-mga akien-mga self-assigned this Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Immediate Blocker
Development

Successfully merging a pull request may close this issue.

2 participants