Using /graphBuild May Result in Projects Silently Being Excluded
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
### 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
```
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\amd64\MSBuild.exe" C:\REDACTED\Utilities.sln /m /graphBuild /t:Build /p:Configuration=Release
```
Yields
```
Microsoft (R) Build Engine version 16.5.0-preview-20113-03+04ed36359 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 3/4/2020 3:41:34 PM.
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.10
```
Excluding the `/graphBuild` command yields the expected build.
```
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\amd64\MSBuild.exe" C:\REDACTED\Utilities.sln /m /t:Build /p:Configuration=Release
```
```
Microsoft (R) Build Engine version 16.5.0-preview-20113-03+04ed36359 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 3/4/2020 3:43:33 PM.
1>Project "C:\REDACTED\Utilities.sln" on node
1 (Build target(s)).
1>ValidateSolutionConfiguration:
Building solution configuration "Release|Any CPU".
1>Project "C:\REDACTED\Utilities.sln" (1) is building "C:\REDACTED\Utilities.synproj" (2) on node 1 (default targets).
2>PrepareForBuild:
Creating directory "C:\REDACTED\..\bin\Client\".
Creating directory "C:\REDACTED\obj\Release\".
1>Project "C:\REDACTED\Utilities.sln" (1) is building "C:\REDACTED\Structures.synproj" (3) on node 2 (default targets).
3>PrepareForBuild:
Creating directory "C:\REDACTED\obj\Release\".
1>Project "C:\REDACTED\Utilities.sln" (1) is
building "C:\REDACTED\Schemas\Repository.synproj" (4) on node 3 (default targets).
4>BeforeBuild:
Creating directory "C:\REDACTED\Schemas\obj\Release\AnyCPU".
FixSDI2015Bug:
Fixing Bug Caused By SDI 2501 Not Deleting the Temp Schema
CopyFilesToOutputDirectory:
Creating directory "..\..\bin\rpsdat".
Creating directory "..\..\bin\rpsdat".
Creating directory "..\..\bin\rpsdat".
Creating directory "..\..\bin\rpsdat".
Copying file from "C:\REDACTED\Schemas\obj\Release\AnyCPU\rpstext.eng" to "C:\REDACTED\bin\rpsdat\rpstext.eng".
Copying file from "C:\REDACTED\Schemas\obj\Release\AnyCPU\rpsmain.en1" to "C:\REDACTED\bin\rpsdat\rpsmain.en1".
Copying file from "C:\REDACTED\Schemas\obj\Release\AnyCPU\rpstext.en1" to "C:\REDACTED\bin\rpsdat\rpstext.en1".
Copying file from "C:\REDACTED\Schemas\obj\Release\AnyCPU\rpsmain.eng" to "C:\REDACTED\bin\rpsdat\rpsmain.eng".
Repository ->
4>Done Building Project "C:\REDACTED\Schemas\Repository.synproj" (default targets).
3>CopyFilesToOutputDirectory:
Copying file from "C:\REDACTED\obj\Release\SynergyStructures.elb" to "C:\REDACTED\bin\Client\SynergyStructures.elb".
SynergyStructures -> C:\REDACTED\bin\Client\SynergyStructures.elb
3>Done Building Project "C:\REDACTED\SynergyStructures.synproj" (default targets).
2>CopyFilesToOutputDirectory:
Copying file from "C:\REDACTED\obj\Release\utilities.elb" to "C:\REDACTED\bin\Client\utilities.elb".
Utilities -> C:\REDACTED\bin\Client\utilities.elb
2>Done Building Project "C:\REDACTED\Utilities.synproj" (default targets).
1>Done Building Project "C:\REDACTED\Utilities.sln" (Build target(s)).
Build succeeded.
0 Error(s)
Time Elapsed 00:01:08.90
```
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:
```
Microsoft (R) Build Engine version 16.5.0-preview-20113-03+04ed36359 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
16.5.0.11303
```
OS info: Windows 10 1909
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.