File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -22,20 +22,16 @@ cat << EOF
22222. Add to your \` MODULE.bazel\`  file: 
2323
2424\`\`\` starlark
25+ # NB: this must come BEFORE bazel_dep(name = "protobuf") because they register the from-source toolchain, 
26+ # and the first registration wins. 
2527bazel_dep(name = "toolchains_protoc", version = "${TAG: 1} ") 
2628
2729# Optional: choose a version of protoc rather than the latest. 
2830protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc") 
2931protoc.toolchain( 
30-     # Creates a repository to satisfy well-known-types dependencies such as 
31-     # deps=["@com_google_protobuf//:any_proto"] 
32-     google_protobuf = "com_google_protobuf", 
3332    # Pin to any version of protoc 
3433    version = "v26.0", 
3534) 
36- use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub") 
37- 
38- register_toolchains("@toolchains_protoc_hub//:all") 
3935\`\`\` 
4036
4137## Using WORKSPACE 
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ common --host_platform=//tools:no_cgo_host_platform
77common --@aspect_rules_ts//ts:skipLibCheck=always
88common --@aspect_rules_ts//ts:default_to_tsc_transpiler
99
10+ common --java_runtime_version=remotejdk_11
11+ 
1012# Ensure that we don't accidentally build protobuf or gRPC
1113common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
1214common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
Original file line number Diff line number Diff line change @@ -37,9 +37,7 @@ protoc.toolchain(
3737    # Demonstrate overriding the default version 
3838    version  =  "v28.0" ,
3939)
40- use_repo (protoc , "com_google_protobuf" , "toolchains_protoc_hub" )
41- 
42- register_toolchains ("@toolchains_protoc_hub//:all" )
40+ use_repo (protoc , "com_google_protobuf" )
4341
4442# NB: the `:all` here is critical, because `proto_lang_toolchain` expands into two targets: 
4543# - proto_lang_toolchain rule [name] 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments