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

Sometimes ProjectStartedEventArgs doesn't contain Properties/Items #3616

Closed
KirillOsenkov opened this issue Aug 15, 2018 · 2 comments
Closed
Assignees
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. Area: Logging triaged

Comments

@KirillOsenkov
Copy link
Member

In some .binlogs for some projects for some initial targets we see Properties/Items missing from under the project node. We think it's most likely in MSBuild.

All the BinaryLogger does is this:
https://source.dot.net/#Microsoft.Build/Logging/BinaryLogger/BuildEventArgsWriter.cs,179

Basically under some circumstances ProjectStartedEventArgs.Properties may be null.

@KirillOsenkov KirillOsenkov added the Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. label Aug 15, 2018
@cdmihai
Copy link
Contributor

cdmihai commented Aug 17, 2018

So apparently, initial properties and items do not appear on parallel builds that contain projects with errors or projects that get skipped. It's the same behaviour with dev14. But they appear in sequential builds, so at least there's a workaround. Here's a repro:
play.zip

Wonder if this is it, or if there are other situations too. I'll start investigating this repro.

@KirillOsenkov
Copy link
Member Author

There are two reasons that the project started args would differ:

The first is that by default we do not log properties/items if the build is running on a remote node: https://github.com/microsoft/msbuild/blob/master/src/Build/BackEnd/Components/Logging/ProjectLoggingContext.cs#L88. this accounts for almost all of the diff you might see.

The second is that if the system finds the result of a build in the cache, here: https://github.com/microsoft/msbuild/blob/master/src/Build/BackEnd/Components/Logging/NodeLoggingContext.cs#L83, then the properties and items have not be rehydrated and will not be present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. Area: Logging triaged
Projects
None yet
Development

No branches or pull requests

3 participants