fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
0e2409ef
patching
1load ( "@bazel_skylib//:bzl_library.bzl" , "bzl_library" ) 2load ( "@bazel_skylib//rules:common_settings.bzl" , "bool_flag" , "string_flag" ) 3load ( "//rust/private:unpretty.bzl" , "rust_unpretty_flag" ) 4load ( ":incompatible.bzl" , "incompatible_flag" ) 5 6package ( default_visibility = [ "//visibility:public" ]) 7 8bzl_library ( 9name = "bzl_lib" , 10srcs = glob ([ "**/*.bzl" ]), 11) 12 13rust_unpretty_flag ( 14name = "unpretty" , 15build_setting_default = [ 16"ast-tree,expanded" , 17"ast-tree" , 18"expanded,hygiene" , 19"expanded,identified" , 20"expanded" , 21"hir-tree" , 22"hir,identified" , 23"hir,typed" , 24"hir" , 25"identified" , 26"mir-cfg" , 27"mir" , 28"normal" , 29], 30) 31 32# A flag controlling whether to rename first-party crates such that their names 33# encode the Bazel package and target name, instead of just the target name. 34# 35# First-party vs. third-party crates are identified using the value of 36# //settings:third_party_dir. 37bool_flag ( 38name = "rename_first_party_crates" , 39build_setting_default = False , 40) 41 42# A flag specifying the location of vendored third-party rust crates within this 43# repository that must not be renamed when `rename_first_party_crates` is enabled. 44# 45# Must be specified as a Bazel package, e.g. "//some/location/in/repo". 46string_flag ( 47name = "third_party_dir" , 48build_setting_default = "//third_party/rust" , 49) 50 51# A flag to control whether rust_library and rust_binary targets should 52# implicitly depend on the *real* import macro, or on a no-op target. 53bool_flag ( 54name = "use_real_import_macro" , 55build_setting_default = False , 56) 57 58# When set, this flag causes rustc to emit .rmeta files and use them for rlib -> rlib dependencies. 59# While this involves one extra (short) rustc invocation to build the rmeta file, 60# it allows library dependencies to be unlocked much sooner, increasing parallelism during compilation. 61bool_flag ( 62name = "pipelined_compilation" , 63build_setting_default = False , 64) 65 66# A flag to control whether to link rust_binary and rust_test targets using 67# cc_common.link instead of rustc. 68bool_flag ( 69name = "experimental_use_cc_common_link" , 70build_setting_default = False , 71) 72 73# A flag to indicate that a global allocator is in use when using --@rules_rust//rust/settings:experimental_use_cc_common_link 74# Users need to specify this flag because rustc generates different set of symbols at link time when a global allocator is in use. 75# When the linking is not done by rustc, the `rust_toolchain` itself provides the appropriate set of symbols. 76bool_flag ( 77name = "experimental_use_global_allocator" , 78build_setting_default = False , 79) 80 81# A flag to have coverage tooling added as `coverage_common.instrumented_files_info.metadata_files` instead of 82# reporting tools like `llvm-cov` and `llvm-profdata` as runfiles to each test. 83bool_flag ( 84name = "experimental_use_coverage_metadata_files" , 85build_setting_default = False , 86) 87 88# A flag to set rustc --sysroot flag to the sysroot generated by rust_toolchain 89incompatible_flag ( 90name = "experimental_toolchain_generated_sysroot" , 91build_setting_default = True , 92issue = "https://github.com/bazelbuild/rules_rust/issues/2039" , 93) 94 95# A flag to control whether to link libstd dynamically. 96bool_flag ( 97name = "experimental_link_std_dylib" , 98build_setting_default = False , 99) 100 101# A flag to control whether the shell path from a shell toolchain (`@bazel_tools//tools/sh:toolchain_type`) 102# is embedded into the bootstrap process wrapper for the `.sh` file. 103bool_flag ( 104name = "experimental_use_sh_toolchain_for_bootstrap_process_wrapper" , 105build_setting_default = False , 106)