KirillOsenkov / MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.
MIT License
1.47k stars 198 forks source link

Double-write not detected when two Cscs write to the same output .dll simultaneously #779

Open KirillOsenkov opened 6 months ago

KirillOsenkov commented 6 months ago

https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/b56ebfb2caea11a3ffad279aa25ddd0f67a115da/src/StructuredLogger/Analyzers/DoubleWritesAnalyzer.cs#L72,L96

https://github.com/dotnet/roslyn/pull/73468#issuecomment-2110626616

https://artprodcus3.artifacts.visualstudio.com/A6fcc92e5-73a7-4f88-8d13-d9045b45fb27/cbb18261-c48f-4abb-8651-8cdcb5474649/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2RuY2VuZy1wdWJsaWMvcHJvamVjdElkL2NiYjE4MjYxLWM0OGYtNGFiYi04NjUxLThjZGNiNTQ3NDY0OS9idWlsZElkLzY2OTI1NS9hcnRpZmFjdE5hbWUvV2luZG93c194NjRfQnVpbGRMb2dzX0F0dGVtcHQx0/content?format=zip

https://github.com/dotnet/source-build/issues/4390#issuecomment-2104558290

https://github.com/dotnet/source-build/issues/4390#issuecomment-2104957177

Two Cscs writing to the same output is not detected as a double-write because the source file is considered the same assembly. The "source" should be ephemeral - it's immaterial where these writes come from as long as the destination is the same.

JanKrivanek commented 6 months ago

FYI @ladipro