msbuild
msbuild copied to clipboard
Fail build on double write
@davkean fixed a double write issue in the project system today (https://github.com/dotnet/project-system/pull/5080).
We'd like to have a way to fail our build if a double write is reintroduced.
Is this possible, and if not, what would it take to add this?
@jmarolf points out:
Roslyn uses a tool called BuildBoss which reads the binlog after a build and fails if there is a double-write
MSBuild is mostly unaware of the concept of "outputs" or "file writes" that you'd want to have to get this right. BuildBoss and the log viewer's multi-writes view are woefully incomplete, especially once more-complex tasks and targets get involved.
To be complete, we'd need traced I/O at a variety of levels, like BuildXL has. Plumbing that into MSBuild is not feasible.
We should add a warning wave for the low-hanging fruit here, though.
Yes. Even BuildBoss didn't work sufficiently for us, since we have a large backlog of doublewrites to work through. I wrote a similar tool reading binlogs that supports a baseline of the current issues to protect from regressions and new instances. Hope to add it in a more general form to one of Kirill's build tools later this year.