msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Fail build on double write

Open drewnoakes opened this issue 5 years ago • 3 comments

@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?

drewnoakes avatar Jul 18 '19 07:07 drewnoakes

@jmarolf points out:

Roslyn uses a tool called BuildBoss which reads the binlog after a build and fails if there is a double-write

drewnoakes avatar Jul 18 '19 23:07 drewnoakes

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.

rainersigwald avatar Jul 22 '19 17:07 rainersigwald

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.

JustinSchneiderPBI avatar Feb 12 '24 20:02 JustinSchneiderPBI