From f214a760754ac0584999fb8098ce6172181ed791 Mon Sep 17 00:00:00 2001 From: "Hana (Hyang-Ah) Kim" Date: Mon, 24 Jun 2024 11:45:12 -0400 Subject: [PATCH] cmd/vendor: vendor x/telemetry@38a4430 For #68109 Change-Id: I73a3d23dd6c15ff4954ebe7a52c6c308fea947ae Reviewed-on: https://go-review.googlesource.com/c/go/+/593684 Reviewed-by: Michael Matloob LUCI-TryBot-Result: Go LUCI Auto-Submit: Hyang-Ah Hana Kim --- src/cmd/go.mod | 2 +- src/cmd/go.sum | 2 ++ .../x/telemetry/internal/telemetry/proginfo.go | 11 +++++++---- src/cmd/vendor/modules.txt | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/cmd/go.mod b/src/cmd/go.mod index 0a17a414b5f..3058165dbf3 100644 --- a/src/cmd/go.mod +++ b/src/cmd/go.mod @@ -9,7 +9,7 @@ require ( golang.org/x/mod v0.18.0 golang.org/x/sync v0.7.0 golang.org/x/sys v0.21.0 - golang.org/x/telemetry v0.0.0-20240621194115-a740542b267c + golang.org/x/telemetry v0.0.0-20240624145040-38a44306ed05 golang.org/x/term v0.20.0 golang.org/x/tools v0.22.1-0.20240618181713-f2d2ebe43e72 ) diff --git a/src/cmd/go.sum b/src/cmd/go.sum index 49849d10b4e..4449bb0b2c0 100644 --- a/src/cmd/go.sum +++ b/src/cmd/go.sum @@ -18,6 +18,8 @@ golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240621194115-a740542b267c h1:zNxtD9mZQCgRwCNanVRlJ/XlOyATHcbR+09LzoArRl4= golang.org/x/telemetry v0.0.0-20240621194115-a740542b267c/go.mod h1:n38mvGdgc4dA684EC4NwQwoPKSw4jyKw8/DgZHDA1Dk= +golang.org/x/telemetry v0.0.0-20240624145040-38a44306ed05 h1:fzUVo05u80jHc31RGqQsPYEAGMXS8tyK5azYUK2sSms= +golang.org/x/telemetry v0.0.0-20240624145040-38a44306ed05/go.mod h1:n38mvGdgc4dA684EC4NwQwoPKSw4jyKw8/DgZHDA1Dk= golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= diff --git a/src/cmd/vendor/golang.org/x/telemetry/internal/telemetry/proginfo.go b/src/cmd/vendor/golang.org/x/telemetry/internal/telemetry/proginfo.go index 20be9664fc8..60cb0edc792 100644 --- a/src/cmd/vendor/golang.org/x/telemetry/internal/telemetry/proginfo.go +++ b/src/cmd/vendor/golang.org/x/telemetry/internal/telemetry/proginfo.go @@ -9,8 +9,6 @@ import ( "path/filepath" "runtime/debug" "strings" - - "golang.org/x/mod/module" ) // IsToolchainProgram reports whether a program with the given path is a Go @@ -43,8 +41,13 @@ func ProgramInfo(info *debug.BuildInfo) (goVers, progPath, progVers string) { progVers = goVers } else { progVers = info.Main.Version - if strings.Contains(progVers, "devel") || module.IsPseudoVersion(progVers) { - // We don't want to track pseudo versions, but may want to track prereleases. + if strings.Contains(progVers, "devel") || strings.Count(progVers, "-") > 1 { + // Heuristically mark all pseudo-version-like version strings as "devel" + // to avoid creating too many counter files. + // We should not use regexp that pulls in large dependencies. + // Pseudo-versions have at least three parts (https://go.dev/ref/mod#pseudo-versions). + // This heuristic still allows use to track prerelease + // versions (e.g. gopls@v0.16.0-pre.1, vscgo@v0.42.0-rc.1). progVers = "devel" } } diff --git a/src/cmd/vendor/modules.txt b/src/cmd/vendor/modules.txt index 5184adb1f2a..f4eefe4a1d5 100644 --- a/src/cmd/vendor/modules.txt +++ b/src/cmd/vendor/modules.txt @@ -45,7 +45,7 @@ golang.org/x/sync/semaphore golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/telemetry v0.0.0-20240621194115-a740542b267c +# golang.org/x/telemetry v0.0.0-20240624145040-38a44306ed05 ## explicit; go 1.20 golang.org/x/telemetry golang.org/x/telemetry/counter