Description
TL;DR
Replace all our git submodule
s with git subtree
s. This allows us to gate CI on tools, since contributors can just fix tools in tree and tool devs synchronize the in-tree state with their repo at their leisure.
Links and Details
Git submodules shallowly add just the commit id of the remote repository to the rustc repository. This means contributors need to use git submodule update
whenever they change branches. It also means, that if you make a change to rustc that breaks a submodule, you need to do a second PR just for the submodule and point the submodule at that PR. This can quickly get out of hand with quickly changing projects like rustc and its tools.
Git subtrees on the other hand basically work like a monorepo. All tool sources are in tree, and git subtree is just a synchronization tool to push changes that happened to the in-tree tool sources back to the tool repository and vice versa. Git subtree preserves commits on both sides, so changes to the tool are fully traceable in the rustc repository and rustc changes that touched the tool sources show up in the tool repository.
This creates some synchronization overhead for tool developers, but the current status quo with submodules is worse, because we have tool breakages and synchronization overhead. We don't have much experience with git subtree
, so we'll have to see whether this is actually a better experience. The fact that we get rid of tool breakages without slowing down tool development in its own repo seems like a great boon even if the synchronization overhead stays the same.
- PR documenting
git subtree
usage: Explain how to work with subtree rust#70654 - git subtree tracking issue: Replace submodules with subtrees rust#70651
- Porting clippy to subtree: Make clippy a git subtree instead of a git submodule rust#70655