-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[vs17.14] Binlog not produced for C++ project on Visual Studio Load Fix #11774
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a regression where the BinaryLogger was not being included during Visual Studio C++ project load by correcting array and collection concatenation. Key changes include:
- In GenerateResource.cs, replacing the erroneous array literal syntax with proper concatenation of reference and additional inputs.
- In BuildManager.cs, updating the logger concatenation to correctly include the BinaryLogger using empty array fallback.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Tasks/GenerateResource.cs | Fixed concatenation of inputs by replacing the faulty bracket syntax with a Concat call. |
src/Build/BackEnd/BuildManager/BuildManager.cs | Updated logger inclusion to use empty array fallback and Concat, ensuring the BinaryLogger is always included. |
Comments suppressed due to low confidence (2)
src/Tasks/GenerateResource.cs:1708
- The change correctly replaces the invalid array literal syntax with Concat to merge inputs. Ensure that downstream code expecting an array can work with the resulting IEnumerable or convert it to an array if needed.
var inputs = (this.References ?? []).Concat(this.AdditionalInputs ?? []);
src/Build/BackEnd/BuildManager/BuildManager.cs:680
- The update uses Concat with an empty array fallback to include the BinaryLogger correctly. Verify that the new array literal syntax ([logger]) aligns with the project’s C# version and style guidelines.
return (loggers ?? []).Concat([logger]);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #11678
Work item (Internal use):
Summary
Regression in Visual Studio 17.13 (worked in 17.12).
Binlog is not created for C++ project on Visual Studio load.
Customer Impact
Harder to diagnose build failures/perf issues for vcxproj in VS.
Regression?
Yes, from 17.12 to 17.13.
Testing
Manual testing:
MSBUILDDEBUGENGINE
andMSBUILDDEBUGPATH
MSBUILDDEBUGPATH
for the binlogsFor using the correct msbuild
build.cmd
script~\msbuild\artifacts\bin\bootstrap\net472\MSBuild\Current
instead of{Visual Studio path }\MSBuild\Current
Risk
Low--spot fixes of refactorings.
Details
The bug is on this line:
msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs
Line 671 in 7ad4e1c
The PR that changed this line:
https://github.com/dotnet/msbuild/pull/10758/files#diff-2b0716a511d8f4ee690ebd5c3a59dec1e3f9a5eab4ab2a80a1018820a658accbL671
The code before and after
Before
logger
(BinaryLogger here) was always included.Changes Made
Made sure to include the BinaryLogger.
Notes
There is also a same mistake with misplaced brackets here:
https://github.com/dotnet/msbuild/pull/10758/files#diff-9ee98aebd9b1aea9900e0b2859bdcbe6b6bdda285f4b5771d9bdeb8b2f480b8dL1708
Also fixed this mistake in this PR.