-
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
Log how properties are initially assigned #2711
Comments
Yes pretty please! Your log viewer is just an indispensable tool, thank you very much for it! But I lamented not once being unable to figure out where the initial value of a property is coming from. |
Sounds reasonable. Until this is implemented, I usually use a preprocessed project, searching from the top for |
This seems to be working now: |
Implementing this is likely to cause a huge perf overhead (but needs to be measured to confirm). Like Rainer says, the workaround is to preprocess the project and search for the <PropertyName in the preprocessed text. Binlog viewer supports the Preprocess command on any project. However I think we could implement logging cheaply for some special cases (where we don't have it already):
basically everything but evaluation. I'm worried that logging every property initial assignment for every evaluation will result in way too much new logging args and allocations and create a lot of noise too. I think preprocessor gives a reasonable alternative for those. |
@JanKrivanek @AR-May @rokonec @rainersigwald not logging initial assignment for properties and items during evaluation continues to be a huge pain point. Normally binlogs are great, but not having this information often leaves us in the dark and guessing. I think there's some disabled code from at least two past attempts, as well as event args ready to use such as Checklist for what would be nice:
Both of these would be logged during evaluation. |
I suspect we'll also want these events for analyzers (rules like "don't set property X in context Y" or "never set property Q to value Z"). |
Let's use some structured info (not a textual info in BuildMessageEventArgs etc.). We possibly might reuse |
we do have the (unused) structured events already, see my comment above |
@KirillOsenkov , @rainersigwald , @JanKrivanek could you clarify these points? |
I'd say let's build a prototype and gather some data on the impact to build perf and binlog size, for small and large builds |
+1 on prototyping and then measuring on a reasonably sized project (OrchardCore e.g.) If there is a measurable difference in overall build time and binlog size, then we can think about couple possible optimizations (e.g. the info can be probably be groupped into single message for a single project evaluation, it can possibly be opt-in only similar to requiring |
As noted in one of the older messages above, this feature already exists and can be enabled by setting |
Right; there have been at least two attempts to do this, and both were either backed out or disabled. We need to do some archeology to understand what happened and dig through the old PRs. |
Sounds good! I will approach it at the beginning of March . |
I use |
Not sure if this is the right place to report it, but when I create a log and enable tracking of initial property values (e.g.,
It is good that the log includes the information that the value comes from an |
I think this is really useful to speedup the investigations on binlogs! |
See request here:
KirillOsenkov/MSBuildStructuredLog#133
We log when properties are reassigned when they already had a value, but it would be useful to specify how a property was initially assigned - from an environment variable, from /p:, from evaluation (and which location exactly) or from building (which target, task etc).
PropertyAssignmentSource or something.
The text was updated successfully, but these errors were encountered: