diff --git a/Makefile b/Makefile index 8cfd790e0..928f9ac09 100644 --- a/Makefile +++ b/Makefile @@ -582,12 +582,16 @@ gofail-disable: install-gofail PASSES="toggle_failpoints" ./test.sh .PHONY: verify -verify: verify-go-versions +verify: verify-go-versions verify-dep .PHONY: verify-go-versions verify-go-versions: ./scripts/verify_go_versions.sh +.PHONY: verify-dep +verify-dep: + PASSES="dep" ./test.sh 2<&1 + .PHONY: fix fix: sync-toolchain-directive ./scripts/fix.sh diff --git a/test.sh b/test.sh index a9c883e04..e14bb4249 100755 --- a/test.sh +++ b/test.sh @@ -610,7 +610,7 @@ function dump_deps_of_module() { if ! module=$(run go list -m); then return 255 fi - run go list -f "{{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},${module}{{end}}{{end}}" -m all + run go mod edit -json | jq -r '.Require[] | .Path+","+.Version+","+if .Indirect then " (indirect)" else "" end+",'"${module}"'"' } # Checks whether dependencies are consistent across modules @@ -623,7 +623,7 @@ function dep_pass { for dup in ${duplicates}; do log_error "FAIL: inconsistent versions for depencency: ${dup}" - echo "${all_dependencies}" | grep "${dup}" | sed "s|\\([^,]*\\),\\([^,]*\\),\\([^,]*\\)| - \\1@\\2 from: \\3|g" + echo "${all_dependencies}" | grep "${dup}," | sed 's|\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\)| - \1@\2\3 from: \4|g' done if [[ -n "${duplicates}" ]]; then log_error "FAIL: inconsistent dependencies"