This pull request introduces a new logger for MSBuild events using LogProvider and enhances the error reporting with more detailed messages. It affects the Library.fs file in the Ionide.ProjInfo project.
π€ Generated by Copilot at 9274475
Sing, O Muse, of the skillful coder who devisedA new logger, using the LogProvider library,To capture the events of MSBuild, the mighty toolThat shapes the projects of mortals with its power.
ππ οΈπ
WHY
We were missing log output failure reasons on the Graph path. Additionally we can now log more output. This should help narrow down why project loads fail for people.
Log output
[18:44:19.266 INF] [Ionide.ProjInfo.WorkspaceLoaderViaProjectGraph] Started loading projects 18 ["c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\src\\Compiler\\FSharp.Compiler.Service.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\src\\fsc\\fscProject\\fsc.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\src\\FSharp.Core\\FSharp.Core.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\src\\FSharp.DependencyManager.Nuget\\FSharp.DependencyManager.Nuget.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\tests\\benchmarks\\FCSBenchmarks\\BenchmarkComparison\\HistoricalBenchmark.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\src\\fsi\\fsiProject\\fsi.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\tests\\benchmarks\\FCSBenchmarks\\CompilerServiceBenchmarks\\FSharp.Compiler.Benchmarks.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\src\\FSharp.Compiler.Interactive.Settings\\FSharp.Compiler.Interactive.Settings.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\buildtools\\fsyacc\\fsyacc.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\buildtools\\AssemblyCheck\\AssemblyCheck.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\tests\\benchmarks\\FCSBenchmarks\\BenchmarkComparison\\HistoricalBenchmark.Runner\\HistoricalBenchmark.Runner.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\buildtools\\fslex\\fslex.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\tests\\FSharp.Compiler.ComponentTests\\FSharp.Compiler.ComponentTests.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\tests\\service\\data\\CSharp_Analysis\\CSharp_Analysis.csproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\src\\FSharp.Build\\FSharp.Build.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\tests\\FSharp.Compiler.Service.Tests\\FSharp.Compiler.Service.Tests.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\tests\\FSharp.Test.Utilities\\FSharp.Test.Utilities.fsproj", "c:\\Users\\jimmy\\Repositories\\public\\TheAngryByrd\\fsharp\\tests\\service\\data\\TestTP\\TestTP.fsproj"]
[18:44:19.292 INF] [MsBuild] Build started.
[18:44:19.303 DBG] [MsBuild] Static graph loaded in 0.544 seconds: 26 nodes, 50 edges
[18:44:19.461 DBG] [MsBuild] net session >nul 2>&1
[18:44:19.504 ERR] [MsBuild] The specified task executable location "C:\Program Files\dotnet\sdk\7.0.202\FSharp\fsc.exe" is invalid.
[18:44:20.890 DBG] [MsBuild] net session >nul 2>&1
[18:44:20.897 ERR] [MsBuild] The specified task executable location "C:\Program Files\dotnet\sdk\7.0.202\FSharp\fsc.exe" is invalid.
[18:44:21.497 DBG] [MsBuild] net session >nul 2>&1
[18:44:21.498 ERR] [MsBuild] The specified task executable location "C:\Program Files\dotnet\sdk\7.0.202\FSharp\fsc.exe" is invalid.
HOW
π€ Generated by Copilot at 9274475
Introduce a new logging function msBuildToLogProvider that uses the LogProvider library to log MSBuild events with different levels and context (link)
Rename the existing logging function logger to stringWriterLogger to avoid confusion (link)
Create two logger instances, one using stringWriterLogger and one using msBuildToLogProvider, and pass them to the createLoggers function (link)
Modify the createLoggers function to return both logger instances when the binaryLogs parameter is Off or Within dir (link, link)
Add a parameter msbuildErrors to the handleError function that takes a string containing the MSBuild messages from the StringWriter instance (link)
Assign the MSBuild messages from the StringWriter instance to a local variable msbuildMessage after the BuildManager finishes building the projects (link)
Pass the msbuildMessage variable to the handleError function when the result indicates a failure (link)
Modify the logging logic to use different levels and interpolation depending on the result.OverallResult value and include the msbuildMessage variable in the error log when the result is not Success (link)
Pass an empty string as the msbuildErrors parameter to the handleError function when an exception is thrown outside the BuildManager scope (link)
WHAT
π€ Generated by Copilot at 9274475
This pull request introduces a new logger for MSBuild events using
LogProvider
and enhances the error reporting with more detailed messages. It affects theLibrary.fs
file in theIonide.ProjInfo
project.π€ Generated by Copilot at 9274475
ππ οΈπ
WHY
We were missing log output failure reasons on the Graph path. Additionally we can now log more output. This should help narrow down why project loads fail for people.
Log output
HOW
π€ Generated by Copilot at 9274475
msBuildToLogProvider
that uses theLogProvider
library to log MSBuild events with different levels and context (link)logger
tostringWriterLogger
to avoid confusion (link)stringWriterLogger
and one usingmsBuildToLogProvider
, and pass them to thecreateLoggers
function (link)createLoggers
function to return both logger instances when thebinaryLogs
parameter isOff
orWithin dir
(link, link)msbuildErrors
to thehandleError
function that takes a string containing the MSBuild messages from theStringWriter
instance (link)StringWriter
instance to a local variablemsbuildMessage
after theBuildManager
finishes building the projects (link)msbuildMessage
variable to thehandleError
function when theresult
indicates a failure (link)result.OverallResult
value and include themsbuildMessage
variable in the error log when the result is notSuccess
(link)msbuildErrors
parameter to thehandleError
function when an exception is thrown outside theBuildManager
scope (link)