Skip to content

Commit 2cb8ee9

Browse files
authored
Update dependencies (#66)
1 parent 4282481 commit 2cb8ee9

File tree

22 files changed

+806
-856
lines changed

22 files changed

+806
-856
lines changed

.bazelrc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
run --workspace_status_command="bash tools/workspace-status.sh"
2+
common --enable_platform_specific_config
3+
common --incompatible_enable_proto_toolchain_resolution
4+
common --protocopt=--fatal_warnings
25

3-
# absl requires compiling with C++14 or later, which the toolchain doesn't do by
4-
# default; host tooling (gRPC? protobuf?) requires absl.
5-
build --host_cxxopt=-std=c++17
6+
# Required to make protobuf compile on Windows
7+
common:windows --host_cxxopt=/std:c++17 --define=protobuf_allow_msvc=true

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.3.1
1+
9.0.0rc1
Lines changed: 86 additions & 73 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"
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"
3715
},
3816
{
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"
17+
"if": "matrix.host.platform_name == 'windows_amd64'",
18+
"name": "Override .bazelrc",
19+
"run": "echo \"startup --output_base=D:/bazel_output\" >> .bazelrc"
4120
},
4221
{
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 //..."
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 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
5725
},
5826
{
27+
"if": "matrix.host.upload",
5928
"name": "linux_amd64: copy bb_remote_asset",
6029
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_amd64 //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
6130
},
6231
{
32+
"if": "matrix.host.upload",
6333
"name": "linux_amd64: upload bb_remote_asset",
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 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
7344
},
7445
{
46+
"if": "matrix.host.upload",
7547
"name": "linux_386: copy bb_remote_asset",
7648
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_386 //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
7749
},
7850
{
51+
"if": "matrix.host.upload",
7952
"name": "linux_386: upload bb_remote_asset",
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 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
8963
},
9064
{
65+
"if": "matrix.host.upload",
9166
"name": "linux_arm: copy bb_remote_asset",
9267
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
9368
},
9469
{
70+
"if": "matrix.host.upload",
9571
"name": "linux_arm: upload bb_remote_asset",
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 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
10582
},
10683
{
84+
"if": "matrix.host.upload",
10785
"name": "linux_arm64: copy bb_remote_asset",
10886
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:linux_arm64 //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
10987
},
11088
{
89+
"if": "matrix.host.upload",
11190
"name": "linux_arm64: upload bb_remote_asset",
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 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
121101
},
122102
{
103+
"if": "matrix.host.upload",
123104
"name": "darwin_amd64: copy bb_remote_asset",
124105
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_amd64 //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
125106
},
126107
{
108+
"if": "matrix.host.upload",
127109
"name": "darwin_amd64: upload bb_remote_asset",
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 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
137120
},
138121
{
122+
"if": "matrix.host.upload",
139123
"name": "darwin_arm64: copy bb_remote_asset",
140124
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:darwin_arm64 //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
141125
},
142126
{
127+
"if": "matrix.host.upload",
143128
"name": "darwin_arm64: upload bb_remote_asset",
144129
"uses": "actions/upload-artifact@v4",
145130
"with": {
@@ -148,57 +133,85 @@
148133
}
149134
},
150135
{
151-
"name": "freebsd_amd64: build and test",
152-
"run": "bazel build --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_remote_asset"
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 --@bazel_tools//tools/test:incompatible_use_default_test_toolchain=False' }} //..."
153139
},
154140
{
141+
"if": "matrix.host.upload",
155142
"name": "freebsd_amd64: copy bb_remote_asset",
156143
"run": "rm -f bb_remote_asset && bazel run --run_under cp --platforms=@rules_go//go/toolchain:freebsd_amd64 //cmd/bb_remote_asset $(pwd)/bb_remote_asset"
157144
},
158145
{
146+
"if": "matrix.host.upload",
159147
"name": "freebsd_amd64: upload bb_remote_asset",
160148
"uses": "actions/upload-artifact@v4",
161149
"with": {
162150
"name": "bb_remote_asset.freebsd_amd64",
163151
"path": "bb_remote_asset"
164152
}
165153
},
166-
{
167-
"name": "windows_amd64: build and test",
168-
"run": "bazel build --platforms=@rules_go//go/toolchain:windows_amd64 //cmd/bb_remote_asset"
169-
},
170-
{
171-
"name": "windows_amd64: copy bb_remote_asset",
172-
"run": "rm -f bb_remote_asset.exe && bazel run --run_under cp --platforms=@rules_go//go/toolchain:windows_amd64 //cmd/bb_remote_asset $(pwd)/bb_remote_asset.exe"
173-
},
174-
{
175-
"name": "windows_amd64: upload bb_remote_asset",
176-
"uses": "actions/upload-artifact@v4",
177-
"with": {
178-
"name": "bb_remote_asset.windows_amd64",
179-
"path": "bb_remote_asset.exe"
180-
}
181-
},
182154
{
183155
"env": {
184156
"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
185157
},
158+
"if": "matrix.host.upload",
186159
"name": "Install Docker credentials",
187160
"run": "echo \"${GITHUB_TOKEN}\" | docker login ghcr.io -u $ --password-stdin"
188161
},
189162
{
163+
"if": "matrix.host.upload",
190164
"name": "Push container bb_remote_asset:bb_remote_asset",
191165
"run": "bazel run --stamp //cmd/bb_remote_asset:bb_remote_asset_container_push"
192166
}
167+
],
168+
"strategy": {
169+
"matrix": {
170+
"host": [
171+
{
172+
"bazel_os": "linux",
173+
"cross_compile": true,
174+
"os": "ubuntu-latest",
175+
"platform_name": "linux_amd64",
176+
"upload": true
177+
}
178+
]
179+
}
180+
}
181+
},
182+
"lint": {
183+
"name": "lint",
184+
"runs-on": "ubuntu-latest",
185+
"steps": [
186+
{
187+
"name": "Check out source code",
188+
"uses": "actions/checkout@v1"
189+
},
190+
{
191+
"name": "Installing Bazel",
192+
"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}",
193+
"shell": "bash"
194+
},
195+
{
196+
"name": "Reformat",
197+
"run": "bazel run @com_github_buildbarn_bb_storage//tools:reformat"
198+
},
199+
{
200+
"name": "Test style conformance",
201+
"run": "git add . && git diff --exit-code HEAD --"
202+
},
203+
{
204+
"name": "Golint",
205+
"run": "bazel run @org_golang_x_lint//golint -- -set_exit_status $(pwd)/..."
206+
}
193207
]
194208
}
195209
},
196-
"name": "master",
210+
"name": "main",
197211
"on": {
198212
"push": {
199213
"branches": [
200-
"main",
201-
"master"
214+
"main"
202215
]
203216
}
204217
}

0 commit comments

Comments
 (0)