File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 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.
1515  This makes it difficult to migrate to a monorepo, allowing some applications to move from their separate repo without
1616  changing their dependency versions.
1717
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+ 
1832## Support matrix  
1933
2034Minimum 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
66common --host_platform=//tools:no_cgo_host_platform
77common --@aspect_rules_ts//ts:skipLibCheck=always
88common --@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