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

Notify MSBuild TerminalLogger of project cache plugin run #10027

Merged

Conversation

mruxmohan4
Copy link
Contributor

@mruxmohan4 mruxmohan4 commented Apr 17, 2024

Context

With MSBuild terminal logger (TL) enabled, project cache plugin (PCP) command-line output suppresses important information, which indicates whether projects have finished upon cache hits.

With both TL and PCP enabled (for "Cache Hit" scenario):

MSBuild version 17.11.0-dev-24217-01+5d2331ee1 for .NET Framework
Restore complete (8.4s)

Build succeeded in 38.4s

Changes Made

Adds information per-project to determine whether the project is classified as a cache plugin project, which occurs when the cache plugin target is called (prior to GetTargetPath or Build). For cache plugin projects that are built, the scenario remains the same (the output path is shown). For cache plugin projects that result in a hit, indicate the output path as well to indicate build progression.

Testing

This was tested with a custom package on the project cache plugin side to invoke the custom target and custom MSBuild bits, with TL and PCP enabled.
"Cache Hit" output:

MSBuild version 17.11.0-dev-24222-01+69635ee15 for .NET Framework
Restore complete (5.0s)
  CloudBuild.Core succeeded (0.4s) → c:\src\CloudBuild\private\Common\CloudBuild.Core\src\bin\x64\Debug\CloudBuild.Core.dll
  CloudBuild.Common succeeded (0.0s) → c:\src\CloudBuild\private\Common\CloudBuild.Common\src\bin\x64\Debug\CloudBuild.Common.dll
  QuickBuild.Hosting succeeded (0.0s) → bin\x64\Debug\QuickBuild.Hosting.dll

Build succeeded in 24.3s

"Cache Hit" (binlog):
image

"Cache Miss" output (same as before change):

MSBuild version 17.11.0-dev-24222-01+69635ee15 for .NET Framework
Restore complete (2.8s)
  CloudBuild.Core succeeded (0.0s) → c:\src\CloudBuild\private\Common\CloudBuild.Core\src\bin\x64\Debug\CloudBuild.Core.dll
  CloudBuild.Common succeeded (0.0s) → c:\src\CloudBuild\private\Common\CloudBuild.Common\src\bin\x64\Debug\CloudBuild.Common.dll
  QuickBuild.Hosting succeeded (19.0s) → bin\x64\Debug\QuickBuild.Hosting.dll

Build succeeded in 40.0s

"Cache Miss" (binlog):
image

Notes

N/A

@mruxmohan4 mruxmohan4 force-pushed the dev/mruxmohan/pcp-telemetry-logger branch from ffad290 to 69635ee Compare April 19, 2024 19:00
@mruxmohan4 mruxmohan4 changed the title Notify MSBuild TerminalLogger of project cache plugin start Notify MSBuild TerminalLogger of project cache plugin hit Apr 19, 2024
@mruxmohan4 mruxmohan4 changed the title Notify MSBuild TerminalLogger of project cache plugin hit Notify MSBuild TerminalLogger of project cache plugin run Apr 19, 2024
@mruxmohan4 mruxmohan4 force-pushed the dev/mruxmohan/pcp-telemetry-logger branch from 69635ee to 5f158f9 Compare April 22, 2024 23:23
@mruxmohan4 mruxmohan4 marked this pull request as ready for review April 24, 2024 21:35
@mruxmohan4 mruxmohan4 force-pushed the dev/mruxmohan/pcp-telemetry-logger branch from 5f158f9 to 755fdd6 Compare April 25, 2024 15:53
@mruxmohan4 mruxmohan4 force-pushed the dev/mruxmohan/pcp-telemetry-logger branch from 5224e9d to 2fd646f Compare April 25, 2024 17:51
Copy link
Member

@AR-May AR-May left a comment

Choose a reason for hiding this comment

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

LGTM

@rainersigwald
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rainersigwald rainersigwald merged commit 371403e into dotnet:main May 7, 2024
10 checks passed
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

Successfully merging this pull request may close these issues.

3 participants