Use auto-vendor to eliminate vendor content from patch 0001#2367
Draft
gdams wants to merge 3 commits into
Draft
Conversation
eed097d to
1c51290
Compare
Replace the ~45,000-line vendor patch with a ~240-line patch that only tracks go.mod, go.sum, and related non-vendor files. Vendor directories are now regenerated automatically during 'git go-patch apply' and 'submodule-refresh' using 'go mod vendor'. Changes: - .git-go-patch: bump MinimumToolVersion to v1.1.0 - patches/0001: strip vendor diffs, add 'auto vendor src src/cmd' command - submodule-refresh.go: use ScanAutoVendorPatches + ApplyIndividually - eng/_util/go.mod: update go-infra dependency Depends on: microsoft/go-infra#506
1c51290 to
eadd75a
Compare
…n submodule-refresh - Include all 27 cryptobackend subpackage imports in deps_ignore.go so go mod vendor pulls in every needed package during auto-vendor. - Add a final vendor pass in submodule-refresh after all patches are applied, to pick up imports added by later patches (e.g. patch 0002). - Update go-infra dependency to 70acb19 (vendor.go fixes).
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.
Summary
Eliminates ~44k lines from the vendor patch by using the new
auto vendorcommand ingit go-patch. Vendor directories are now regenerated automatically viago mod vendorduring apply, rather than being stored in the patch file.Depends on
go.modto point at released version)Changes
.git-go-patchpatches/0001-Vendor-external-dependencies.patchauto vendor src src/cmdcommand added to commit message.eng/_util/cmd/submodule-refresh/submodule-refresh.goApplyIndividuallywithRunGoModVendorcallback (CI compatibility).eng/_util/go.mod/go.sumgo-infradependency to include auto-vendor support.How it works
The patch commit message contains:
git go-patch extractstrips vendor diffs from the patch file automatically.git go-patch applyandsubmodule-refreshapply the patch, then rungo mod vendorinsrc/andsrc/cmd/, and amend the commit.Before / After
Before:
0001-Vendor-external-dependencies.patch= 42,929 lines of vendored Go sourceAfter:
0001-Vendor-external-dependencies.patch= 238 lines (go.mod, go.sum, and a few small files)TODO before merging
eng/_util/go.modto point at the merged go-infra commit on main