Backtestshugorun-20260922-141813#15116
common/hugo: Include aom, dav1d, and libavif in commands/env output
The merged fix was judged better than our patch.
In this judgment, Patch B = our agent, Patch A = the merged fix.
Both patches resolve the issue and use the same version strings (aom v3.14.1, dav1d 1.5.3, libavif v1.4.1), so correctness ties at the surface. A wins on the deeper criteria. On tests, A's regression exercises the exact reported surface — `hugo env` stdout via testscripts/commands/env.txt asserting each dependency line appears (and adds GOOS/GOVERSION coverage); this fails before and passes after and matches the user-visible symptom, whereas B's unit test on GetDependencyListNonGo is valid but one layer removed from the reported command. On craft, A addresses the root cause the existing `TODO(bep) get versions from the plugin setup` comment flags: it moves each version into a named constant sitting next to the WASM embed it describes (webp.go, avif.go, katex.go) with `Keep in sync with ...Makefile/package.json` comments, then exposes them through a single warpc.GetWASMDeps(), giving a single source of truth adjacent to the binaries. B instead re-hardcodes three more magic strings inline in hugo.go, perpetuating exactly the scattered pattern the TODO warns about. A's weaknesses are real but secondary: it pulls in KaTeX (beyond the three deps requested, though a legitimate WASM dep) and carries incidental whitespace/closing-paren reformatting in warpc.go and the dartSass append that are unrelated churn, plus a new common/hugo -> internal/warpc import coupling. These count against A on scope, and make this closer than a blowout, but they don't outweigh A's more faithful regression test and its structurally better fix. B is the cleaner minimal diff; A is the better fix.
The judge saw only the two patches, labelled A and B in random order, with issue links and version numbers removed. The reasoning above is shown verbatim.
Solve
6m 24s10 turns
Wall-clock time in the container
Full test suite
No new failures
3,676 passed · 94 skipped · 3,783 total
Contamination audit
Unknown
See the audit notes for this run
Patch size
17vs 51 merged
Changed lines, ours vs merged
The issue
View on GitHubCurrently, the hugo env command prints:
hugo v0.164.0-ce2470e7012b5ab5fc4e10ebe4027e9f8d9e00dc+withdeploy linux/amd64 BuildDate=2026-07-06T16:39:30Z VendorInfo=gohugoio
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.26.3"
github.com/webmproject/libwebp="v1.6.0"
github.com/sass/dart-sass/protocol="3.2.0"
github.com/sass/dart-sass/compiler="1.101.0"
github.com/sass/dart-sass/implementation="1.101.0"
I think it would make sense to also list...
aomedia.googlesource.com/aom="v3.14.1"
code.videolan.org/videolan/dav1d="1.5.3"
github.com/AOMediaCodec/libavif="v.14.1"
...assuming I have the correct source strings.
See:
<https://github.com/gohugoio/hugo/blob/a198116669fdfba2eeda4f1d63c055001a10142f/common/hugo/hugo.go#L213-L214>.
The two patches
common/hugo/hugo.goindex 28f8b9393..089d74790 100644@@ -211,7 +211,12 @@ func GetDependencyList() []string { // GetDependencyListNonGo returns a list of non-Go dependencies. func GetDependencyListNonGo() []string {- deps := []string{formatDep("github.com/webmproject/libwebp", "v1.6.0")} // via WASM. TODO(bep) get versions from the plugin setup.+ deps := []string{+ formatDep("github.com/webmproject/libwebp", "v1.6.0"),+ formatDep("aomedia.googlesource.com/aom", "v3.14.1"),+ formatDep("code.videolan.org/videolan/dav1d", "1.5.3"),+ formatDep("github.com/AOMediaCodec/libavif", "v1.4.1"),+ } // via WASM. TODO(bep) get versions from the plugin setup. if IsExtended { deps = append(common/hugo/hugo_test.goindex a572f74d4..c05e62fb4 100644@@ -50,6 +50,16 @@ func TestMarkupScope(t *testing.T) { c.Assert(GetMarkupScope(ctx), qt.Equals, "foo") } +func TestGetDependencyListNonGoAVIF(t *testing.T) {+ c := qt.New(t)++ deps := GetDependencyListNonGo()++ c.Assert(deps, qt.Contains, `aomedia.googlesource.com/aom="v3.14.1"`)+ c.Assert(deps, qt.Contains, `code.videolan.org/videolan/dav1d="1.5.3"`)+ c.Assert(deps, qt.Contains, `github.com/AOMediaCodec/libavif="v1.4.1"`)+}+ func TestGetBuildInfo(t *testing.T) { c := qt.New(t)
common/hugo/hugo.goindex 28f8b9393..ac490a84b 100644@@ -33,6 +33,7 @@ import ( "github.com/gohugoio/hugo/common/loggers" "github.com/gohugoio/hugo/common/version" "github.com/gohugoio/hugo/hugofs/files"+ "github.com/gohugoio/hugo/internal/warpc" "github.com/spf13/afero" @@ -211,7 +212,10 @@ func GetDependencyList() []string { // GetDependencyListNonGo returns a list of non-Go dependencies. func GetDependencyListNonGo() []string {- deps := []string{formatDep("github.com/webmproject/libwebp", "v1.6.0")} // via WASM. TODO(bep) get versions from the plugin setup.+ var deps []string+ for _, dep := range warpc.GetWASMDeps() {+ deps = append(deps, formatDep(dep[0], dep[1]))+ } if IsExtended { deps = append(@@ -225,7 +229,8 @@ func GetDependencyListNonGo() []string { if IsDartSassGeV2() { dartSassPath = "github.com/sass/dart-sass" }- deps = append(deps,+ deps = append(+ deps, formatDep(dartSassPath+"/protocol", dartSass.ProtocolVersion), formatDep(dartSassPath+"/compiler", dartSass.CompilerVersion), formatDep(dartSassPath+"/implementation", dartSass.ImplementationVersion),internal/warpc/avif.goindex baadaadd7..f080b87b1 100644@@ -25,6 +25,13 @@ import ( "github.com/gohugoio/hugo/common/hugio" ) +// Keep in sync with genavif/Makefile.+const (+ libavifVersion = "v1.4.1"+ aomVersion = "v3.14.1"+ dav1dVersion = "1.5.3"+)+ var ( _ SourceProvider = AvifInput{} _ DestinationProvider = AvifInput{}internal/warpc/katex.goindex 75c20117f..627f18e3a 100644@@ -17,6 +17,9 @@ import ( _ "embed" ) +// Keep in sync with js/package.json.+const katexVersion = "0.16.21"+ //go:embed wasm/renderkatex.wasm var katexWasm []byte internal/warpc/warpc.goindex b7763e782..be8e48bb5 100644@@ -48,6 +48,17 @@ const ( const currentVersion = 1 +// GetWASMDeps returns version information for the C libraries bundled as WASM.+func GetWASMDeps() [][2]string {+ return [][2]string{+ {"aomedia.googlesource.com/aom", aomVersion},+ {"code.videolan.org/videolan/dav1d", dav1dVersion},+ {"github.com/AOMediaCodec/libavif", libavifVersion},+ {"github.com/KaTeX/KaTeX", katexVersion},+ {"github.com/webmproject/libwebp", libwebpVersion},+ }+}+ //go:embed wasm/quickjs.wasm var quickjsWasm []byte @@ -348,7 +359,8 @@ func (d *dispatcher[Q, R]) inputBlobs() error { call.done() } return nil- }); err != nil {+ },+ ); err != nil { inputErr = err break }@@ -384,7 +396,8 @@ func (d *dispatcher[Q, R]) inputJSON() error { call.done() } return nil- }); err != nil {+ },+ ); err != nil { inputErr = err break }@@ -679,7 +692,8 @@ func newDispatcher[Q, R any](opts Options) (*dispatcherPool[Q, R], error) { if err != nil { return toErr("quickjs", errBuff, err) }- ctx = experimental.WithImportResolver(ctx,+ ctx = experimental.WithImportResolver(+ ctx, func(name string) api.Module { if name == opts.Runtime.Name { return runtimeInstanceinternal/warpc/webp.goindex 35ee98899..2c2be0bd4 100644@@ -28,6 +28,9 @@ import ( "github.com/gohugoio/hugo/common/hugio" ) +// Keep in sync with genwebp/Makefile.+const libwebpVersion = "v1.6.0"+ var ( _ SourceProvider = WebpInput{} _ DestinationProvider = WebpInput{}testscripts/commands/env.txtindex 742e05ffc..1ae628c6c 100644@@ -1,5 +1,12 @@ # Test the hugo env command. hugo env+stdout 'GOOS' stdout 'GOARCH'-! stderr .\ No newline at end of file+stdout 'GOVERSION'+stdout 'aomedia\.googlesource\.com/aom'+stdout 'code\.videolan\.org/videolan/dav1d'+stdout 'github\.com/AOMediaCodec/libavif'+stdout 'github\.com/KaTeX/KaTeX'+stdout 'github\.com/webmproject/libwebp'+! stderr .
What the agent reported
Review passed. The task is complete.
Summary
What was wrong: hugo env printed the libwebp WASM dependency version but omitted the three AVIF-related C libraries (aom, dav1d, libavif) that are also embedded via WASM. common/hugo/hugo.go's GetDependencyListNonGo() only listed libwebp.
What I changed:
common/hugo/hugo.go— added three unconditional entries toGetDependencyListNonGo()(right after libwebp, since all four are WASM-embedded in every build, not extended-only), using the existingformatDephelper:aomedia.googlesource.com/aom=v3.14.1code.videolan.org/videolan/dav1d=1.5.3github.com/AOMediaCodec/libavif=v1.4.1common/hugo/hugo_test.go— addedTestGetDependencyListNonGoAVIF, asserting all three exact rendered strings (path="version") appear in the output.
I sourced the authoritative versions from internal/warpc/genavif/Makefile (LIBAVIF_VERSION=v1.4.1, AOM_VERSION=v3.14.1, DAV1D_VERSION=1.5.3) and the module paths from that Makefile's clone URLs. Note the ticket's proposed libavif="v.14.1" was a typo — the correct version is v1.4.1.
Test evidence:
- Before the fix:
TestGetDependencyListNonGoAVIFFAILED —no matching element found, container held onlylibwebp. - After the fix:
./bt-test ./common/hugo/→ all pass, including the new test and the 4 pre-existing tests (ok github.com/gohugoio/hugo/common/hugo 0.077s).
Requirements checklist:
- List
aomedia.googlesource.com/aom="v3.14.1"in env output — implemented + tested. - List
code.videolan.org/videolan/dav1d="1.5.3"— implemented + tested. - List
github.com/AOMediaCodec/libavif="v1.4.1"(corrected from the report's typo) — implemented + tested. - "Assuming I have the correct source strings" (implicit ask to verify) — verified: paths and versions cross-checked against
internal/warpc/genavif/Makefile; libavif version corrected to v1.4.1.
All changes are left uncommitted in the working tree. The only other entries in git status (deleted AGENTS.md/CLAUDE.md) are pre-existing and unrelated.