Skip to content

Commit bbff74e

Browse files
authored
Fix reproducibility of local builds (#76253)
The `test-determinism.cmd` run was failing on my local machine. After a lot of debugging I was able to track it down to a bug in [xliff][xliff]. The full details are in the bug. The summary though is there is a race condition with how the manifest resource name is generated for RESX files when doing local builds in arcade. To work around this I'm just adding an explicit manifest resource name so that the race doesn't come into play. The race only occurs when the RESX is outside the directory cone of the project that is including it hence only needed to update this file. [xliff]: dotnet/arcade#15296
1 parent 9bf65ae commit bbff74e

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ UnitTestResults.html
4949
*.nuget.props
5050
*.nuget.targets
5151
project.lock.json
52-
msbuild.binlog
52+
*.binlog
5353
*.project.lock.json
5454

5555
*_i.c

eng/test-determinism.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ function Test-Build([string]$rootDir, $dataMap, [string]$logFileName) {
223223
Write-Host "`tVerified $relativeDir\$fileName"
224224
}
225225

226-
if (-not $allGood) {
226+
if ($allGood) {
227+
Write-Host "Determinism check succeeded"
228+
}
229+
else {
227230
Write-Host "Determinism failed for the following binaries:"
228231
foreach ($name in $errorList) {
229232
Write-Host "`t$name"

src/Dependencies/Collections/Microsoft.CodeAnalysis.Collections.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<Compile Include="$(MSBuildThisFileDirectory)SegmentedList`1.cs" />
6666
</ItemGroup>
6767
<ItemGroup>
68-
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Internal\Strings.resx" GenerateSource="true" ClassName="Microsoft.CodeAnalysis.Collections.Internal.SR" />
68+
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Internal\Strings.resx" GenerateSource="true" ClassName="Microsoft.CodeAnalysis.Collections.Internal.SR" ManifestResourceName="Microsoft.CodeAnalysis.Internal.Strings" />
6969
</ItemGroup>
7070
<ItemGroup Condition="'$(DefaultLanguageSourceExtension)' != '' AND '$(BuildingInsideVisualStudio)' != 'true'">
7171
<ExpectedCompile Include="$(MSBuildThisFileDirectory)**\*$(DefaultLanguageSourceExtension)" />

0 commit comments

Comments
 (0)