0caa09b3dvendored gopkg.in/yaml.v3 into third_party/yaml.v3, inside magpie's tree, and TestNoEagerPackageRegexps, which walks the tree, has been red on main since: third_party/yaml.v3/encode.go:307:19: a package-level regexp is compiled at launch; use lazyre.New third_party/yaml.v3/resolve.go:124:22: (the same) yaml.v3 is its own module and can't import internal/lazyre, and its go.mod has no go line (Go 1.16 language, so no sync.OnceValue). base60float and yamlStyleFloat are now functions that compile their expression once behind a sync.Once; the patterns are as upstream's. MAGPIE.md lists this as the second change from v3.0.1. Seen red in the full suite of the OpenMausBot sessions change (mote, at13cb07fde+ that change), which doesn't touch yaml. Run (mote): gofmt -l clean; go vet in third_party/yaml.v3; go vet ./..., GOOS=linux -tags nogui and GOOS=windows go vet ./...; go test -count=1 -timeout 45m ./... at 59c5b59ea (ondf2b819c6): 100 packages ok, TestNoEagerPackageRegexps among them. Red before: the two lines above, on13cb07fde. After a rebase ontoea6470cb7(01c3efc4f's library change and a GUI test): vet as above, and go test . ./internal/sessions ./internal/library ./internal/catalog ok. After another onto79a30eb9c(edit/toml.go and provider/remote_follow.go perf): go vet ./..., go test . ./internal/sessions ./internal/edit ./internal/provider ok, at the pushed tree. Not run: upstream yaml.v3's own tests (not copied here, need gopkg.in/check.v1).
1.1 KiB
yaml.v3 v3.0.1, as magpie builds it
gopkg.in/yaml.v3 v3.0.1 (MIT and Apache-2.0, LICENSE and NOTICE here),
its non-test files as released (gofmt run over them), with two changes. The emitter's event
queue starts again once every event in it is written
(yaml_emitter_emit in emitterc.go). Upstream only appends to it, so an
encode held every event of the document until it ended: ~24 MB of
allocations when magpie writes dsh's model routes, on the first start of
each version and on every catalog change. go.yaml.in/yaml/v3 v3.0.5 has
the same queue.
And its two package-level regular expressions (base60float in encode.go, yamlStyleFloat in resolve.go) are compiled the first time they are used, behind a sync.Once, not when magpie starts: magpie's TestNoEagerPackageRegexps holds every package in its tree to that.
go.mod here names the module only: upstream's requires gopkg.in/check.v1 for its tests, which are not copied. go.mod's replace points here.
To take a new upstream version: copy its non-test files over these and
make the same change again; upstream's own tests (go test . in its
module) pass on it.