Skip to content

Commit

Permalink
Fix reproducibility of local builds (#76253)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jaredpar authored Dec 4, 2024
1 parent 9bf65ae commit bbff74e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ UnitTestResults.html
*.nuget.props
*.nuget.targets
project.lock.json
msbuild.binlog
*.binlog
*.project.lock.json

*_i.c
Expand Down
5 changes: 4 additions & 1 deletion eng/test-determinism.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ function Test-Build([string]$rootDir, $dataMap, [string]$logFileName) {
Write-Host "`tVerified $relativeDir\$fileName"
}

if (-not $allGood) {
if ($allGood) {
Write-Host "Determinism check succeeded"
}
else {
Write-Host "Determinism failed for the following binaries:"
foreach ($name in $errorList) {
Write-Host "`t$name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<Compile Include="$(MSBuildThisFileDirectory)SegmentedList`1.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Internal\Strings.resx" GenerateSource="true" ClassName="Microsoft.CodeAnalysis.Collections.Internal.SR" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Internal\Strings.resx" GenerateSource="true" ClassName="Microsoft.CodeAnalysis.Collections.Internal.SR" ManifestResourceName="Microsoft.CodeAnalysis.Internal.Strings" />
</ItemGroup>
<ItemGroup Condition="'$(DefaultLanguageSourceExtension)' != '' AND '$(BuildingInsideVisualStudio)' != 'true'">
<ExpectedCompile Include="$(MSBuildThisFileDirectory)**\*$(DefaultLanguageSourceExtension)" />
Expand Down

0 comments on commit bbff74e

Please sign in to comment.