Skip to content

Commit d939a69

Browse files
committed
go.mod: update gocache to commit 6d6288323ca2
Update naming of "object ID" to "output ID" to match the approved style from https://go-review.googlesource.com/c/go/+/626035.
1 parent 98aba19 commit d939a69

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

go.mod

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ require (
88
github.com/aws/aws-sdk-go-v2/config v1.27.28
99
github.com/aws/aws-sdk-go-v2/service/s3 v1.59.0
1010
github.com/creachadair/atomicfile v0.3.5
11-
github.com/creachadair/command v0.1.16
12-
github.com/creachadair/flax v0.0.1
13-
github.com/creachadair/gocache v0.0.0-20240920041939-aa7478a735b8
14-
github.com/creachadair/mds v0.21.2
11+
github.com/creachadair/command v0.1.17
12+
github.com/creachadair/flax v0.0.2
13+
github.com/creachadair/gocache v0.0.0-20241113195030-6d6288323ca2
14+
github.com/creachadair/mds v0.21.4
1515
github.com/creachadair/mhttp v0.0.0-20240908014720-a77225a19b8b
1616
github.com/creachadair/scheddle v0.0.0-20240919010233-b6854e09d972
17-
github.com/creachadair/taskgroup v0.12.0
17+
github.com/creachadair/taskgroup v0.13.0
1818
github.com/creachadair/tlsutil v0.0.0-20240907154432-0ca1e46ff43d
1919
github.com/goproxy/goproxy v0.17.2
2020
golang.org/x/sync v0.8.0

go.sum

+10-10
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,22 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj
4242
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
4343
github.com/creachadair/atomicfile v0.3.5 h1:i93bxeaH/rQR6XfJslola3XkOM1nEP3eIexuk9SWcSc=
4444
github.com/creachadair/atomicfile v0.3.5/go.mod h1:m7kIY2OUMygtETnMYe141rubsG4b+EusFLinlxxdHYM=
45-
github.com/creachadair/command v0.1.16 h1:FTheS4LCtyd3pLI7fX3Oc/qATYUtMIE5V6wJKUJvdEU=
46-
github.com/creachadair/command v0.1.16/go.mod h1:JyiZVgQzhzPWa8DdE6Hfl+IOi7DMpXToBEvQCQoST7c=
47-
github.com/creachadair/flax v0.0.1 h1:it+joEf9aEUalaV7XWll/pk6zA4/FbNvMImW9q/lS8o=
48-
github.com/creachadair/flax v0.0.1/go.mod h1:K8bFvn8hMdAljQkaKNc7I3os5Wk36JxkyCkfdZ7S8d4=
49-
github.com/creachadair/gocache v0.0.0-20240920041939-aa7478a735b8 h1:wCzwOo+/ZhrX24d8tiDZsn9DexaauLlLbSHQl/yIMI8=
50-
github.com/creachadair/gocache v0.0.0-20240920041939-aa7478a735b8/go.mod h1:bLrj9QFo1TuLFWPjknZk9LXBGTZCPpB2mEzHGxXKMdg=
51-
github.com/creachadair/mds v0.21.2 h1:D5130qi/kqmu+gGUQyDNOhrocGQp075ziTCgttxhh3k=
52-
github.com/creachadair/mds v0.21.2/go.mod h1:1ltMWZd9yXhaHEoZwBialMaviWVUpRPvMwVP7saFAzM=
45+
github.com/creachadair/command v0.1.17 h1:2ZHtS5u/32RdbPYNQrpu9Wf5i6zEuq5YtwcIQQddi7o=
46+
github.com/creachadair/command v0.1.17/go.mod h1:JyiZVgQzhzPWa8DdE6Hfl+IOi7DMpXToBEvQCQoST7c=
47+
github.com/creachadair/flax v0.0.2 h1:E0cc6njSIhSh6wSP9jSp/Rdx9pPDtru4vhaazxbNU5k=
48+
github.com/creachadair/flax v0.0.2/go.mod h1:K8bFvn8hMdAljQkaKNc7I3os5Wk36JxkyCkfdZ7S8d4=
49+
github.com/creachadair/gocache v0.0.0-20241113195030-6d6288323ca2 h1:L5/5m9gmqfDhGBjIgqq3jly8kT8m3OSYuIA5EXUp+Ps=
50+
github.com/creachadair/gocache v0.0.0-20241113195030-6d6288323ca2/go.mod h1:9BNK4UqnyFY8qt5Bl7XthjMRRckOMAFGRaxSZ+ED7rY=
51+
github.com/creachadair/mds v0.21.4 h1:osKuLbjkV7YswBnhuTJh1lCDkqZMQnNfFVn0j8wLpz8=
52+
github.com/creachadair/mds v0.21.4/go.mod h1:1ltMWZd9yXhaHEoZwBialMaviWVUpRPvMwVP7saFAzM=
5353
github.com/creachadair/mhttp v0.0.0-20240908014720-a77225a19b8b h1:B6laO9uL+fvT6rwhABEyYBs7MT6YgnDa7HyU5wypqEI=
5454
github.com/creachadair/mhttp v0.0.0-20240908014720-a77225a19b8b/go.mod h1:WDSdP3YUQE4YJNxq77RUCZRIvh1l2o8y58bbHsBffo4=
5555
github.com/creachadair/msync v0.3.0 h1:7FoPzwrM4gAdfsj7mcVyodKV82fArJaKcgr9j9whYww=
5656
github.com/creachadair/msync v0.3.0/go.mod h1:XjAfMt+upDhbx3FeGJ1zkqQIm55E9xw/pWzITwVaIoI=
5757
github.com/creachadair/scheddle v0.0.0-20240919010233-b6854e09d972 h1:bWA80ILWcqGxveRewDQwf4nRF8E90SiCxqVo0DaOFxg=
5858
github.com/creachadair/scheddle v0.0.0-20240919010233-b6854e09d972/go.mod h1:PwCiUu3BYgSeOurdoA/+kDA5X39Z9JXRKDGUpkeKPCY=
59-
github.com/creachadair/taskgroup v0.12.0 h1:AWk1vgMp1VjmwRUJkbX/XZxDRI+gCWhVr+Slj2LeJ+A=
60-
github.com/creachadair/taskgroup v0.12.0/go.mod h1:9oDDPt/5QPS4iylvPMC81GRlj+1je8AFDbjUh4zaQWo=
59+
github.com/creachadair/taskgroup v0.13.0 h1:VKaW1fi1/Erkkrvx4NvaddzHCGA+hh5QPc5Veiq+joI=
60+
github.com/creachadair/taskgroup v0.13.0/go.mod h1:9oDDPt/5QPS4iylvPMC81GRlj+1je8AFDbjUh4zaQWo=
6161
github.com/creachadair/tlsutil v0.0.0-20240907154432-0ca1e46ff43d h1:euNk+jFY3ytIBBMtXY80gbMK0pA4bXTYHbkxwEUgnKU=
6262
github.com/creachadair/tlsutil v0.0.0-20240907154432-0ca1e46ff43d/go.mod h1:QMYeSCtv6WYPxroqKtL1/5p4vG2SdWiBYiTxo4y0FMc=
6363
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=

lib/gobuild/gobuild.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (s *S3Cache) init() {
9595
}
9696

9797
// Get implements the corresponding callback of the cache protocol.
98-
func (s *S3Cache) Get(ctx context.Context, actionID string) (objectID, diskPath string, _ error) {
98+
func (s *S3Cache) Get(ctx context.Context, actionID string) (outputID, diskPath string, _ error) {
9999
s.init()
100100

101101
objID, diskPath, err := s.Local.Get(ctx, actionID)
@@ -116,29 +116,29 @@ func (s *S3Cache) Get(ctx context.Context, actionID string) (objectID, diskPath
116116
}
117117

118118
// We got an action hit remotely, try to update the local copy.
119-
objectID, mtime, err := parseAction(action)
119+
outputID, mtime, err := parseAction(action)
120120
if err != nil {
121121
return "", "", err
122122
}
123123

124-
object, err := s.S3Client.GetData(ctx, s.objectKey(objectID))
124+
object, err := s.S3Client.GetData(ctx, s.outputKey(outputID))
125125
if err != nil {
126126
// At this point we know the action exists, so if we can't read the
127127
// object report it as an error rather than a cache miss.
128-
return "", "", fmt.Errorf("[s3] read object %s: %w", objectID, err)
128+
return "", "", fmt.Errorf("[s3] read object %s: %w", outputID, err)
129129
}
130130
s.getFaultHit.Add(1)
131131

132132
// Now we should have the body; poke it into the local cache. Preserve the
133133
// modification timestamp recorded with the original action.
134134
diskPath, err = s.Local.Put(ctx, gocache.Object{
135135
ActionID: actionID,
136-
ObjectID: objectID,
136+
OutputID: outputID,
137137
Size: int64(len(object)),
138138
Body: bytes.NewReader(object),
139139
ModTime: mtime,
140140
})
141-
return objectID, diskPath, err
141+
return outputID, diskPath, err
142142
}
143143

144144
// Put implements the corresponding callback of the cache protocol.
@@ -168,14 +168,14 @@ func (s *S3Cache) Put(ctx context.Context, obj gocache.Object) (diskPath string,
168168

169169
// Stage 1: Maybe write the object. Do this before writing the action
170170
// record so we are less likely to get a spurious miss later.
171-
mtime, err := s.maybePutObject(sctx, obj.ObjectID, diskPath, etr.ETag())
171+
mtime, err := s.maybePutObject(sctx, obj.OutputID, diskPath, etr.ETag())
172172
if err != nil {
173173
return err
174174
}
175175

176176
// Stage 2: Write the action record.
177177
if err := s.S3Client.Put(ctx, s.actionKey(obj.ActionID),
178-
strings.NewReader(fmt.Sprintf("%s %d", obj.ObjectID, mtime.UnixNano()))); err != nil {
178+
strings.NewReader(fmt.Sprintf("%s %d", obj.OutputID, mtime.UnixNano()))); err != nil {
179179
gocache.Logf(ctx, "write action %s: %v", obj.ActionID, err)
180180
return err
181181
}
@@ -212,10 +212,10 @@ func (s *S3Cache) SetMetrics(_ context.Context, m *expvar.Map) {
212212
// maybePutObject writes the specified object contents to S3 if there is not
213213
// already a matching key with the same etag. It returns the modified time of
214214
// the object file, whether or not it was sent to S3.
215-
func (s *S3Cache) maybePutObject(ctx context.Context, objectID, diskPath, etag string) (time.Time, error) {
215+
func (s *S3Cache) maybePutObject(ctx context.Context, outputID, diskPath, etag string) (time.Time, error) {
216216
f, err := os.Open(diskPath)
217217
if err != nil {
218-
gocache.Logf(ctx, "[s3] open local object %s: %v", objectID, err)
218+
gocache.Logf(ctx, "[s3] open local object %s: %v", outputID, err)
219219
return time.Time{}, err
220220
}
221221
defer f.Close()
@@ -224,10 +224,10 @@ func (s *S3Cache) maybePutObject(ctx context.Context, objectID, diskPath, etag s
224224
return time.Time{}, err
225225
}
226226

227-
written, err := s.S3Client.PutCond(ctx, s.objectKey(objectID), etag, f)
227+
written, err := s.S3Client.PutCond(ctx, s.outputKey(outputID), etag, f)
228228
if err != nil {
229229
s.putS3Error.Add(1)
230-
gocache.Logf(ctx, "[s3] put object %s: %v", objectID, err)
230+
gocache.Logf(ctx, "[s3] put object %s: %v", outputID, err)
231231
return fi.ModTime(), err
232232
}
233233
if written {
@@ -245,7 +245,7 @@ func (s *S3Cache) makeKey(parts ...string) string {
245245
}
246246

247247
func (s *S3Cache) actionKey(id string) string { return s.makeKey("action", id[:2], id) }
248-
func (s *S3Cache) objectKey(id string) string { return s.makeKey("object", id[:2], id) }
248+
func (s *S3Cache) outputKey(id string) string { return s.makeKey("output", id[:2], id) }
249249

250250
func (s *S3Cache) uploadConcurrency() int {
251251
if s.UploadConcurrency <= 0 {
@@ -254,7 +254,7 @@ func (s *S3Cache) uploadConcurrency() int {
254254
return s.UploadConcurrency
255255
}
256256

257-
func parseAction(data []byte) (objectID string, mtime time.Time, _ error) {
257+
func parseAction(data []byte) (outputID string, mtime time.Time, _ error) {
258258
fs := strings.Fields(string(data))
259259
if len(fs) != 2 {
260260
return "", time.Time{}, errors.New("invalid action record")

0 commit comments

Comments
 (0)