Skip to content

Commit f2ac0ae

Browse files
danpmatloob
authored andcommitted
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 <[email protected]> Reviewed-by: Michael Matloob <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent a2c959f commit f2ac0ae

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

src/cmd/go/internal/cache/cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type Cache interface {
5959
// background cleanup work started earlier. Any cache trimming in one
6060
// process should not cause the invariants of this interface to be
6161
// violated in another process. Namely, a cache trim from one process should
62-
// not delete an ObjectID from disk that was recently Get or Put from
62+
// not delete an OutputID from disk that was recently Get or Put from
6363
// another process. As a rule of thumb, don't trim things used in the last
6464
// day.
6565
Close() error

src/cmd/go/internal/cache/prog.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"encoding/json"
1616
"errors"
1717
"fmt"
18-
"internal/goexperiment"
1918
"io"
2019
"log"
2120
"os"
@@ -330,18 +329,10 @@ func (c *ProgCache) Put(a ActionID, file io.ReadSeeker) (_ OutputID, size int64,
330329
return out, size, nil
331330
}
332331

333-
// For compatibility with Go 1.23/1.24 GOEXPERIMENT=gocacheprog users, also
334-
// populate the deprecated ObjectID field. This will be removed in Go 1.25.
335-
var deprecatedValue []byte
336-
if goexperiment.CacheProg {
337-
deprecatedValue = out[:]
338-
}
339-
340332
res, err := c.send(c.ctx, &cacheprog.Request{
341333
Command: cacheprog.CmdPut,
342334
ActionID: a[:],
343335
OutputID: out[:],
344-
ObjectID: deprecatedValue, // TODO(bradfitz): remove in Go 1.25
345336
Body: file,
346337
BodySize: size,
347338
})

src/cmd/go/internal/cacheprog/cacheprog.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ type Request struct {
7676
ActionID []byte `json:",omitempty"` // or nil if not used
7777

7878
// OutputID is stored with the body for "put" requests.
79-
//
80-
// Prior to Go 1.24, when GOCACHEPROG was still an experiment, this was
81-
// accidentally named ObjectID. It was renamed to OutputID in Go 1.24.
8279
OutputID []byte `json:",omitempty"` // or nil if not used
8380

8481
// Body is the body for "put" requests. It's sent after the JSON object
@@ -91,14 +88,6 @@ type Request struct {
9188

9289
// BodySize is the number of bytes of Body. If zero, the body isn't written.
9390
BodySize int64 `json:",omitempty"`
94-
95-
// ObjectID is the accidental spelling of OutputID that was used prior to Go
96-
// 1.24.
97-
//
98-
// Deprecated: use OutputID. This field is only populated temporarily for
99-
// backwards compatibility with Go 1.23 and earlier when
100-
// GOEXPERIMENT=gocacheprog is set. It will be removed in Go 1.25.
101-
ObjectID []byte `json:",omitempty"`
10291
}
10392

10493
// Response is the JSON response from the child process to the go command.
@@ -125,7 +114,7 @@ type Response struct {
125114
// For "get" requests.
126115

127116
Miss bool `json:",omitempty"` // cache miss
128-
OutputID []byte `json:",omitempty"` // the ObjectID stored with the body
117+
OutputID []byte `json:",omitempty"` // the OutputID stored with the body
129118
Size int64 `json:",omitempty"` // body size in bytes
130119
Time *time.Time `json:",omitempty"` // when the object was put in the cache (optional; used for cache expiration)
131120

0 commit comments

Comments
 (0)