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

Consider not logging full MSBuild output on a failed build #201

Open
safesparrow opened this issue Feb 18, 2024 · 2 comments
Open

Consider not logging full MSBuild output on a failed build #201

safesparrow opened this issue Feb 18, 2024 · 2 comments

Comments

@safesparrow
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When MSBuild build fails, ProjInfo logs full MSBuild output which is very verbose.
It happens here:

logger.error (
Log.setMessageI $"Overall Build: {result.OverallResult:overallCode}, projects built {projectsBuilt:count} : {msbuildMessage:msbuildMessage} "
>> Log.addExn result.Exception
)

Sample beginning of output:

[14:18:37 INF] Ionide.ProjInfo.WorkspaceLoaderViaProjectGraph : Started loading projects 20 ["C:\\projekty\\fsharp\\fsharp_scripts\\.cache\\dotnet__fsharp\\9ae94bb9\\_\\tests\\service\\data\\CSharp_Analysis\\CSharp_Analysis.csproj", ...]
[14:18:39 ERR] Ionide.ProjInfo.WorkspaceLoaderViaProjectGraph : Overall Build: Failure, projects built 20 : Build started.
Static graph loaded in 1.055 seconds: 30 nodes, 72 edges
Project "CSharp_Analysis.csproj" (ResolveAssemblyReferencesDesignTime;ResolveProjectReferencesDesignTime;ResolvePackageDependenciesDesignTime;FindReferenceAssembliesForReferences;_GenerateCompileDependencyCache;_ComputeNonExistentFileProperty;BeforeBuild;BeforeCompile;CoreCompile target(s)):
...
(followed by a lot of MSBuild output)

Describe the solution you'd like
Better control over how much output is produced in case of failure.

Describe alternatives you've considered
Disable ProjInfo's logs through Serilog configuration - but that gets rid of useful log information.

@safesparrow safesparrow changed the title Consider not outputting full MSBuild output on a failed build Consider not logging full MSBuild output on a failed build Feb 18, 2024
@baronfel
Copy link
Collaborator

We should do two things here:

  • remove the long message from the existing logger message
  • add another, very-high-verbosity message that logs the build message

However, we should move to making that build message only generated logged in the first place if the verbosity is at a certain level, because that huge string in memory can't be doing well for our overall allocations.

@TheAngryByrd
Copy link
Member

TheAngryByrd commented Feb 19, 2024

We do have this msbuildLogger so we might even be able to remove the giant string completely and let that show errors/details.

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

No branches or pull requests

3 participants