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

[3.x] Fix MSBuild logger exception thrown when processing a warning or an error with no associated file #96127

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

RedOrbweaver
Copy link
Contributor

@RedOrbweaver RedOrbweaver commented Aug 26, 2024

I was trying to get Fody (specifically PropertyChanged.Fody) to work with my project. When the Fody package would throw an error or a warning the logger would encounter an exception and fail the build. Actually, the build would succeed, but editor would throw an error. Pressing build again would find that all files have been generated and launch the program normally. You can imagine how insane that made me feel.

The issue was that the warning/error parsing code did not account for the possibility of the BuildErrorEventArgs.File field being null. I also found that BuildOutputView would crash the entire editor when clicking on any entry without a related file, so I fixed that too (changing one && to || did the trick). I couldn't get the debugger to work with the C# glue, so I added a few extra null-checks just in case there are other edge cases I missed.

Side note: In case someone finds this by googling "Fody" + "Godot", the way I was able to get it to work was by enabling the addons inside a <WeaverConfiguration><Weavers><Weavers /><WeaverConfiguration /> tag directly in the .csproj file. Don't bother with a FodyWeavers.xml file, it will only bring you confusion and pain. Also remember to set PrivateAssets to all for all NuGet packages (including Fody itself) like this:

<PackageReference Include="PropertyChanged.Fody" Version="4.1.0">
  <PrivateAssets>all</PrivateAssets>
</PackageReference>

@RedOrbweaver RedOrbweaver changed the title Fixed MSBuild logger crash when processing a warning or an error with no associated file Fixed MSBuild logger exception thorwn when processing a warning or an error with no associated file Aug 26, 2024
@RedOrbweaver RedOrbweaver changed the title Fixed MSBuild logger exception thorwn when processing a warning or an error with no associated file Fixed MSBuild logger exception thrown when processing a warning or an error with no associated file Aug 26, 2024
@AThousandShips AThousandShips changed the title Fixed MSBuild logger exception thrown when processing a warning or an error with no associated file Fix MSBuild logger exception thrown when processing a warning or an error with no associated file Aug 26, 2024
@AThousandShips AThousandShips changed the title Fix MSBuild logger exception thrown when processing a warning or an error with no associated file [3.x] Fix MSBuild logger exception thrown when processing a warning or an error with no associated file Aug 26, 2024
@AThousandShips AThousandShips added this to the 3.6 milestone Aug 26, 2024
@AThousandShips AThousandShips requested review from a team August 26, 2024 17:43
@raulsntos
Copy link
Member

Thanks for contributing to the .NET module! I'd like to understand better what this PR is fixing. Can you provide a minimal reproduction project? How does the CSV file look like when the issue takes place?

@RedOrbweaver
Copy link
Contributor Author

Here you go: https://github.com/RedOrbweaver/cstest/tree/msbuild_parser_test

You may need to run dotnet restore to install the required NuGet packages. Be sure to always do a full rebuild, as the build effectively succeeds even though it says it failed. I think that's because the logs are processed after the actual compilation takes place.

What's happening is that if MSBuild outputs a warning or an error with BuildErrorEventArgs.File set to null the logger will throw an exception while trying to escape the Csv characters because it doesn't have a null check on it. This doesn't seem to normally happen in MSBuild, but a package I am using (Fody) does generate those.

There's a second bug in the error/warning panel that causes the editor to crash when clicking on the file-less warning. I also added a few extra nullchecks, as at this point I don't think any fields in BuildErrorEventArgs can be safely assumed to be non-null.

Here's the build output for Godot 3.5.3:

Running: "/usr/bin/dotnet" msbuild "/home/user/Projects/godot/tests/cstest/cstest.sln" /restore /t:Rebuild "/p:Configuration=Debug" /v:normal "/l:GodotTools.BuildLogger.GodotBuildLogger,/home/user/godot/Godot_v3.5.3-stable_mono_x11_64/GodotSharp/Tools/GodotTools.BuildLogger.dll;/home/user/.local/share/godot/mono/build_logs/e03f44e4ba64c7d341ba1f116e2e190e_Debug" /p:GodotTargetPlatform=x11
MSBuild version 17.8.5+b5265ef37 for .NET
Build started 08/28/2024 15:16:56.
     1>Project "/home/user/Projects/godot/tests/cstest/cstest.sln" on node 1 (Restore target(s)).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Debug|Any CPU".
       _GetAllRestoreProjectPathItems:
         Determining projects to restore...
       Restore:
         X.509 certificate chain validation will use the fallback certificate bundle at '/usr/lib/dotnet/sdk/8.0.108/trustedroots/codesignctl.pem'.
         X.509 certificate chain validation will use the fallback certificate bundle at '/usr/lib/dotnet/sdk/8.0.108/trustedroots/timestampctl.pem'.
         Assets file has not changed. Skipping assets file writing. Path: /home/user/Projects/godot/tests/cstest/.mono/temp/obj/project.assets.json
         Restored /home/user/Projects/godot/tests/cstest/cstest.csproj (in 36 ms).
         
         NuGet Config files used:
             /home/user/.nuget/NuGet/NuGet.Config
         
         Feeds used:
             https://api.nuget.org/v3/index.json
         All projects are up-to-date for restore.
     1>Done Building Project "/home/user/Projects/godot/tests/cstest/cstest.sln" (Restore target(s)).
   1:2>Project "/home/user/Projects/godot/tests/cstest/cstest.sln" on node 1 (Rebuild target(s)).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Debug|Any CPU".
   1:2>Project "/home/user/Projects/godot/tests/cstest/cstest.sln" (1:2) is building "/home/user/Projects/godot/tests/cstest/cstest.csproj" (2:6) on node 1 (Rebuild target(s)).
     2>CoreClean:
         Deleting file "/home/user/Projects/godot/tests/cstest/.mono/temp/bin/Debug/cstest.deps.json".
         Deleting file "/home/user/Projects/godot/tests/cstest/.mono/temp/bin/Debug/cstest.dll".
         Deleting file "/home/user/Projects/godot/tests/cstest/.mono/temp/bin/Debug/cstest.pdb".
         Deleting file "/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.csproj.AssemblyReference.cache".
         Deleting file "/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.GeneratedMSBuildEditorConfig.editorconfig".
         Deleting file "/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.AssemblyInfoInputs.cache".
         Deleting file "/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.AssemblyInfo.cs".
         Deleting file "/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.csproj.CoreCompileInputs.cache".
         Deleting file "/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.sourcelink.json".
         Deleting file "/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.dll".
         Deleting file "/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.pdb".
       GenerateTargetFrameworkMonikerAttribute:
       Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
       _GenerateSourceLinkFile:
         Updating Source Link file '/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.sourcelink.json'.
       CoreCompile:
         /usr/lib/dotnet/dotnet exec "/usr/lib/dotnet/sdk/8.0.108/Roslyn/bincore/csc.dll" /noconfig /unsafe+ /checked- /nowarn:1701,1702,1701,1702 /fullpaths /nostdlib+ /errorreport:prompt /warn:3 /define:GODOT;GODOT_X11;GODOT_PC;TRACE;TOOLS;DEBUG;NETCOREAPP;NETCOREAPP3_1;NETCOREAPP1_0_OR_GREATER;NETCOREAPP1_1_OR_GREATER;NETCOREAPP2_0_OR_GREATER;NETCOREAPP2_1_OR_GREATER;NETCOREAPP2_2_OR_GREATER;NETCOREAPP3_0_OR_GREATER;NETCOREAPP3_1_OR_GREATER /highentropyva+ /reference:/home/user/Projects/godot/tests/cstest/.mono/assemblies/Debug/GodotSharp.dll /reference:/home/user/Projects/godot/tests/cstest/.mono/assemblies/Debug/GodotSharpEditor.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/Microsoft.CSharp.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/Microsoft.VisualBasic.Core.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/Microsoft.VisualBasic.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/Microsoft.Win32.Primitives.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/mscorlib.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/netstandard.dll /reference:/home/user/.nuget/packages/propertychanged.fody/4.1.0/lib/netstandard2.1/PropertyChanged.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.AppContext.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Buffers.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Collections.Concurrent.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Collections.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Collections.Immutable.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Collections.NonGeneric.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Collections.Specialized.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.ComponentModel.Annotations.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.ComponentModel.DataAnnotations.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.ComponentModel.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.ComponentModel.EventBasedAsync.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.ComponentModel.Primitives.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.ComponentModel.TypeConverter.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Configuration.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Console.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Core.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Data.Common.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Data.DataSetExtensions.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Data.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Diagnostics.Contracts.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Diagnostics.Debug.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Diagnostics.DiagnosticSource.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Diagnostics.FileVersionInfo.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Diagnostics.Process.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Diagnostics.StackTrace.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Diagnostics.TextWriterTraceListener.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Diagnostics.Tools.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Diagnostics.TraceSource.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Diagnostics.Tracing.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Drawing.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Drawing.Primitives.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Dynamic.Runtime.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Globalization.Calendars.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Globalization.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Globalization.Extensions.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.Compression.Brotli.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.Compression.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.Compression.FileSystem.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.Compression.ZipFile.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.FileSystem.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.FileSystem.DriveInfo.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.FileSystem.Primitives.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.FileSystem.Watcher.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.IsolatedStorage.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.MemoryMappedFiles.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.Pipes.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.IO.UnmanagedMemoryStream.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Linq.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Linq.Expressions.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Linq.Parallel.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Linq.Queryable.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Memory.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.Http.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.HttpListener.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.Mail.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.NameResolution.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.NetworkInformation.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.Ping.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.Primitives.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.Requests.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.Security.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.ServicePoint.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.Sockets.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.WebClient.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.WebHeaderCollection.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.WebProxy.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.WebSockets.Client.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Net.WebSockets.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Numerics.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Numerics.Vectors.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.ObjectModel.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Reflection.DispatchProxy.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Reflection.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Reflection.Emit.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Reflection.Emit.ILGeneration.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Reflection.Emit.Lightweight.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Reflection.Extensions.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Reflection.Metadata.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Reflection.Primitives.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Reflection.TypeExtensions.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Resources.Reader.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Resources.ResourceManager.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Resources.Writer.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.CompilerServices.Unsafe.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.CompilerServices.VisualC.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.Extensions.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.Handles.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.InteropServices.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.InteropServices.RuntimeInformation.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.InteropServices.WindowsRuntime.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.Intrinsics.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.Loader.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.Numerics.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.Serialization.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.Serialization.Formatters.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.Serialization.Json.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.Serialization.Primitives.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Runtime.Serialization.Xml.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Security.Claims.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Security.Cryptography.Algorithms.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Security.Cryptography.Csp.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Security.Cryptography.Encoding.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Security.Cryptography.Primitives.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Security.Cryptography.X509Certificates.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Security.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Security.Principal.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Security.SecureString.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.ServiceModel.Web.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.ServiceProcess.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Text.Encoding.CodePages.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Text.Encoding.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Text.Encoding.Extensions.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Text.Encodings.Web.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Text.Json.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Text.RegularExpressions.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Threading.Channels.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Threading.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Threading.Overlapped.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Threading.Tasks.Dataflow.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Threading.Tasks.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Threading.Tasks.Extensions.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Threading.Tasks.Parallel.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Threading.Thread.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Threading.ThreadPool.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Threading.Timer.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Transactions.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Transactions.Local.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.ValueTuple.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Web.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Web.HttpUtility.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Windows.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Xml.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Xml.Linq.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Xml.ReaderWriter.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Xml.Serialization.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Xml.XDocument.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Xml.XmlDocument.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Xml.XmlSerializer.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Xml.XPath.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/System.Xml.XPath.XDocument.dll /reference:/home/user/.dotnet/packs/Microsoft.NETCore.App.Ref/3.1.0/ref/netcoreapp3.1/WindowsBase.dll /debug+ /debug:portable /filealign:512 /optimize- /out:/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.dll /target:library /warnaserror- /utf8output /deterministic+ /sourcelink:/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.sourcelink.json /langversion:8.0 /embed:"/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs" /embed:/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.AssemblyInfo.cs /analyzerconfig:/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.GeneratedMSBuildEditorConfig.editorconfig /analyzer:/home/user/.nuget/packages/propertychanged.fody/4.1.0/analyzers/dotnet/cs/PropertyChanged.Fody.Analyzer.dll MainScene.cs utils.cs "/home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs" /home/user/Projects/godot/tests/cstest/.mono/temp/obj/Debug/cstest.AssemblyInfo.cs /warnaserror+:NU1605
         CompilerServer: server - server processed compilation - 9732febf-ef29-419b-b0c8-c8104430896e
       FodyTarget:
         Fody: Fody (version 6.8.1.0 @ file:///home/user/.nuget/packages/fody/6.8.1/netstandardtask/Fody.dll) Executing
     2>MSBUILD : warning FodyPackageReference: Fody: The package reference for PropertyChanged.Fody does not contain PrivateAssets='All' [/home/user/Projects/godot/tests/cstest/cstest.csproj]

Build FAILED.

       "/home/user/Projects/godot/tests/cstest/cstest.sln" (Rebuild target) (1:2) ->
       "/home/user/Projects/godot/tests/cstest/cstest.csproj" (Rebuild target) (2:6) ->
       (FodyTarget target) -> 
         MSBUILD : warning FodyPackageReference: Fody: The package reference for PropertyChanged.Fody does not contain PrivateAssets='All' [/home/user/Projects/godot/tests/cstest/cstest.csproj]

    1 Warning(s)
    0 Error(s)

Time Elapsed 00:00:02.00
MSBUILD : error MSB4017: The build stopped unexpectedly because of an unexpected logger failure.
Microsoft.Build.Exceptions.InternalLoggerException: The build stopped unexpectedly because of an unexpected logger failure.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at GodotTools.BuildLogger.StringExtensions.CsvEscape(String value, Char delimiter) in /root/godot/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotBuildLogger.cs:line 167
   at GodotTools.BuildLogger.GodotBuildLogger.eventSource_WarningRaised(Object sender, BuildWarningEventArgs e) in /root/godot/modules/mono/editor/GodotTools/GodotTools.BuildLogger/GodotBuildLogger.cs:line 106
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseWarningEvent(Object sender, BuildWarningEventArgs buildEvent) in /_/src/msbuild/artifacts/source-build/self/src/src/Build/BackEnd/Components/Logging/EventSourceSink.cs:line 407
   --- End of inner exception stack trace ---
   at Microsoft.Build.Exceptions.InternalLoggerException.Throw(Exception innerException, BuildEventArgs e, String messageResourceName, Boolean initializationException, String[] messageArgs) in /_/src/msbuild/artifacts/source-build/self/src/src/Build/Errors/InternalLoggerException.cs:line 253
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseWarningEvent(Object sender, BuildWarningEventArgs buildEvent) in /_/src/msbuild/artifacts/source-build/self/src/src/Build/BackEnd/Components/Logging/EventSourceSink.cs:line 423
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(Object sender, BuildEventArgs buildEvent) in /_/src/msbuild/artifacts/source-build/self/src/src/Build/BackEnd/Components/Logging/EventSourceSink.cs:line 869

Copy link
Member

@raulsntos raulsntos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is the warning that I get with your MRP:

(0,0): warning FodyPackageReference: Fody: The package reference for PropertyChanged.Fody does not contain PrivateAssets='All'

The error has no associated file, so e.File is null. The changes to handle a null e.File in the logger look good to me, the other changes should not be needed.

The issue is also present in Godot 4, so this change needs to be applied to master. If you are unable to open a PR against the master branch, I can do it for you.

@RedOrbweaver RedOrbweaver force-pushed the fix_msbuild_logger_crash branch 3 times, most recently from 5f66671 to d52e604 Compare August 29, 2024 16:04
@RedOrbweaver
Copy link
Contributor Author

Should be fine now, I'll port it to Godot 4 once it's approved.

@RedOrbweaver RedOrbweaver force-pushed the fix_msbuild_logger_crash branch 2 times, most recently from edf5156 to 5885cfa Compare August 29, 2024 16:46
@RedOrbweaver
Copy link
Contributor Author

That's... Weird. It doesn't do it in any other project and it's not how I'd configure it anyway. Fixed.

Copy link
Member

@raulsntos raulsntos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

By the way, it seems your commit is not linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info.

@lawnjelly
Copy link
Member

By the way, it seems your commit is not linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info.

This seems to be related to capitalization being different in the email for the 3.x and 4.x PR.

Would be good to see if @RedOrbweaver wants to change this before merging.

@RedOrbweaver
Copy link
Contributor Author

By the way, it seems your commit is not linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info.

This seems to be related to capitalization being different in the email for the 3.x and 4.x PR.

Would be good to see if @RedOrbweaver wants to change this before merging.

I think I fixed it. Weird that it'd care about capitalization, AFAIK neither capitalization nor dots matter in email resolution.

@lawnjelly lawnjelly merged commit db51187 into godotengine:3.x Sep 12, 2024
14 checks passed
@lawnjelly
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants