-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Bug]: PropertyReassignment logged as plain messages #9385
Comments
Oh wow, this is where it started: A detective who is also the murderer. |
Fixing this should make it much easier to track the property assignments in the UI - @KirillOsenkov would it be possible to link a property change to the position that the change occurred (meaning both in the specific file that caused the change as well as in the overall build graph)? Or a helper to search for a specific property name being changed? |
We already do all of the above - the viewer uses Regex to recognize the property reassignment messages and manufactures synthetic PropertyReassignmentBuildEventArgs when reading binlogs: In the viewer you can search for Pressing Space on the message will jump to the source code where it happens (because we parse the location information out of the message). Also all property reassignments are grouped under folders under Evaluation: And you can search for a property name in the Properties and Items tab while a project is selected in the tree and you'll see reassignments of that property: Logging a more strongly typed message on the MSBuild side will hopefully reduce allocations (if we don't need to realize the full text of the string) and generally provide a better experience for log readers. @YuliiaKovalova I'm happy to help review this when ready, ping me with any questions! Thanks! |
Note that the viewer also deduplicates the messages because they are long strings and they repeat with the same text for every project being evaluated: So for a binlog with a thousand projects you get a thousand copies of each of these strings unless you deduplicate. But this is on the reader side, the writer (MSBuild) doesn't need to worry about that. |
Issue Description
I just discovered that Property reassignment events are logged as plain messages, and not as PropertyReassignmentEventArgs:
msbuild/src/Build/Evaluation/Evaluator.cs
Lines 1351 to 1357 in 31c4d33
I don't know how I've missed this previously. If we log the structured event, we don't need to materialize the long string message at all.
Here's where we log the real event args, but I suspect this code is not currently enabled:
msbuild/src/Build/Evaluation/PropertyTrackingEvaluatorDataWrapper.cs
Lines 294 to 300 in 31c4d33
The text was updated successfully, but these errors were encountered: