Skip to content

Commit 10b339d

Browse files
committed
Upgrade to the latest version of bb-{storage,remote-execution}
There have been some changes to bb-storage's pkg/filesystem/path that also affect some of the path handling logic in bb-browser.
1 parent ab65d55 commit 10b339d

File tree

6 files changed

+25
-37
lines changed

6 files changed

+25
-37
lines changed

.github/workflows/master.yaml

+1-9
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@
1111
"name": "Check out source code",
1212
"uses": "actions/checkout@v1"
1313
},
14-
{
15-
"name": "Restore Bazel cache",
16-
"uses": "actions/cache@v1",
17-
"with": {
18-
"key": "bazel",
19-
"path": "~/.cache/bazel"
20-
}
21-
},
2214
{
2315
"name": "Gazelle",
2416
"run": "bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro go_dependencies.bzl%go_dependencies -prune && bazel run //:gazelle"
@@ -41,7 +33,7 @@
4133
},
4234
{
4335
"name": "Protobuf generation",
44-
"run": "find . bazel-bin/pkg/proto -name '*.pb.go' -delete || true\nbazel build $(bazel query 'kind(\"go_proto_library\", //...)')\nfind bazel-bin/pkg/proto -name '*.pb.go' | while read f; do\n cat $f > $(echo $f | sed -e 's|.*/pkg/proto/|pkg/proto/|')\ndone\n"
36+
"run": "find . bazel-bin/pkg/proto -name '*.pb.go' -delete || true\nbazel build $(bazel query --output=label 'kind(\"go_proto_library\", //...)')\nfind bazel-bin/pkg/proto -name '*.pb.go' | while read f; do\n cat $f > $(echo $f | sed -e 's|.*/pkg/proto/|pkg/proto/|')\ndone\n"
4537
},
4638
{
4739
"name": "Embedded asset generation",

.github/workflows/pull-requests.yaml

+1-9
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@
1111
"name": "Check out source code",
1212
"uses": "actions/checkout@v1"
1313
},
14-
{
15-
"name": "Restore Bazel cache",
16-
"uses": "actions/cache@v1",
17-
"with": {
18-
"key": "bazel",
19-
"path": "~/.cache/bazel"
20-
}
21-
},
2214
{
2315
"name": "Gazelle",
2416
"run": "bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro go_dependencies.bzl%go_dependencies -prune && bazel run //:gazelle"
@@ -41,7 +33,7 @@
4133
},
4234
{
4335
"name": "Protobuf generation",
44-
"run": "find . bazel-bin/pkg/proto -name '*.pb.go' -delete || true\nbazel build $(bazel query 'kind(\"go_proto_library\", //...)')\nfind bazel-bin/pkg/proto -name '*.pb.go' | while read f; do\n cat $f > $(echo $f | sed -e 's|.*/pkg/proto/|pkg/proto/|')\ndone\n"
36+
"run": "find . bazel-bin/pkg/proto -name '*.pb.go' -delete || true\nbazel build $(bazel query --output=label 'kind(\"go_proto_library\", //...)')\nfind bazel-bin/pkg/proto -name '*.pb.go' | while read f; do\n cat $f > $(echo $f | sed -e 's|.*/pkg/proto/|pkg/proto/|')\ndone\n"
4537
},
4638
{
4739
"name": "Embedded asset generation",

cmd/bb_browser/browser_service.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func (s *BrowserService) getBBClientdBlobPath(blobDigest digest.Digest, blobType
174174
// pasted into a shell. It assumes that bb_clientd's FUSE file system is
175175
// mounted at ~/bb_clientd, the default.
176176
func formatBBClientdPath(p *path.Trace) string {
177-
return "~/bb_clientd/cas/" + shellquote.Join(p.String())
177+
return "~/bb_clientd/cas/" + shellquote.Join(p.GetUNIXString())
178178
}
179179

180180
func (s *BrowserService) handleWelcome(w http.ResponseWriter, req *http.Request) {
@@ -548,13 +548,13 @@ func (s *BrowserService) generateTarballDirectory(ctx context.Context, w *tar.Wr
548548
for _, directoryNode := range directory.Directories {
549549
childName, ok := path.NewComponent(directoryNode.Name)
550550
if !ok {
551-
return status.Errorf(codes.InvalidArgument, "Directory %#v in directory %#v has an invalid name", directoryNode.Name, directoryPath.String())
551+
return status.Errorf(codes.InvalidArgument, "Directory %#v in directory %#v has an invalid name", directoryNode.Name, directoryPath.GetUNIXString())
552552
}
553553
childPath := directoryPath.Append(childName)
554554

555555
if err := w.WriteHeader(&tar.Header{
556556
Typeflag: tar.TypeDir,
557-
Name: childPath.String(),
557+
Name: childPath.GetUNIXString(),
558558
Mode: 0o777,
559559
}); err != nil {
560560
return err
@@ -576,13 +576,13 @@ func (s *BrowserService) generateTarballDirectory(ctx context.Context, w *tar.Wr
576576
for _, symlinkNode := range directory.Symlinks {
577577
childName, ok := path.NewComponent(symlinkNode.Name)
578578
if !ok {
579-
return status.Errorf(codes.InvalidArgument, "Symbolic link %#v in directory %#v has an invalid name", symlinkNode.Name, directoryPath.String())
579+
return status.Errorf(codes.InvalidArgument, "Symbolic link %#v in directory %#v has an invalid name", symlinkNode.Name, directoryPath.GetUNIXString())
580580
}
581581
childPath := directoryPath.Append(childName)
582582

583583
if err := w.WriteHeader(&tar.Header{
584584
Typeflag: tar.TypeSymlink,
585-
Name: childPath.String(),
585+
Name: childPath.GetUNIXString(),
586586
Linkname: symlinkNode.Target,
587587
Mode: 0o777,
588588
}); err != nil {
@@ -594,10 +594,10 @@ func (s *BrowserService) generateTarballDirectory(ctx context.Context, w *tar.Wr
594594
for _, fileNode := range directory.Files {
595595
childName, ok := path.NewComponent(fileNode.Name)
596596
if !ok {
597-
return status.Errorf(codes.InvalidArgument, "File %#v in directory %#v has an invalid name", fileNode.Name, directoryPath.String())
597+
return status.Errorf(codes.InvalidArgument, "File %#v in directory %#v has an invalid name", fileNode.Name, directoryPath.GetUNIXString())
598598
}
599599
childPath := directoryPath.Append(childName)
600-
childPathString := childPath.String()
600+
childPathString := childPath.GetUNIXString()
601601

602602
childDigest, err := digestFunction.NewDigestFromProto(fileNode.Digest)
603603
if err != nil {
@@ -967,7 +967,7 @@ func (s *BrowserService) handleTree(w http.ResponseWriter, req *http.Request) {
967967
bbClientdPath := s.getBBClientdBlobPath(treeDigest, treeDirectoryComponent)
968968
directoryDigest := treeDigest
969969
rootDirectory, scopeWalker := path.EmptyBuilder.Join(path.VoidScopeWalker)
970-
rootDirectoryWalker, _ := scopeWalker.OnScope(false)
970+
rootDirectoryWalker, _ := scopeWalker.OnRelative()
971971
for _, component := range strings.FieldsFunc(
972972
mux.Vars(req)["subdirectory"],
973973
func(r rune) bool { return r == '/' }) {
@@ -1008,7 +1008,7 @@ func (s *BrowserService) handleTree(w http.ResponseWriter, req *http.Request) {
10081008
treeInfo.Directory = childDirectory
10091009
}
10101010
treeInfo.BBClientdPath = formatBBClientdPath(bbClientdPath)
1011-
treeInfo.RootDirectory = rootDirectory.String()
1011+
treeInfo.RootDirectory = rootDirectory.GetUNIXString()
10121012

10131013
if req.URL.Query().Get("format") == "tar" {
10141014
s.generateTarball(

go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ replace github.com/grpc-ecosystem/grpc-gateway/v2 => github.com/grpc-ecosystem/g
77

88
require (
99
github.com/bazelbuild/remote-apis v0.0.0-20240215191509-9ff14cecffe5
10-
github.com/buildbarn/bb-remote-execution v0.0.0-20240222085313-f5b199467dd6
11-
github.com/buildbarn/bb-storage v0.0.0-20240227100204-0aa40dfdbead
10+
github.com/buildbarn/bb-remote-execution v0.0.0-20240310090416-28dbdbb0a6b0
11+
github.com/buildbarn/bb-storage v0.0.0-20240310075825-20598f43e294
1212
github.com/buildkite/terminal-to-html v3.2.0+incompatible
1313
github.com/dustin/go-humanize v1.0.1
1414
github.com/gorilla/mux v1.8.1
@@ -95,7 +95,7 @@ require (
9595
golang.org/x/net v0.20.0 // indirect
9696
golang.org/x/oauth2 v0.16.0 // indirect
9797
golang.org/x/sync v0.6.0 // indirect
98-
golang.org/x/sys v0.17.0 // indirect
98+
golang.org/x/sys v0.18.0 // indirect
9999
golang.org/x/text v0.14.0 // indirect
100100
golang.org/x/time v0.5.0 // indirect
101101
google.golang.org/api v0.162.0 // indirect

go.sum

+5
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
6363
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
6464
github.com/buildbarn/bb-remote-execution v0.0.0-20240222085313-f5b199467dd6 h1:dgXMsgYgc48Sxb8gcrd+C2ze8Rtn1UvaDMxrUGti50g=
6565
github.com/buildbarn/bb-remote-execution v0.0.0-20240222085313-f5b199467dd6/go.mod h1:qwNvc1PxPWzRzcKiQ/Hq1MQmxB8fjWQ+Lv0h9r8aysU=
66+
github.com/buildbarn/bb-remote-execution v0.0.0-20240310090416-28dbdbb0a6b0 h1:wcGel3yU3FAENqRLzgZkg7xzuwlaY9H+Lphd46u5tyI=
67+
github.com/buildbarn/bb-remote-execution v0.0.0-20240310090416-28dbdbb0a6b0/go.mod h1:q3TGK8PD/HoADYpaOU0lup48IOusUuCoP0ilLi+BX7A=
6668
github.com/buildbarn/bb-storage v0.0.0-20240227100204-0aa40dfdbead h1:fHapKnQQLgJaMxGiBAUCPVHNfD5vV1LDfXqmyClJ6Lc=
6769
github.com/buildbarn/bb-storage v0.0.0-20240227100204-0aa40dfdbead/go.mod h1:gHT0PInDFOV/JZjeeNwvqmn33MKHHyk3V18e4/Cs/jM=
70+
github.com/buildbarn/bb-storage v0.0.0-20240310075825-20598f43e294 h1:Gs3nP150dcZ7Utk7OrYPpoV9/7oGZ9y1It0BGPonDnk=
71+
github.com/buildbarn/bb-storage v0.0.0-20240310075825-20598f43e294/go.mod h1:0uISGKJD6Owt29w2sUlK0TeLtYdLWtBiC43yVHdgMAY=
6872
github.com/buildkite/terminal-to-html v3.2.0+incompatible h1:WdXzl7ZmYzCAz4pElZosPaUlRTW+qwVx/SkQSCa1jXs=
6973
github.com/buildkite/terminal-to-html v3.2.0+incompatible/go.mod h1:BFFdFecOxCgjdcarqI+8izs6v85CU/1RA/4Bqh4GR7E=
7074
github.com/campoy/embedmd v1.0.0 h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY=
@@ -298,6 +302,7 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc
298302
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
299303
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
300304
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
305+
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
301306
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
302307
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
303308
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=

go_dependencies.bzl

+6-7
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,14 @@ def go_dependencies():
197197
go_repository(
198198
name = "com_github_buildbarn_bb_remote_execution",
199199
importpath = "github.com/buildbarn/bb-remote-execution",
200-
sum = "h1:dgXMsgYgc48Sxb8gcrd+C2ze8Rtn1UvaDMxrUGti50g=",
201-
version = "v0.0.0-20240222085313-f5b199467dd6",
200+
sum = "h1:wcGel3yU3FAENqRLzgZkg7xzuwlaY9H+Lphd46u5tyI=",
201+
version = "v0.0.0-20240310090416-28dbdbb0a6b0",
202202
)
203203
go_repository(
204204
name = "com_github_buildbarn_bb_storage",
205205
importpath = "github.com/buildbarn/bb-storage",
206-
sum = "h1:fHapKnQQLgJaMxGiBAUCPVHNfD5vV1LDfXqmyClJ6Lc=",
207-
version = "v0.0.0-20240227100204-0aa40dfdbead",
206+
sum = "h1:Gs3nP150dcZ7Utk7OrYPpoV9/7oGZ9y1It0BGPonDnk=",
207+
version = "v0.0.0-20240310075825-20598f43e294",
208208
)
209209
go_repository(
210210
name = "com_github_buildbarn_go_xdr",
@@ -1715,9 +1715,8 @@ def go_dependencies():
17151715
go_repository(
17161716
name = "org_golang_x_sys",
17171717
importpath = "golang.org/x/sys",
1718-
patches = ["@com_github_buildbarn_bb_storage//:patches/org_golang_x_sys/golang-issue-59357.diff"],
1719-
sum = "h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=",
1720-
version = "v0.17.0",
1718+
sum = "h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=",
1719+
version = "v0.18.0",
17211720
)
17221721
go_repository(
17231722
name = "org_golang_x_term",

0 commit comments

Comments
 (0)