Copy Mercurial from only one LibChorus TFM build - #401
Merged
Merged
Conversation
SIL.Chorus.Mercurial adds CopyFiles and AdjustFixUtf8 to BuildDependsOn, so LibChorus's net462 and netstandard2.0 inner builds both ran them in parallel and wrote the same Mercurial/mercurial.ini. That could fail Windows CI with MSB3491 (file in use). Run them only in the netstandard2.0 build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
I've run into the same thing, and had to re-run the CI workflows a few times until the timing of the two builds happened to diverge enough that they didn't hit the |
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed a flakey CI failure due to duplicate work when building to frameworks at once.
AI summary
Windows CI sometimes fails building LibChorus with:
(seen in https://github.com/sillsdev/chorus/actions/runs/36093584645)
Cause: SIL.Chorus.Mercurial adds
CopyFilesandAdjustFixUtf8toBuildDependsOn. LibChorus targetsnet462;netstandard2.0, so both inner builds run those targets in parallel and write the same$(SolutionDir)/Mercurial/mercurial.ini.Fix:
LibChorus.csprojsetsMercurial4ChorusTargetFrameworktonetstandard2.0.Directory.Build.targetsremoves;CopyFiles;AdjustFixUtf8fromBuildDependsOnin the other inner builds. This has to be in a.targetsfile because NuGet's package targets load after the project file and beforeDirectory.Build.targets.Unescapeis needed because property functions escape;in their result.netstandard2.0was picked because projects referencing LibChorus call its inner builds directly (skipping the outer build), andnetstandard2.0is built on every OS and CI leg. The package'sbuildMultiTargetingtargets do nothing because the outerBuildtarget doesn't readBuildDependsOn, so moving the work to the outer build would mean more plumbing.The LibChorus nuspec is unchanged: the SIL.Chorus.Mercurial dependency keeps the same excludes.
A more robust fix belongs upstream in sillsdev/Mercurial4Chorus: write
mercurial.iniwithOverwrite="true"/WriteOnlyWhenDifferent="true"instead of appending, and add an opt-out property. The override here depends on the package's exact;CopyFiles;AdjustFixUtf8text.Test plan
Mercurial/and randotnet build Chorus.sln -mfour times on Windows (SDK 11 RC; three with--no-incremental): all succeeded, each detailed log showsCopyFilesandAdjustFixUtf8running once, in thenetstandard2.0builddotnet build Chorus.sln -mwith SDK 8.0.425 (CI's version): succeeded, oneAdjustFixUtf8mercurial.inihas exactly onefixutf8line after each buildHgRepositoryTestsandHgWrappingTestspass on net8.0 and net462, so tests find the repo'sMercurial/folder🤖 Generated with Claude Code
This change is