Skip to content

Commit 9da600b

Browse files
committed
Upgrade all dependencies
This requires us to catch up with some API changes: - Protobuf imports are now prefixed with github.com/buildbarn/*. - capabilities.NewServer() no longer sets API versions anymore. We need to ensure that we need to announce API versions matching up with what bb_clientd supports. My assumption is that bb_clientd supports all of REv2.0 to REv2.11. - Add support for named attributes to mutable files and directories. - Explicitly mark the file system as being case sensitive by using CaseSensitiveComponentNormalizer. - Add OnShare() methods, now that the pathname parsing library also supports Windows paths containing share names.
1 parent 19d3ff0 commit 9da600b

File tree

18 files changed

+583
-603
lines changed

18 files changed

+583
-603
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.3.1
1+
8.4.2

.github/workflows/master.yaml

Lines changed: 0 additions & 197 deletions
Original file line numberDiff line numberDiff line change
@@ -1,195 +1,7 @@
11
{
22
"jobs": {
33
"build_and_test": {
4-
"runs-on": "ubuntu-latest",
54
"steps": [
6-
{
7-
"name": "Check out source code",
8-
"uses": "actions/checkout@v1"
9-
},
10-
{
11-
"name": "Installing Bazel",
12-
"run": "v=$(cat .bazelversion) && curl -L https://github.com/bazelbuild/bazel/releases/download/${v}/bazel-${v}-linux-x86_64 > ~/bazel && chmod +x ~/bazel && echo ~ >> ${GITHUB_PATH}"
13-
},
14-
{
15-
"name": "Bazel mod tidy",
16-
"run": "bazel mod tidy"
17-
},
18-
{
19-
"name": "Gazelle",
20-
"run": "rm -f $(find . -name '*.pb.go' | sed -e 's/[^/]*$/BUILD.bazel/') && bazel run //:gazelle"
21-
},
22-
{
23-
"name": "Buildifier",
24-
"run": "bazel run @com_github_bazelbuild_buildtools//:buildifier"
25-
},
26-
{
27-
"name": "Gofmt",
28-
"run": "bazel run @cc_mvdan_gofumpt//:gofumpt -- -w -extra $(pwd)"
29-
},
30-
{
31-
"name": "Clang format",
32-
"run": "find . -name '*.proto' -exec bazel run @llvm_toolchain_llvm//:bin/clang-format -- -i {} +"
33-
},
34-
{
35-
"name": "GitHub workflows",
36-
"run": "bazel build //tools/github_workflows && cp bazel-bin/tools/github_workflows/*.yaml .github/workflows"
37-
},
38-
{
39-
"name": "Protobuf generation",
40-
"run": "if [ -d pkg/proto ]; then\n find . bazel-bin/pkg/proto -name '*.pb.go' -delete || true\n bazel build $(bazel query --output=label 'kind(\"go_proto_library\", //...)')\n find bazel-bin/pkg/proto -name '*.pb.go' | while read f; do\n cat $f > $(echo $f | sed -e 's|.*/pkg/proto/|pkg/proto/|')\n done\nfi\n"
41-
},
42-
{
43-
"name": "Embedded asset generation",
44-
"run": "bazel build $(git grep '^[[:space:]]*//go:embed ' | sed -e 's|\\(.*\\)/.*//go:embed |//\\1:|; s|\"||g; s| .*||' | sort -u)\ngit grep '^[[:space:]]*//go:embed ' | sed -e 's|\\(.*\\)/.*//go:embed |\\1/|' | while read o; do\n if [ -e \"bazel-bin/$o\" ]; then\n rm -rf \"$o\"\n cp -r \"bazel-bin/$o\" \"$o\"\n find \"$o\" -type f -exec chmod -x {} +\n fi\ndone\n"
45-
},
46-
{
47-
"name": "Test style conformance",
48-
"run": "git add . && git diff --exit-code HEAD --"
49-
},
50-
{
51-
"name": "Golint",
52-
"run": "bazel run @org_golang_x_lint//golint -- -set_exit_status $(pwd)/..."
53-
},
54-
{
55-
"name": "linux_amd64: build and test",
56-
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_amd64 //..."
57-
},
58-
{
59-
"name": "linux_amd64: copy bb_clientd",
60-
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_amd64 //cmd/bb_clientd $(pwd)/bb_clientd"
61-
},
62-
{
63-
"name": "linux_amd64: upload bb_clientd",
64-
"uses": "actions/upload-artifact@v4",
65-
"with": {
66-
"name": "bb_clientd.linux_amd64",
67-
"path": "bb_clientd"
68-
}
69-
},
70-
{
71-
"name": "linux_386: build and test",
72-
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_386 //..."
73-
},
74-
{
75-
"name": "linux_386: copy bb_clientd",
76-
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_386 //cmd/bb_clientd $(pwd)/bb_clientd"
77-
},
78-
{
79-
"name": "linux_386: upload bb_clientd",
80-
"uses": "actions/upload-artifact@v4",
81-
"with": {
82-
"name": "bb_clientd.linux_386",
83-
"path": "bb_clientd"
84-
}
85-
},
86-
{
87-
"name": "linux_arm: build and test",
88-
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm //..."
89-
},
90-
{
91-
"name": "linux_arm: copy bb_clientd",
92-
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm //cmd/bb_clientd $(pwd)/bb_clientd"
93-
},
94-
{
95-
"name": "linux_arm: upload bb_clientd",
96-
"uses": "actions/upload-artifact@v4",
97-
"with": {
98-
"name": "bb_clientd.linux_arm",
99-
"path": "bb_clientd"
100-
}
101-
},
102-
{
103-
"name": "linux_arm64: build and test",
104-
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64 //..."
105-
},
106-
{
107-
"name": "linux_arm64: copy bb_clientd",
108-
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm64 //cmd/bb_clientd $(pwd)/bb_clientd"
109-
},
110-
{
111-
"name": "linux_arm64: upload bb_clientd",
112-
"uses": "actions/upload-artifact@v4",
113-
"with": {
114-
"name": "bb_clientd.linux_arm64",
115-
"path": "bb_clientd"
116-
}
117-
},
118-
{
119-
"name": "darwin_amd64: build and test",
120-
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64 //..."
121-
},
122-
{
123-
"name": "darwin_amd64: copy bb_clientd",
124-
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_amd64 //cmd/bb_clientd $(pwd)/bb_clientd"
125-
},
126-
{
127-
"name": "darwin_amd64: upload bb_clientd",
128-
"uses": "actions/upload-artifact@v4",
129-
"with": {
130-
"name": "bb_clientd.darwin_amd64",
131-
"path": "bb_clientd"
132-
}
133-
},
134-
{
135-
"name": "darwin_arm64: build and test",
136-
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64 //..."
137-
},
138-
{
139-
"name": "darwin_arm64: copy bb_clientd",
140-
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_arm64 //cmd/bb_clientd $(pwd)/bb_clientd"
141-
},
142-
{
143-
"name": "darwin_arm64: upload bb_clientd",
144-
"uses": "actions/upload-artifact@v4",
145-
"with": {
146-
"name": "bb_clientd.darwin_arm64",
147-
"path": "bb_clientd"
148-
}
149-
},
150-
{
151-
"name": "freebsd_amd64: build and test",
152-
"run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_clientd"
153-
},
154-
{
155-
"name": "freebsd_amd64: copy bb_clientd",
156-
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_clientd $(pwd)/bb_clientd"
157-
},
158-
{
159-
"name": "freebsd_amd64: upload bb_clientd",
160-
"uses": "actions/upload-artifact@v4",
161-
"with": {
162-
"name": "bb_clientd.freebsd_amd64",
163-
"path": "bb_clientd"
164-
}
165-
},
166-
{
167-
"name": "windows_amd64: build and test",
168-
"run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64 //cmd/bb_clientd"
169-
},
170-
{
171-
"name": "windows_amd64: copy bb_clientd",
172-
"run": "rm -f bb_clientd.exe && bazel run --run_under cp --platforms=@rules_go//go/toolchain:windows_amd64 //cmd/bb_clientd $(pwd)/bb_clientd.exe"
173-
},
174-
{
175-
"name": "windows_amd64: upload bb_clientd",
176-
"uses": "actions/upload-artifact@v4",
177-
"with": {
178-
"name": "bb_clientd.windows_amd64",
179-
"path": "bb_clientd.exe"
180-
}
181-
},
182-
{
183-
"env": {
184-
"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
185-
},
186-
"name": "Install Docker credentials",
187-
"run": "echo \"${GITHUB_TOKEN}\" | docker login ghcr.io -u $ --password-stdin"
188-
},
189-
{
190-
"name": "Push container bb_clientd:bb_clientd",
191-
"run": "bazel run --stamp //cmd/bb_clientd:bb_clientd_container_push"
192-
},
1935
{
1946
"name": "linux_amd64: build bb_clientd.deb",
1957
"run": "bazel build --stamp --platforms=@rules_go//go/toolchain:linux_amd64 //:bb_clientd_deb"
@@ -208,14 +20,5 @@
20820
}
20921
]
21022
}
211-
},
212-
"name": "master",
213-
"on": {
214-
"push": {
215-
"branches": [
216-
"main",
217-
"master"
218-
]
219-
}
22023
}
22124
}

.github/workflows/pull-requests.yaml

Lines changed: 70 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,109 @@
11
{
22
"jobs": {
33
"build_and_test": {
4-
"runs-on": "ubuntu-latest",
4+
"name": "build_and_test ${{ matrix.host.os }}",
5+
"runs-on": "${{ matrix.host.os }}",
56
"steps": [
67
{
78
"name": "Check out source code",
89
"uses": "actions/checkout@v1"
910
},
1011
{
1112
"name": "Installing Bazel",
12-
"run": "v=$(cat .bazelversion) && curl -L https://github.com/bazelbuild/bazel/releases/download/${v}/bazel-${v}-linux-x86_64 > ~/bazel && chmod +x ~/bazel && echo ~ >> ${GITHUB_PATH}"
13-
},
14-
{
15-
"name": "Bazel mod tidy",
16-
"run": "bazel mod tidy"
17-
},
18-
{
19-
"name": "Gazelle",
20-
"run": "rm -f $(find . -name '*.pb.go' | sed -e 's/[^/]*$/BUILD.bazel/') && bazel run //:gazelle"
21-
},
22-
{
23-
"name": "Buildifier",
24-
"run": "bazel run @com_github_bazelbuild_buildtools//:buildifier"
13+
"run": "v=$(cat .bazelversion) && curl -L https://github.com/bazelbuild/bazel/releases/download/${v}/bazel-${v}-${{matrix.host.bazel_os}}-x86_64 > ~/bazel && chmod +x ~/bazel && echo ~ >> ${GITHUB_PATH}",
14+
"shell": "bash"
2515
},
2616
{
27-
"name": "Gofmt",
28-
"run": "bazel run @cc_mvdan_gofumpt//:gofumpt -- -w -extra $(pwd)"
17+
"if": "matrix.host.platform_name == 'windows_amd64'",
18+
"name": "Override .bazelrc",
19+
"run": "echo \"startup --output_base=D:/bazel_output\" >> .bazelrc"
2920
},
3021
{
31-
"name": "Clang format",
32-
"run": "find . -name '*.proto' -exec bazel run @llvm_toolchain_llvm//:bin/clang-format -- -i {} +"
22+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_amd64'",
23+
"name": "linux_amd64: build${{ matrix.host.platform_name == 'linux_amd64' && ' and test' || '' }}",
24+
"run": "bazel ${{ matrix.host.platform_name == 'linux_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:linux_amd64 //..."
3325
},
3426
{
35-
"name": "GitHub workflows",
36-
"run": "bazel build //tools/github_workflows && cp bazel-bin/tools/github_workflows/*.yaml .github/workflows"
27+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_386'",
28+
"name": "linux_386: build${{ matrix.host.platform_name == 'linux_amd64' && ' and test' || '' }}",
29+
"run": "bazel ${{ matrix.host.platform_name == 'linux_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:linux_386 //..."
3730
},
3831
{
39-
"name": "Protobuf generation",
40-
"run": "if [ -d pkg/proto ]; then\n find . bazel-bin/pkg/proto -name '*.pb.go' -delete || true\n bazel build $(bazel query --output=label 'kind(\"go_proto_library\", //...)')\n find bazel-bin/pkg/proto -name '*.pb.go' | while read f; do\n cat $f > $(echo $f | sed -e 's|.*/pkg/proto/|pkg/proto/|')\n done\nfi\n"
32+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_arm'",
33+
"name": "linux_arm: build${{ matrix.host.platform_name == 'linux_arm' && ' and test' || '' }}",
34+
"run": "bazel ${{ matrix.host.platform_name == 'linux_arm' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:linux_arm //..."
4135
},
4236
{
43-
"name": "Embedded asset generation",
44-
"run": "bazel build $(git grep '^[[:space:]]*//go:embed ' | sed -e 's|\\(.*\\)/.*//go:embed |//\\1:|; s|\"||g; s| .*||' | sort -u)\ngit grep '^[[:space:]]*//go:embed ' | sed -e 's|\\(.*\\)/.*//go:embed |\\1/|' | while read o; do\n if [ -e \"bazel-bin/$o\" ]; then\n rm -rf \"$o\"\n cp -r \"bazel-bin/$o\" \"$o\"\n find \"$o\" -type f -exec chmod -x {} +\n fi\ndone\n"
37+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_arm64'",
38+
"name": "linux_arm64: build${{ matrix.host.platform_name == 'linux_arm64' && ' and test' || '' }}",
39+
"run": "bazel ${{ matrix.host.platform_name == 'linux_arm64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:linux_arm64 //..."
4540
},
4641
{
47-
"name": "Test style conformance",
48-
"run": "git add . && git diff --exit-code HEAD --"
49-
},
50-
{
51-
"name": "Golint",
52-
"run": "bazel run @org_golang_x_lint//golint -- -set_exit_status $(pwd)/..."
42+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'darwin_amd64'",
43+
"name": "darwin_amd64: build${{ matrix.host.platform_name == 'darwin_amd64' && ' and test' || '' }}",
44+
"run": "bazel ${{ matrix.host.platform_name == 'darwin_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:darwin_amd64 //..."
5345
},
5446
{
55-
"name": "linux_amd64: build and test",
56-
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_amd64 //..."
47+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'darwin_arm64'",
48+
"name": "darwin_arm64: build${{ matrix.host.platform_name == 'darwin_arm64' && ' and test' || '' }}",
49+
"run": "bazel ${{ matrix.host.platform_name == 'darwin_arm64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:darwin_arm64 //..."
5750
},
5851
{
59-
"name": "linux_386: build and test",
60-
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_386 //..."
52+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'freebsd_amd64'",
53+
"name": "freebsd_amd64: build${{ matrix.host.platform_name == 'freebsd_amd64' && ' and test' || '' }}",
54+
"run": "bazel ${{ matrix.host.platform_name == 'freebsd_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:freebsd_amd64 //..."
6155
},
6256
{
63-
"name": "linux_arm: build and test",
64-
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm //..."
65-
},
57+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'windows_amd64'",
58+
"name": "windows_amd64: build${{ matrix.host.platform_name == 'windows_amd64' && ' and test' || '' }}",
59+
"run": "bazel ${{ matrix.host.platform_name == 'windows_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:windows_amd64 //..."
60+
}
61+
],
62+
"strategy": {
63+
"matrix": {
64+
"host": [
65+
{
66+
"bazel_os": "linux",
67+
"cross_compile": true,
68+
"os": "ubuntu-latest",
69+
"platform_name": "linux_amd64",
70+
"upload": true
71+
},
72+
{
73+
"bazel_os": "windows",
74+
"cross_compile": false,
75+
"os": "windows-latest",
76+
"platform_name": "windows_amd64",
77+
"upload": false
78+
}
79+
]
80+
}
81+
}
82+
},
83+
"lint": {
84+
"name": "lint",
85+
"runs-on": "ubuntu-latest",
86+
"steps": [
6687
{
67-
"name": "linux_arm64: build and test",
68-
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64 //..."
88+
"name": "Check out source code",
89+
"uses": "actions/checkout@v1"
6990
},
7091
{
71-
"name": "darwin_amd64: build and test",
72-
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64 //..."
92+
"name": "Installing Bazel",
93+
"run": "v=$(cat .bazelversion) && curl -L https://github.com/bazelbuild/bazel/releases/download/${v}/bazel-${v}-linux-x86_64 > ~/bazel && chmod +x ~/bazel && echo ~ >> ${GITHUB_PATH}",
94+
"shell": "bash"
7395
},
7496
{
75-
"name": "darwin_arm64: build and test",
76-
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64 //..."
97+
"name": "Reformat",
98+
"run": "bazel run @com_github_buildbarn_bb_storage//tools:reformat"
7799
},
78100
{
79-
"name": "freebsd_amd64: build and test",
80-
"run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_clientd"
101+
"name": "Test style conformance",
102+
"run": "git add . && git diff --exit-code HEAD --"
81103
},
82104
{
83-
"name": "windows_amd64: build and test",
84-
"run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64 //cmd/bb_clientd"
105+
"name": "Golint",
106+
"run": "bazel run @org_golang_x_lint//golint -- -set_exit_status $(pwd)/..."
85107
}
86108
]
87109
}
@@ -90,8 +112,7 @@
90112
"on": {
91113
"pull_request": {
92114
"branches": [
93-
"main",
94-
"master"
115+
"main"
95116
]
96117
}
97118
}

0 commit comments

Comments
 (0)