File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,20 @@ Using Protocol Buffers with Bazel has always been difficult.
15
15
This makes it difficult to migrate to a monorepo, allowing some applications to move from their separate repo without
16
16
changing their dependency versions.
17
17
18
+ ## Ensure protobuf and gRPC never built
19
+
20
+ You can ensure that protobuf and grpc is never built from source by breaking the CC compilation.
21
+
22
+ Simply drop this in your ` .bazelrc `
23
+
24
+ ```
25
+ # Ensure that we don't accidentally build protobuf or gRPC
26
+ common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
27
+ common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
28
+ common --per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
29
+ common --host_per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
30
+ ```
31
+
18
32
## Support matrix
19
33
20
34
Minimum versions:
Original file line number Diff line number Diff line change @@ -6,3 +6,9 @@ common --@aspect_rules_py//py:interpreter_version=3.9.18
6
6
common --host_platform=//tools:no_cgo_host_platform
7
7
common --@aspect_rules_ts//ts:skipLibCheck=always
8
8
common --@aspect_rules_ts//ts:default_to_tsc_transpiler
9
+
10
+ # Ensure that we don't accidentally build protobuf or gRPC
11
+ common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
12
+ common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
13
+ common --per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
14
+ common --host_per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
You can’t perform that action at this time.
0 commit comments