fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
7f2b47cb
patching
1"""Bzlmod module extensions that are only used internally""" 2 3load ( "@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" ) 4load ( "//bindgen:repositories.bzl" , "rust_bindgen_dependencies" ) 5load ( "//crate_universe:repositories.bzl" , "crate_universe_dependencies" ) 6load ( "//proto/prost:repositories.bzl" , "rust_prost_dependencies" ) 7load ( "//proto/protobuf:repositories.bzl" , "rust_proto_protobuf_dependencies" ) 8load ( "//rust/private:repository_utils.bzl" , "TINYJSON_KWARGS" ) 9load ( "//test:deps.bzl" , "rules_rust_test_deps" ) 10load ( "//tools/rust_analyzer:deps.bzl" , "rust_analyzer_dependencies" ) 11load ( "//wasm_bindgen:repositories.bzl" , "rust_wasm_bindgen_dependencies" ) 12 13def _internal_deps_impl ( module_ctx ): 14# This should contain the subset of WORKSPACE.bazel that defines 15# repositories. 16 17# We don't want rules_rust_dependencies, as they contain things like 18# rules_cc, which is already declared in MODULE.bazel. 19direct_deps = [ struct ( repo = "rules_rust_tinyjson" , is_dev_dep = False )] 20http_archive ( ** TINYJSON_KWARGS ) 21 22direct_deps . extend ( crate_universe_dependencies ()) 23direct_deps . extend ( rust_prost_dependencies ( bzlmod = True )) 24direct_deps . extend ( rust_proto_protobuf_dependencies ( bzlmod = True )) 25direct_deps . extend ( rust_bindgen_dependencies ()) 26direct_deps . extend ( rust_analyzer_dependencies ()) 27direct_deps . extend ( rust_wasm_bindgen_dependencies ()) 28direct_deps . extend ( rules_rust_test_deps ()) 29 30# is_dev_dep is ignored here. It's not relevant for internal_deps, as dev 31# dependencies are only relevant for module extensions that can be used 32# by other MODULES. 33return module_ctx . extension_metadata ( 34root_module_direct_deps = [ repo . repo for repo in direct_deps ], 35root_module_direct_dev_deps = [], 36) 37 38# This is named a single character to reduce the size of path names when running build scripts, to reduce the chance 39# of hitting the 260 character windows path name limit. 40i = module_extension ( 41doc = "Dependencies for rules_rust" , 42implementation = _internal_deps_impl , 43)