From f2ac0ae8bbb5d2fad29f0f434f3a26649976cf2c Mon Sep 17 00:00:00 2001 From: Dan Peterson Date: Thu, 13 Feb 2025 17:09:23 -0400 Subject: [PATCH] cmd/go/internal/cacheprog: drop Request.ObjectID ObjectID was a misnaming of OutputID from cacheprog's initial implementation. It was maintained for compatibility with existing cacheprog users in 1.24 but can be removed in 1.25. Updates #64876 Change-Id: I8ff53bc581c16b7739e1cfbaa8bd35d285d3231d Reviewed-on: https://go-review.googlesource.com/c/go/+/649435 Reviewed-by: Sam Thanawalla Reviewed-by: Michael Matloob LUCI-TryBot-Result: Go LUCI --- src/cmd/go/internal/cache/cache.go | 2 +- src/cmd/go/internal/cache/prog.go | 9 --------- src/cmd/go/internal/cacheprog/cacheprog.go | 13 +------------ 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/cmd/go/internal/cache/cache.go b/src/cmd/go/internal/cache/cache.go index 1bef1db08c..26913dd959 100644 --- a/src/cmd/go/internal/cache/cache.go +++ b/src/cmd/go/internal/cache/cache.go @@ -59,7 +59,7 @@ type Cache interface { // background cleanup work started earlier. Any cache trimming in one // process should not cause the invariants of this interface to be // violated in another process. Namely, a cache trim from one process should - // not delete an ObjectID from disk that was recently Get or Put from + // not delete an OutputID from disk that was recently Get or Put from // another process. As a rule of thumb, don't trim things used in the last // day. Close() error diff --git a/src/cmd/go/internal/cache/prog.go b/src/cmd/go/internal/cache/prog.go index bfddf5e4de..74e9dc9de5 100644 --- a/src/cmd/go/internal/cache/prog.go +++ b/src/cmd/go/internal/cache/prog.go @@ -15,7 +15,6 @@ import ( "encoding/json" "errors" "fmt" - "internal/goexperiment" "io" "log" "os" @@ -330,18 +329,10 @@ func (c *ProgCache) Put(a ActionID, file io.ReadSeeker) (_ OutputID, size int64, return out, size, nil } - // For compatibility with Go 1.23/1.24 GOEXPERIMENT=gocacheprog users, also - // populate the deprecated ObjectID field. This will be removed in Go 1.25. - var deprecatedValue []byte - if goexperiment.CacheProg { - deprecatedValue = out[:] - } - res, err := c.send(c.ctx, &cacheprog.Request{ Command: cacheprog.CmdPut, ActionID: a[:], OutputID: out[:], - ObjectID: deprecatedValue, // TODO(bradfitz): remove in Go 1.25 Body: file, BodySize: size, }) diff --git a/src/cmd/go/internal/cacheprog/cacheprog.go b/src/cmd/go/internal/cacheprog/cacheprog.go index a2796592df..9379636e5a 100644 --- a/src/cmd/go/internal/cacheprog/cacheprog.go +++ b/src/cmd/go/internal/cacheprog/cacheprog.go @@ -76,9 +76,6 @@ type Request struct { ActionID []byte `json:",omitempty"` // or nil if not used // OutputID is stored with the body for "put" requests. - // - // Prior to Go 1.24, when GOCACHEPROG was still an experiment, this was - // accidentally named ObjectID. It was renamed to OutputID in Go 1.24. OutputID []byte `json:",omitempty"` // or nil if not used // Body is the body for "put" requests. It's sent after the JSON object @@ -91,14 +88,6 @@ type Request struct { // BodySize is the number of bytes of Body. If zero, the body isn't written. BodySize int64 `json:",omitempty"` - - // ObjectID is the accidental spelling of OutputID that was used prior to Go - // 1.24. - // - // Deprecated: use OutputID. This field is only populated temporarily for - // backwards compatibility with Go 1.23 and earlier when - // GOEXPERIMENT=gocacheprog is set. It will be removed in Go 1.25. - ObjectID []byte `json:",omitempty"` } // Response is the JSON response from the child process to the go command. @@ -125,7 +114,7 @@ type Response struct { // For "get" requests. Miss bool `json:",omitempty"` // cache miss - OutputID []byte `json:",omitempty"` // the ObjectID stored with the body + OutputID []byte `json:",omitempty"` // the OutputID stored with the body Size int64 `json:",omitempty"` // body size in bytes Time *time.Time `json:",omitempty"` // when the object was put in the cache (optional; used for cache expiration) -- 2.51.0