Skip to content

Commit e88e2fa

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 e88e2fa

File tree

19 files changed

+676
-476
lines changed

19 files changed

+676
-476
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
Lines changed: 92 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,35 @@
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"
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 --"
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"
4915
},
5016
{
51-
"name": "Golint",
52-
"run": "bazel run @org_golang_x_lint//golint -- -set_exit_status $(pwd)/..."
17+
"if": "matrix.host.platform_name == 'windows_amd64'",
18+
"name": "Override .bazelrc",
19+
"run": "echo \"startup --output_base=D:/bazel_output\" >> .bazelrc"
5320
},
5421
{
55-
"name": "linux_amd64: build and test",
56-
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_amd64 //..."
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 //..."
5725
},
5826
{
27+
"if": "matrix.host.upload",
5928
"name": "linux_amd64: copy bb_clientd",
6029
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_amd64 //cmd/bb_clientd $(pwd)/bb_clientd"
6130
},
6231
{
32+
"if": "matrix.host.upload",
6333
"name": "linux_amd64: upload bb_clientd",
6434
"uses": "actions/upload-artifact@v4",
6535
"with": {
@@ -68,14 +38,17 @@
6838
}
6939
},
7040
{
71-
"name": "linux_386: build and test",
72-
"run": "bazel test --test_output=errors --platforms=@rules_go//go/toolchain:linux_386 //..."
41+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_386'",
42+
"name": "linux_386: build${{ matrix.host.platform_name == 'linux_amd64' && ' and test' || '' }}",
43+
"run": "bazel ${{ matrix.host.platform_name == 'linux_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:linux_386 //..."
7344
},
7445
{
46+
"if": "matrix.host.upload",
7547
"name": "linux_386: copy bb_clientd",
7648
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_386 //cmd/bb_clientd $(pwd)/bb_clientd"
7749
},
7850
{
51+
"if": "matrix.host.upload",
7952
"name": "linux_386: upload bb_clientd",
8053
"uses": "actions/upload-artifact@v4",
8154
"with": {
@@ -84,14 +57,17 @@
8457
}
8558
},
8659
{
87-
"name": "linux_arm: build and test",
88-
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm //..."
60+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_arm'",
61+
"name": "linux_arm: build${{ matrix.host.platform_name == 'linux_arm' && ' and test' || '' }}",
62+
"run": "bazel ${{ matrix.host.platform_name == 'linux_arm' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:linux_arm //..."
8963
},
9064
{
65+
"if": "matrix.host.upload",
9166
"name": "linux_arm: copy bb_clientd",
9267
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm //cmd/bb_clientd $(pwd)/bb_clientd"
9368
},
9469
{
70+
"if": "matrix.host.upload",
9571
"name": "linux_arm: upload bb_clientd",
9672
"uses": "actions/upload-artifact@v4",
9773
"with": {
@@ -100,14 +76,17 @@
10076
}
10177
},
10278
{
103-
"name": "linux_arm64: build and test",
104-
"run": "bazel build --platforms=@rules_go//go/toolchain:linux_arm64 //..."
79+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'linux_arm64'",
80+
"name": "linux_arm64: build${{ matrix.host.platform_name == 'linux_arm64' && ' and test' || '' }}",
81+
"run": "bazel ${{ matrix.host.platform_name == 'linux_arm64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:linux_arm64 //..."
10582
},
10683
{
84+
"if": "matrix.host.upload",
10785
"name": "linux_arm64: copy bb_clientd",
10886
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm64 //cmd/bb_clientd $(pwd)/bb_clientd"
10987
},
11088
{
89+
"if": "matrix.host.upload",
11190
"name": "linux_arm64: upload bb_clientd",
11291
"uses": "actions/upload-artifact@v4",
11392
"with": {
@@ -116,14 +95,17 @@
11695
}
11796
},
11897
{
119-
"name": "darwin_amd64: build and test",
120-
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_amd64 //..."
98+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'darwin_amd64'",
99+
"name": "darwin_amd64: build${{ matrix.host.platform_name == 'darwin_amd64' && ' and test' || '' }}",
100+
"run": "bazel ${{ matrix.host.platform_name == 'darwin_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:darwin_amd64 //..."
121101
},
122102
{
103+
"if": "matrix.host.upload",
123104
"name": "darwin_amd64: copy bb_clientd",
124105
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_amd64 //cmd/bb_clientd $(pwd)/bb_clientd"
125106
},
126107
{
108+
"if": "matrix.host.upload",
127109
"name": "darwin_amd64: upload bb_clientd",
128110
"uses": "actions/upload-artifact@v4",
129111
"with": {
@@ -132,14 +114,17 @@
132114
}
133115
},
134116
{
135-
"name": "darwin_arm64: build and test",
136-
"run": "bazel build --platforms=@rules_go//go/toolchain:darwin_arm64 //..."
117+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'darwin_arm64'",
118+
"name": "darwin_arm64: build${{ matrix.host.platform_name == 'darwin_arm64' && ' and test' || '' }}",
119+
"run": "bazel ${{ matrix.host.platform_name == 'darwin_arm64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:darwin_arm64 //..."
137120
},
138121
{
122+
"if": "matrix.host.upload",
139123
"name": "darwin_arm64: copy bb_clientd",
140124
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_arm64 //cmd/bb_clientd $(pwd)/bb_clientd"
141125
},
142126
{
127+
"if": "matrix.host.upload",
143128
"name": "darwin_arm64: upload bb_clientd",
144129
"uses": "actions/upload-artifact@v4",
145130
"with": {
@@ -148,14 +133,17 @@
148133
}
149134
},
150135
{
151-
"name": "freebsd_amd64: build and test",
152-
"run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_clientd"
136+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'freebsd_amd64'",
137+
"name": "freebsd_amd64: build${{ matrix.host.platform_name == 'freebsd_amd64' && ' and test' || '' }}",
138+
"run": "bazel ${{ matrix.host.platform_name == 'freebsd_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:freebsd_amd64 //..."
153139
},
154140
{
141+
"if": "matrix.host.upload",
155142
"name": "freebsd_amd64: copy bb_clientd",
156143
"run": "rm -f bb_clientd && bazel run --run_under cp --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_clientd $(pwd)/bb_clientd"
157144
},
158145
{
146+
"if": "matrix.host.upload",
159147
"name": "freebsd_amd64: upload bb_clientd",
160148
"uses": "actions/upload-artifact@v4",
161149
"with": {
@@ -164,14 +152,17 @@
164152
}
165153
},
166154
{
167-
"name": "windows_amd64: build and test",
168-
"run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64 //cmd/bb_clientd"
155+
"if": "matrix.host.cross_compile || matrix.host.platform_name == 'windows_amd64'",
156+
"name": "windows_amd64: build${{ matrix.host.platform_name == 'windows_amd64' && ' and test' || '' }}",
157+
"run": "bazel ${{ matrix.host.platform_name == 'windows_amd64' && 'test --test_output=errors' || 'build' }} --platforms=@rules_go//go/toolchain:windows_amd64 //..."
169158
},
170159
{
160+
"if": "matrix.host.upload",
171161
"name": "windows_amd64: copy bb_clientd",
172162
"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"
173163
},
174164
{
165+
"if": "matrix.host.upload",
175166
"name": "windows_amd64: upload bb_clientd",
176167
"uses": "actions/upload-artifact@v4",
177168
"with": {
@@ -183,38 +174,70 @@
183174
"env": {
184175
"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
185176
},
177+
"if": "matrix.host.upload",
186178
"name": "Install Docker credentials",
187179
"run": "echo \"${GITHUB_TOKEN}\" | docker login ghcr.io -u $ --password-stdin"
188180
},
189181
{
182+
"if": "matrix.host.upload",
190183
"name": "Push container bb_clientd:bb_clientd",
191184
"run": "bazel run --stamp //cmd/bb_clientd:bb_clientd_container_push"
185+
}
186+
],
187+
"strategy": {
188+
"matrix": {
189+
"host": [
190+
{
191+
"bazel_os": "linux",
192+
"cross_compile": true,
193+
"os": "ubuntu-latest",
194+
"platform_name": "linux_amd64",
195+
"upload": true
196+
},
197+
{
198+
"bazel_os": "windows",
199+
"cross_compile": false,
200+
"os": "windows-latest",
201+
"platform_name": "windows_amd64",
202+
"upload": false
203+
}
204+
]
205+
}
206+
}
207+
},
208+
"lint": {
209+
"name": "lint",
210+
"runs-on": "ubuntu-latest",
211+
"steps": [
212+
{
213+
"name": "Check out source code",
214+
"uses": "actions/checkout@v1"
192215
},
193216
{
194-
"name": "linux_amd64: build bb_clientd.deb",
195-
"run": "bazel build --stamp --platforms=@rules_go//go/toolchain:linux_amd64 //:bb_clientd_deb"
217+
"name": "Installing Bazel",
218+
"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}",
219+
"shell": "bash"
196220
},
197221
{
198-
"name": "linux_amd64: copy bb_clientd.deb",
199-
"run": "rm -f bb_clientd.deb && cp bazel-bin/bb_clientd_deb.deb bb_clientd.deb"
222+
"name": "Reformat",
223+
"run": "bazel run @com_github_buildbarn_bb_storage//tools:reformat"
200224
},
201225
{
202-
"name": "linux_amd64: upload bb_clientd.deb",
203-
"uses": "actions/upload-artifact@v4",
204-
"with": {
205-
"name": "bb_clientd.linux_amd64.deb",
206-
"path": "bb_clientd.deb"
207-
}
226+
"name": "Test style conformance",
227+
"run": "git add . && git diff --exit-code HEAD --"
228+
},
229+
{
230+
"name": "Golint",
231+
"run": "bazel run @org_golang_x_lint//golint -- -set_exit_status $(pwd)/..."
208232
}
209233
]
210234
}
211235
},
212-
"name": "master",
236+
"name": "main",
213237
"on": {
214238
"push": {
215239
"branches": [
216-
"main",
217-
"master"
240+
"main"
218241
]
219242
}
220243
}

0 commit comments

Comments
 (0)