You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was a very tricky one to debug. Mainly because the dotnet nuget builds when building from source seem to be updating the godot engine build correctly. However, when exporting (at least for Linux) they do not seem to update. In my case, I had an old cache from last year. And as a result, my linux exports where segfaulting. The only way to seem to get the the export to take the new dotnet builds is to delete the dotnet build outputs in the mono module.
This script will delete all folders ignored by git in the folder passed to it:
#!/bin/bashset -e
prev_pwd="$PWD"
dir_to_clean="$1"cd"$dir_to_clean"echo"cleaning directory: $dir_to_clean"
files_to_remove="$(git status . --ignored --short)"if [[ "$files_to_remove"=="" ]]
thenecho"$dir_to_clean: nothing to remove"exit 0
fiecho"Removing the following files and folders:"echo"${files_to_remove[@]}"# This command removes all files that are gitignored. This is useful for removing files that # ``scons --clean`` doesn't remove such as the mono glue.## Explanation of commands:## Lists all the files and folders that are being ignored due .gitignore# git status --ignored --short## Removes the !! that ``git status --ignored --short`` outputs.# NOTE: This could be an issue if we ever name a file or folder with !# sed 's/!//g'## Replaces all newline charactes with a ' ' so ``git status --ignored --short`` is space delimited# tr '\n' ' '## Removes all of the files and folders returned after formatting the output# rm -rf#
rm -rf $(echo "${files_to_remove[@]}"| sed 's/!//g'| tr '\n''')cd"$prev_pwd"
And it can be called like this:
# Clean the dotnet build cache because the cache is not being cleared as the godot documentation# suggests it should. And this is just another level of certainty that the cache is cleared."$dir/clean-ignore.sh" godot/modules/mono/glue/GodotSharp
"$dir/clean-ignore.sh" godot/modules/mono/editor/Godot.NET.Sdk
"$dir/clean-ignore.sh" godot/modules/mono/editor/GodotTools
Steps to reproduce
Build godot mono from source.
Build the Linux export template for mono. Then export a build.
Make a change to the C# code. Ideally something we know will get called like the generated c# code in godot/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GodotPluginsInitializerGenerator.cs. In my case, I added a Console.WriteLine("Hello") inside InitializeFromGameProject so it looks like:
Tested versions
Godot v4.3.dev.mono (e6d09ef)
System information
Godot v4.3.dev.mono (e6d09ef) - Pop!_OS 22.04 LTS - Wayland - Vulkan (Forward+) - dedicated Intel(R) Arc(tm) A750 Graphics (DG2) () - AMD Ryzen 7 5800X 8-Core Processor (16 Threads)
Issue description
This was a very tricky one to debug. Mainly because the dotnet nuget builds when building from source seem to be updating the godot engine build correctly. However, when exporting (at least for Linux) they do not seem to update. In my case, I had an old cache from last year. And as a result, my linux exports where segfaulting. The only way to seem to get the the export to take the new dotnet builds is to delete the dotnet build outputs in the mono module.
Fortunately a bash script can take care of cleaning this for us since
dotnet clean
does not seem to work and the--push-nupkgs-local
arg as described here also doesn't seem to work: https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_with_dotnet.html#nuget-packagesThis script will delete all folders ignored by git in the folder passed to it:
And it can be called like this:
Steps to reproduce
Console.WriteLine("Hello")
insideInitializeFromGameProject
so it looks like:Then rebuild the c# glue and assemblies.
Docs here: https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_with_dotnet.html#building-the-managed-libraries
And here: https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_with_dotnet.html#nuget-packages
Minimal reproduction project (MRP)
NA
The text was updated successfully, but these errors were encountered: