-
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
Using /graphBuild May Result in Projects Silently Being Excluded #5159
Comments
@cdmihai can you take a look? Is this just that |
I see you are using a custom project, Since no projects are found in your graph based solution build, I suspect that |
@cdmihai @rainersigwald It looks like the If I identify my Edit for clarity: We do support msbuild p2p. There are no references involved in my test case. |
It's most likely this line: https://github.com/microsoft/msbuild/blob/master/src/Build/Graph/GraphBuilder.cs#L255-L258 At the very least, a warning should be written saying there's ignored projects from the solution. |
@madkat Thanks for chiming in (this is the third party vendor). In our test case we have ProjectReferences but as @cdmihai just pointed out this does not show as a |
There is no warning happening at normal, detailed or diagnostic verbosity. Maybe that would be different if I had a C# project present. Edit: No, there is no indicator that a project was skipped. Even on diagnostic. |
If I have a C# project reference a Synergy .NET project, there is no problem. We are evaluated correctly by the graph. F:\temp\msftsample>msbuild /m /isolate /graphBuild MSBuildGraphTestSynNet.sln /v:minimal MSBuildGraphTestSynNet -> F:\temp\msftsample\bin\Debug\MSBuildGraphTestSynNet.exe |
I noticed that in our testing too; In addition the Repository project type also worked (which is also referenced by a C# Project). However Traditional Synergy Projects are not recognized. Does a Repository Project type alone work? |
It works because the C# project passes the filter criteria, and then graph construction finds the reference to the I'm thinking a better fix would be to just mimic what vanilla msbuild does when it interprets solutions and finds a project that's not msbuild syntax (if it fails this check https://github.com/Microsoft/msbuild/blob/07c3b3392dc05e0e3aba18bdec235a374aa72301/src/Build/Construction/Solution/ProjectInSolution.cs#L279-L362). Which means anything that looks like an msbuild project file will get accepted, and for the rest I'll reverse engineer what vanilla msbuild does. In the meantime, as @madkat observed, a workaround is to add the C# GUID to the .synproj. Let us know if using |
We are SUPER Excited for this; as I mentioned in that other thread we've got a large solution (~3500 Projects) split around 2200 SYNPROJ and 1300 CSPROJ with a VERY complex dependency tree. We've been given permission to throw some pretty significant hardware at it in an attempt to speed up build times. In testing in Azure with 64 Cores / 128GB RAM / 64GB RAM Drive (Shared) [F64s_v2 instance] we have seen build times of around 17 minutes. Comparatively on a local Hyper-V instance on my dev machine VM with 16 Cores (i7-8770) / 36GB RAM / NVMe SSD we see around 30 minutes. Our target is 10 minutes from clean build. We are hoping that we will avoid seeing the bottlenecking behavior late in the build and will report back. |
To follow up on this: While the work around of changing the Project Type GUID in the solution file is working we are encountering a new issue when building via To be clear: The ask on this issue is a fix to NOT Exclude non-CSPROJ Types when building via |
That's correct, given my current understanding right now, I think the ideal solution is to mimic vanilla msbuild's behaviour as reasonable as possible. And at the very least, provide warnings for any projects that do get skipped from the solution. |
Looks like same happens with WIX installer project: https://wixtoolset.org/ |
@iskiselev Yup and without the escape hatch (still unimplemented see #5931) you might be out of luck without that reference. For us we added the type on #5698 but that's not a great long term solution, maybe someone over in the WiX Project might be willing to submit a PR? |
Steps to reproduce
Attempting to use the new /graphBuild switch may result in Projects being excluded from MSBuild with no warning to indicate projects have been excluded.
For example
Yields
Excluding the
/graphBuild
command yields the expected build.This can be especially dangerous if you have a large mixed-technology solution file (once that contains a significant amount of C# in addition to the unsupported SDK) because the build will "appear to work", and unless you are explicitly checking for the binaries produced by the build this issue may go undetected.
Based on https://github.com/microsoft/msbuild/blob/master/documentation/specs/static-graph.md it seems to indicate that Existing functionality must still work. This new behavior is opt-in only. We assume this means that the third party SDK does not properly support the new graphBuild behavior; but that msbuild should fall back to the previous behavior in times of difficulty.
The vendor of the SDK Extending MSBuild has been notified to see if they can conform to the Static Graph standard listed above.
Environment data
msbuild /version
output:OS info: Windows 10 1909
The text was updated successfully, but these errors were encountered: