Use fork-sync and make a local copy of fmt#15919
Use fork-sync and make a local copy of fmt#15919vmoroz wants to merge 3 commits intomicrosoft:mainfrom
Conversation
|
Can we not pull fmt as a package and patch it if need be? Do we need a source copy? |
All major OSS projects typically have a local copy of 3rd party code. It makes it easy to support them. |
That's not true? Most OSS projects use a package or dep manager to download them? |
Description
Type of Change
Why
Third-party dependencies in RNW (fmt, Folly, ReactCommon) use a bespoke
MSBuild download-unzip-overlay pipeline that has no conflict detection, no
3-way merge, and duplicates the same concepts per library. This PR begins
adopting
@rnx-kit/fork-sync— the same tool used in hermes-windows — to getGit 3-way merges, AI-assisted conflict resolution, and a unified
manifest-driven workflow.
fmt is the first dependency to migrate because it is the simplest case: a
small library with no active patches.
What
Phase 0 — fork-sync infrastructure:
@rnw-scripts/fork-syncpackage — thin wrapper that invokes@rnx-kit/fork-syncwith-Cpointing to the repo root.sync-manifest.jsonat the repo root listing fmt as the firstmanaged dependency.
/.sync/to.gitignore(fork-sync's working directory).fork-syncandfork-sync:statusscripts to rootpackage.json.Phase 1 — migrate fmt to fork-sync:
vnext/external/fmt/withsync-config.json,.syncignore, andcgmanifest.json.vnext/external/.clang-format(DisableFormat: true) to preventformatting of vendored source files.
ClCompile/ClIncludeentries intoShared.vcxitems— fmt isnow compiled inline instead of as a separate static library.
<ClCompile Update="$(ExternalDir)**">block inShared.vcxitemsso all future external sources automatically get theright compiler settings (no PCH, no WinRT, common preprocessor defs).
$(ExternalDir)inDirectory.Build.propspointing tovnext\external\.React.Cpp.props,Folly.vcxproj, andMicrosoft.ReactNative.vcxprojfrom$(FmtDir)includeto$(ExternalDir)fmt\include.FmtVersion,FmtCommitHash, andFmtDirproperties fromDirectory.Build.props.vnext/fmt/directory (vcxproj, filters, pch files,clang-format, packages.lock.json).
.slnfilesand 2
.slnffiles.ProjectReferenceto fmt fromFolly.vcxproj.Screenshots
N/A
Testing
Microsoft.ReactNative.vcxproj(Debug|x64) — fmt compilescorrectly as part of Shared.
Folly.vcxproj(Debug|x64) — finds fmt headers via updatedinclude path.
React.Windows.Desktop.DLL.vcxproj(Debug|x64) — Desktop targetalso works.
yarn formatno longer reformats vendored fmt source (thanksto
vnext/external/.clang-format).Changelog
Should this change be included in the release notes: no
Microsoft Reviewers: Open in CodeFlow