1*d4726bddSHONG Yifanworkspace(name = "examples") 2*d4726bddSHONG Yifan 3*d4726bddSHONG Yifanlocal_repository( 4*d4726bddSHONG Yifan name = "rules_rust", 5*d4726bddSHONG Yifan path = "../../", 6*d4726bddSHONG Yifan) 7*d4726bddSHONG Yifan 8*d4726bddSHONG Yifanload("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains") 9*d4726bddSHONG Yifan 10*d4726bddSHONG Yifanrules_rust_dependencies() 11*d4726bddSHONG Yifan 12*d4726bddSHONG Yifanrust_register_toolchains( 13*d4726bddSHONG Yifan edition = "2018", 14*d4726bddSHONG Yifan) 15*d4726bddSHONG Yifan 16*d4726bddSHONG Yifanload("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies") 17*d4726bddSHONG Yifan 18*d4726bddSHONG Yifancrate_universe_dependencies(bootstrap = True) 19*d4726bddSHONG Yifan 20*d4726bddSHONG Yifanload("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository", "render_config", "splicing_config") 21*d4726bddSHONG Yifan 22*d4726bddSHONG Yifan############################################################################### 23*d4726bddSHONG Yifan# A L I A S R U L E 24*d4726bddSHONG Yifan############################################################################### 25*d4726bddSHONG Yifan 26*d4726bddSHONG Yifancrates_repository( 27*d4726bddSHONG Yifan name = "alias_rule_global_alias_annotation_none", 28*d4726bddSHONG Yifan annotations = { 29*d4726bddSHONG Yifan "test_data_passing_crate": [crate.annotation( 30*d4726bddSHONG Yifan alias_rule = None, 31*d4726bddSHONG Yifan )], 32*d4726bddSHONG Yifan }, 33*d4726bddSHONG Yifan cargo_lockfile = "//alias_rule:Cargo.Bazel.lock", 34*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 35*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 36*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 37*d4726bddSHONG Yifan lockfile = "//alias_rule:cargo-bazel-lock_global_alias_annotation_none.json", 38*d4726bddSHONG Yifan packages = { 39*d4726bddSHONG Yifan "test_data_passing_crate": crate.spec( 40*d4726bddSHONG Yifan version = "0.1.0", 41*d4726bddSHONG Yifan ), 42*d4726bddSHONG Yifan }, 43*d4726bddSHONG Yifan render_config = render_config( 44*d4726bddSHONG Yifan default_alias_rule = "alias", 45*d4726bddSHONG Yifan ), 46*d4726bddSHONG Yifan) 47*d4726bddSHONG Yifan 48*d4726bddSHONG Yifanload( 49*d4726bddSHONG Yifan "@alias_rule_global_alias_annotation_none//:defs.bzl", 50*d4726bddSHONG Yifan alias_rule_global_alias_annotation_none_crate_repositories = "crate_repositories", 51*d4726bddSHONG Yifan) 52*d4726bddSHONG Yifan 53*d4726bddSHONG Yifanalias_rule_global_alias_annotation_none_crate_repositories() 54*d4726bddSHONG Yifan 55*d4726bddSHONG Yifancrates_repository( 56*d4726bddSHONG Yifan name = "alias_rule_global_alias_annotation_opt", 57*d4726bddSHONG Yifan annotations = { 58*d4726bddSHONG Yifan "test_data_passing_crate": [crate.annotation( 59*d4726bddSHONG Yifan alias_rule = "opt", 60*d4726bddSHONG Yifan )], 61*d4726bddSHONG Yifan }, 62*d4726bddSHONG Yifan cargo_lockfile = "//alias_rule:Cargo.Bazel.lock", 63*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 64*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 65*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 66*d4726bddSHONG Yifan lockfile = "//alias_rule:cargo-bazel-lock_global_alias_annotation_opt.json", 67*d4726bddSHONG Yifan packages = { 68*d4726bddSHONG Yifan "test_data_passing_crate": crate.spec( 69*d4726bddSHONG Yifan version = "0.1.0", 70*d4726bddSHONG Yifan ), 71*d4726bddSHONG Yifan }, 72*d4726bddSHONG Yifan render_config = render_config( 73*d4726bddSHONG Yifan default_alias_rule = "alias", 74*d4726bddSHONG Yifan ), 75*d4726bddSHONG Yifan) 76*d4726bddSHONG Yifan 77*d4726bddSHONG Yifanload( 78*d4726bddSHONG Yifan "@alias_rule_global_alias_annotation_opt//:defs.bzl", 79*d4726bddSHONG Yifan alias_rule_global_alias_annotation_opt_crate_repositories = "crate_repositories", 80*d4726bddSHONG Yifan) 81*d4726bddSHONG Yifan 82*d4726bddSHONG Yifanalias_rule_global_alias_annotation_opt_crate_repositories() 83*d4726bddSHONG Yifan 84*d4726bddSHONG Yifancrates_repository( 85*d4726bddSHONG Yifan name = "alias_rule_global_opt_annotation_none", 86*d4726bddSHONG Yifan annotations = { 87*d4726bddSHONG Yifan "test_data_passing_crate": [crate.annotation( 88*d4726bddSHONG Yifan alias_rule = None, 89*d4726bddSHONG Yifan )], 90*d4726bddSHONG Yifan }, 91*d4726bddSHONG Yifan cargo_lockfile = "//alias_rule:Cargo.Bazel.lock", 92*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 93*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 94*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 95*d4726bddSHONG Yifan lockfile = "//alias_rule:cargo-bazel-lock_global_opt_annotation_none.json", 96*d4726bddSHONG Yifan packages = { 97*d4726bddSHONG Yifan "test_data_passing_crate": crate.spec( 98*d4726bddSHONG Yifan version = "0.1.0", 99*d4726bddSHONG Yifan ), 100*d4726bddSHONG Yifan }, 101*d4726bddSHONG Yifan render_config = render_config( 102*d4726bddSHONG Yifan default_alias_rule = "opt", 103*d4726bddSHONG Yifan ), 104*d4726bddSHONG Yifan) 105*d4726bddSHONG Yifan 106*d4726bddSHONG Yifanload( 107*d4726bddSHONG Yifan "@alias_rule_global_opt_annotation_none//:defs.bzl", 108*d4726bddSHONG Yifan alias_rule_global_opt_annotation_none_crate_repositories = "crate_repositories", 109*d4726bddSHONG Yifan) 110*d4726bddSHONG Yifan 111*d4726bddSHONG Yifanalias_rule_global_opt_annotation_none_crate_repositories() 112*d4726bddSHONG Yifan 113*d4726bddSHONG Yifancrates_repository( 114*d4726bddSHONG Yifan name = "alias_rule_global_opt_annotation_alias", 115*d4726bddSHONG Yifan annotations = { 116*d4726bddSHONG Yifan "test_data_passing_crate": [crate.annotation( 117*d4726bddSHONG Yifan alias_rule = "alias", 118*d4726bddSHONG Yifan )], 119*d4726bddSHONG Yifan }, 120*d4726bddSHONG Yifan cargo_lockfile = "//alias_rule:Cargo.Bazel.lock", 121*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 122*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 123*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 124*d4726bddSHONG Yifan lockfile = "//alias_rule:cargo-bazel-lock_global_opt_annotation_alias.json", 125*d4726bddSHONG Yifan packages = { 126*d4726bddSHONG Yifan "test_data_passing_crate": crate.spec( 127*d4726bddSHONG Yifan version = "0.1.0", 128*d4726bddSHONG Yifan ), 129*d4726bddSHONG Yifan }, 130*d4726bddSHONG Yifan render_config = render_config( 131*d4726bddSHONG Yifan default_alias_rule = "opt", 132*d4726bddSHONG Yifan ), 133*d4726bddSHONG Yifan) 134*d4726bddSHONG Yifan 135*d4726bddSHONG Yifanload( 136*d4726bddSHONG Yifan "@alias_rule_global_opt_annotation_alias//:defs.bzl", 137*d4726bddSHONG Yifan alias_rule_global_opt_annotation_alias_crate_repositories = "crate_repositories", 138*d4726bddSHONG Yifan) 139*d4726bddSHONG Yifan 140*d4726bddSHONG Yifanalias_rule_global_opt_annotation_alias_crate_repositories() 141*d4726bddSHONG Yifan 142*d4726bddSHONG Yifancrates_repository( 143*d4726bddSHONG Yifan name = "alias_rule_global_opt_annotation_dbg", 144*d4726bddSHONG Yifan annotations = { 145*d4726bddSHONG Yifan "test_data_passing_crate": [crate.annotation( 146*d4726bddSHONG Yifan alias_rule = "dbg", 147*d4726bddSHONG Yifan )], 148*d4726bddSHONG Yifan }, 149*d4726bddSHONG Yifan cargo_lockfile = "//alias_rule:Cargo.Bazel.lock", 150*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 151*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 152*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 153*d4726bddSHONG Yifan lockfile = "//alias_rule:cargo-bazel-lock_global_opt_annotation_dbg.json", 154*d4726bddSHONG Yifan packages = { 155*d4726bddSHONG Yifan "test_data_passing_crate": crate.spec( 156*d4726bddSHONG Yifan version = "0.1.0", 157*d4726bddSHONG Yifan ), 158*d4726bddSHONG Yifan }, 159*d4726bddSHONG Yifan render_config = render_config( 160*d4726bddSHONG Yifan default_alias_rule = "opt", 161*d4726bddSHONG Yifan ), 162*d4726bddSHONG Yifan) 163*d4726bddSHONG Yifan 164*d4726bddSHONG Yifanload( 165*d4726bddSHONG Yifan "@alias_rule_global_opt_annotation_dbg//:defs.bzl", 166*d4726bddSHONG Yifan alias_rule_global_opt_annotation_dbg_crate_repositories = "crate_repositories", 167*d4726bddSHONG Yifan) 168*d4726bddSHONG Yifan 169*d4726bddSHONG Yifanalias_rule_global_opt_annotation_dbg_crate_repositories() 170*d4726bddSHONG Yifan 171*d4726bddSHONG Yifancrates_repository( 172*d4726bddSHONG Yifan name = "alias_rule_global_dbg_annotation_fastbuild", 173*d4726bddSHONG Yifan annotations = { 174*d4726bddSHONG Yifan "test_data_passing_crate": [crate.annotation( 175*d4726bddSHONG Yifan alias_rule = "fastbuild", 176*d4726bddSHONG Yifan )], 177*d4726bddSHONG Yifan }, 178*d4726bddSHONG Yifan cargo_lockfile = "//alias_rule:Cargo.Bazel.lock", 179*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 180*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 181*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 182*d4726bddSHONG Yifan lockfile = "//alias_rule:cargo-bazel-lock_global_dbg_annotation_fastbuild.json", 183*d4726bddSHONG Yifan packages = { 184*d4726bddSHONG Yifan "test_data_passing_crate": crate.spec( 185*d4726bddSHONG Yifan version = "0.1.0", 186*d4726bddSHONG Yifan ), 187*d4726bddSHONG Yifan }, 188*d4726bddSHONG Yifan render_config = render_config( 189*d4726bddSHONG Yifan default_alias_rule = "dbg", 190*d4726bddSHONG Yifan ), 191*d4726bddSHONG Yifan) 192*d4726bddSHONG Yifan 193*d4726bddSHONG Yifanload( 194*d4726bddSHONG Yifan "@alias_rule_global_dbg_annotation_fastbuild//:defs.bzl", 195*d4726bddSHONG Yifan alias_rule_global_dbg_annotation_fastbuild_crate_repositories = "crate_repositories", 196*d4726bddSHONG Yifan) 197*d4726bddSHONG Yifan 198*d4726bddSHONG Yifanalias_rule_global_dbg_annotation_fastbuild_crate_repositories() 199*d4726bddSHONG Yifan 200*d4726bddSHONG Yifancrates_repository( 201*d4726bddSHONG Yifan name = "alias_rule_global_custom_annotation_none", 202*d4726bddSHONG Yifan annotations = { 203*d4726bddSHONG Yifan "test_data_passing_crate": [crate.annotation( 204*d4726bddSHONG Yifan alias_rule = None, 205*d4726bddSHONG Yifan )], 206*d4726bddSHONG Yifan }, 207*d4726bddSHONG Yifan cargo_lockfile = "//alias_rule:Cargo.Bazel.lock", 208*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 209*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 210*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 211*d4726bddSHONG Yifan lockfile = "//alias_rule:cargo-bazel-lock_global_custom_annotation_none.json", 212*d4726bddSHONG Yifan packages = { 213*d4726bddSHONG Yifan "test_data_passing_crate": crate.spec( 214*d4726bddSHONG Yifan version = "0.1.0", 215*d4726bddSHONG Yifan ), 216*d4726bddSHONG Yifan }, 217*d4726bddSHONG Yifan render_config = render_config( 218*d4726bddSHONG Yifan default_alias_rule = "@//alias_rule:alias_rules.bzl:alias_rule", 219*d4726bddSHONG Yifan ), 220*d4726bddSHONG Yifan) 221*d4726bddSHONG Yifan 222*d4726bddSHONG Yifanload( 223*d4726bddSHONG Yifan "@alias_rule_global_custom_annotation_none//:defs.bzl", 224*d4726bddSHONG Yifan alias_rule_global_custom_annotation_none_crate_repositories = "crate_repositories", 225*d4726bddSHONG Yifan) 226*d4726bddSHONG Yifan 227*d4726bddSHONG Yifanalias_rule_global_custom_annotation_none_crate_repositories() 228*d4726bddSHONG Yifan 229*d4726bddSHONG Yifan############################################################################### 230*d4726bddSHONG Yifan# C A R G O A L I A S E S 231*d4726bddSHONG Yifan############################################################################### 232*d4726bddSHONG Yifan 233*d4726bddSHONG Yifancrates_repository( 234*d4726bddSHONG Yifan name = "cargo_aliases", 235*d4726bddSHONG Yifan annotations = { 236*d4726bddSHONG Yifan "names": [crate.annotation( 237*d4726bddSHONG Yifan shallow_since = "1646516410 -0700", 238*d4726bddSHONG Yifan version = "0.12.1-dev", 239*d4726bddSHONG Yifan )], 240*d4726bddSHONG Yifan }, 241*d4726bddSHONG Yifan cargo_lockfile = "//cargo_aliases:Cargo.Bazel.lock", 242*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 243*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 244*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 245*d4726bddSHONG Yifan lockfile = "//cargo_aliases:cargo-bazel-lock.json", 246*d4726bddSHONG Yifan manifests = ["//cargo_aliases:Cargo.toml"], 247*d4726bddSHONG Yifan) 248*d4726bddSHONG Yifan 249*d4726bddSHONG Yifanload( 250*d4726bddSHONG Yifan "@cargo_aliases//:defs.bzl", 251*d4726bddSHONG Yifan cargo_aliases_crate_repositories = "crate_repositories", 252*d4726bddSHONG Yifan) 253*d4726bddSHONG Yifan 254*d4726bddSHONG Yifancargo_aliases_crate_repositories() 255*d4726bddSHONG Yifan 256*d4726bddSHONG Yifan############################################################################### 257*d4726bddSHONG Yifan# C A R G O B I N D E P S 258*d4726bddSHONG Yifan############################################################################### 259*d4726bddSHONG Yifan 260*d4726bddSHONG Yifancrates_repository( 261*d4726bddSHONG Yifan name = "crate_index_cargo_bindeps", 262*d4726bddSHONG Yifan cargo_lockfile = "//cargo_bindeps:Cargo.lock", 263*d4726bddSHONG Yifan generate_binaries = True, 264*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 265*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 266*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 267*d4726bddSHONG Yifan manifests = ["//cargo_bindeps:Cargo.toml"], 268*d4726bddSHONG Yifan rust_version = "nightly", 269*d4726bddSHONG Yifan) 270*d4726bddSHONG Yifan 271*d4726bddSHONG Yifanload( 272*d4726bddSHONG Yifan "@crate_index_cargo_bindeps//:defs.bzl", 273*d4726bddSHONG Yifan cargo_bindeps_crate_repositories = "crate_repositories", 274*d4726bddSHONG Yifan) 275*d4726bddSHONG Yifan 276*d4726bddSHONG Yifancargo_bindeps_crate_repositories() 277*d4726bddSHONG Yifan 278*d4726bddSHONG Yifan############################################################################### 279*d4726bddSHONG Yifan# C A R G O L O C A L 280*d4726bddSHONG Yifan############################################################################### 281*d4726bddSHONG Yifan 282*d4726bddSHONG Yifancrates_repository( 283*d4726bddSHONG Yifan name = "crate_index_cargo_local", 284*d4726bddSHONG Yifan cargo_lockfile = "//cargo_local:Cargo.lock", 285*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 286*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 287*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 288*d4726bddSHONG Yifan manifests = ["//cargo_local:Cargo.toml"], 289*d4726bddSHONG Yifan) 290*d4726bddSHONG Yifan 291*d4726bddSHONG Yifanload( 292*d4726bddSHONG Yifan "@crate_index_cargo_local//:defs.bzl", 293*d4726bddSHONG Yifan cargo_local_crate_repositories = "crate_repositories", 294*d4726bddSHONG Yifan) 295*d4726bddSHONG Yifan 296*d4726bddSHONG Yifancargo_local_crate_repositories() 297*d4726bddSHONG Yifan 298*d4726bddSHONG Yifan############################################################################### 299*d4726bddSHONG Yifan# C A R G O R E M O T E 300*d4726bddSHONG Yifan############################################################################### 301*d4726bddSHONG Yifan 302*d4726bddSHONG Yifanload("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 303*d4726bddSHONG Yifan 304*d4726bddSHONG Yifanhttp_archive( 305*d4726bddSHONG Yifan name = "names", 306*d4726bddSHONG Yifan build_file = "//cargo_remote:BUILD.names.bazel", 307*d4726bddSHONG Yifan sha256 = "eab40caca5805624ba31d028913931c3d054b22daafff6f43e3435cfa9fb761e", 308*d4726bddSHONG Yifan strip_prefix = "names-0.13.0", 309*d4726bddSHONG Yifan urls = ["https://github.com/fnichol/names/archive/refs/tags/v0.13.0.zip"], 310*d4726bddSHONG Yifan) 311*d4726bddSHONG Yifan 312*d4726bddSHONG Yifancrates_repository( 313*d4726bddSHONG Yifan name = "crate_index_cargo_remote", 314*d4726bddSHONG Yifan cargo_lockfile = "@names//:Cargo.lock", 315*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 316*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 317*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 318*d4726bddSHONG Yifan manifests = ["@names//:Cargo.toml"], 319*d4726bddSHONG Yifan) 320*d4726bddSHONG Yifan 321*d4726bddSHONG Yifanload( 322*d4726bddSHONG Yifan "@crate_index_cargo_remote//:defs.bzl", 323*d4726bddSHONG Yifan cargo_remote_crate_repositories = "crate_repositories", 324*d4726bddSHONG Yifan) 325*d4726bddSHONG Yifan 326*d4726bddSHONG Yifancargo_remote_crate_repositories() 327*d4726bddSHONG Yifan 328*d4726bddSHONG Yifan############################################################################### 329*d4726bddSHONG Yifan# C A R G O W O R K S P A C E 330*d4726bddSHONG Yifan############################################################################### 331*d4726bddSHONG Yifan 332*d4726bddSHONG Yifancrates_repository( 333*d4726bddSHONG Yifan name = "crate_index_cargo_workspace", 334*d4726bddSHONG Yifan cargo_config = "//cargo_workspace:.cargo/config.toml", 335*d4726bddSHONG Yifan cargo_lockfile = "//cargo_workspace:Cargo.Bazel.lock", 336*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 337*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 338*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 339*d4726bddSHONG Yifan lockfile = "//cargo_workspace:cargo-bazel-lock.json", 340*d4726bddSHONG Yifan manifests = [ 341*d4726bddSHONG Yifan "//cargo_workspace:Cargo.toml", 342*d4726bddSHONG Yifan "//cargo_workspace/num_printer:Cargo.toml", 343*d4726bddSHONG Yifan "//cargo_workspace/printer:Cargo.toml", 344*d4726bddSHONG Yifan "//cargo_workspace/rng:Cargo.toml", 345*d4726bddSHONG Yifan ], 346*d4726bddSHONG Yifan) 347*d4726bddSHONG Yifan 348*d4726bddSHONG Yifanload( 349*d4726bddSHONG Yifan "@crate_index_cargo_workspace//:defs.bzl", 350*d4726bddSHONG Yifan cargo_workspace_crate_repositories = "crate_repositories", 351*d4726bddSHONG Yifan) 352*d4726bddSHONG Yifan 353*d4726bddSHONG Yifancargo_workspace_crate_repositories() 354*d4726bddSHONG Yifan 355*d4726bddSHONG Yifan############################################################################### 356*d4726bddSHONG Yifan# C A R G O C O N D I T I O N A L D E P S 357*d4726bddSHONG Yifan############################################################################### 358*d4726bddSHONG Yifan 359*d4726bddSHONG Yifancrates_repository( 360*d4726bddSHONG Yifan name = "crate_index_cargo_conditional_deps", 361*d4726bddSHONG Yifan cargo_lockfile = "//cargo_conditional_deps:Cargo.Bazel.lock", 362*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 363*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 364*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 365*d4726bddSHONG Yifan lockfile = "//cargo_conditional_deps:cargo-bazel-lock.json", 366*d4726bddSHONG Yifan manifests = [ 367*d4726bddSHONG Yifan "//cargo_conditional_deps:Cargo.toml", 368*d4726bddSHONG Yifan ], 369*d4726bddSHONG Yifan) 370*d4726bddSHONG Yifan 371*d4726bddSHONG Yifanload( 372*d4726bddSHONG Yifan "@crate_index_cargo_conditional_deps//:defs.bzl", 373*d4726bddSHONG Yifan cargo_conditional_deps_crate_repositories = "crate_repositories", 374*d4726bddSHONG Yifan) 375*d4726bddSHONG Yifan 376*d4726bddSHONG Yifancargo_conditional_deps_crate_repositories() 377*d4726bddSHONG Yifan 378*d4726bddSHONG Yifan############################################################################### 379*d4726bddSHONG Yifan# M U L T I P A C K A G E 380*d4726bddSHONG Yifan############################################################################### 381*d4726bddSHONG Yifan 382*d4726bddSHONG Yifan# The name here needs to be short to avoid long path issues on windows 383*d4726bddSHONG Yifan# when running the `libnghttp2-sys` build script. 384*d4726bddSHONG Yifanmulti_pkg_example_name = "m_pkgs" 385*d4726bddSHONG Yifan 386*d4726bddSHONG Yifancrates_repository( 387*d4726bddSHONG Yifan name = multi_pkg_example_name, 388*d4726bddSHONG Yifan annotations = { 389*d4726bddSHONG Yifan "curl-sys": [crate.annotation( 390*d4726bddSHONG Yifan gen_build_script = False, 391*d4726bddSHONG Yifan deps = [ 392*d4726bddSHONG Yifan "@m_pkgs__curl//:curl", 393*d4726bddSHONG Yifan ], 394*d4726bddSHONG Yifan )], 395*d4726bddSHONG Yifan "httpmock": [crate.annotation( 396*d4726bddSHONG Yifan shallow_since = "1673473097 +0100", 397*d4726bddSHONG Yifan )], 398*d4726bddSHONG Yifan "isahc": [crate.annotation( 399*d4726bddSHONG Yifan shallow_since = "1667787880 -0600", 400*d4726bddSHONG Yifan )], 401*d4726bddSHONG Yifan "libnghttp2-sys": [crate.annotation( 402*d4726bddSHONG Yifan build_script_data_glob = ["nghttp2/**"], 403*d4726bddSHONG Yifan data_glob = ["nghttp2/**"], 404*d4726bddSHONG Yifan )], 405*d4726bddSHONG Yifan "wepoll-ffi": [crate.annotation( 406*d4726bddSHONG Yifan build_script_data_glob = ["vendor/**"], 407*d4726bddSHONG Yifan )], 408*d4726bddSHONG Yifan }, 409*d4726bddSHONG Yifan cargo_lockfile = "//multi_package:Cargo.Bazel.lock", 410*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 411*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 412*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 413*d4726bddSHONG Yifan lockfile = "//multi_package:cargo-bazel-lock.json", 414*d4726bddSHONG Yifan manifests = [ 415*d4726bddSHONG Yifan "//multi_package/pkg_a:Cargo.toml", 416*d4726bddSHONG Yifan "//multi_package/sub_pkgs/pkg_b:Cargo.toml", 417*d4726bddSHONG Yifan "//multi_package/sub_pkgs/pkg_c:Cargo.toml", 418*d4726bddSHONG Yifan ], 419*d4726bddSHONG Yifan) 420*d4726bddSHONG Yifan 421*d4726bddSHONG Yifanload("//multi_package/3rdparty:third_party_deps.bzl", "third_party_deps") 422*d4726bddSHONG Yifan 423*d4726bddSHONG Yifanthird_party_deps( 424*d4726bddSHONG Yifan prefix = multi_pkg_example_name, 425*d4726bddSHONG Yifan) 426*d4726bddSHONG Yifan 427*d4726bddSHONG Yifanload( 428*d4726bddSHONG Yifan "@m_pkgs//:defs.bzl", 429*d4726bddSHONG Yifan multi_pkg_crate_repositories = "crate_repositories", 430*d4726bddSHONG Yifan) 431*d4726bddSHONG Yifan 432*d4726bddSHONG Yifanmulti_pkg_crate_repositories() 433*d4726bddSHONG Yifan 434*d4726bddSHONG Yifan############################################################################### 435*d4726bddSHONG Yifan# N O C A R G O M A N I F E S T S 436*d4726bddSHONG Yifan############################################################################### 437*d4726bddSHONG Yifan 438*d4726bddSHONG Yifancrates_repository( 439*d4726bddSHONG Yifan name = "no_cargo", 440*d4726bddSHONG Yifan annotations = { 441*d4726bddSHONG Yifan "axum": [crate.annotation( 442*d4726bddSHONG Yifan compile_data_glob = ["**/*.md"], 443*d4726bddSHONG Yifan )], 444*d4726bddSHONG Yifan }, 445*d4726bddSHONG Yifan cargo_lockfile = "//no_cargo_manifests:Cargo.Bazel.lock", 446*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 447*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 448*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 449*d4726bddSHONG Yifan lockfile = "//no_cargo_manifests:cargo-bazel-lock.json", 450*d4726bddSHONG Yifan packages = { 451*d4726bddSHONG Yifan "axum": crate.spec( 452*d4726bddSHONG Yifan version = "0.4.0", 453*d4726bddSHONG Yifan ), 454*d4726bddSHONG Yifan "hyper": crate.spec( 455*d4726bddSHONG Yifan features = ["full"], 456*d4726bddSHONG Yifan version = "0.14.22", 457*d4726bddSHONG Yifan ), 458*d4726bddSHONG Yifan "mime": crate.spec( 459*d4726bddSHONG Yifan version = "0.3", 460*d4726bddSHONG Yifan ), 461*d4726bddSHONG Yifan "serde_json": crate.spec( 462*d4726bddSHONG Yifan version = "1.0", 463*d4726bddSHONG Yifan ), 464*d4726bddSHONG Yifan # TODO: This dependency is added and pinned forward due to the 465*d4726bddSHONG Yifan # following issue: https://github.com/hyperium/hyper/issues/3038 466*d4726bddSHONG Yifan "socket2": crate.spec( 467*d4726bddSHONG Yifan features = ["all"], 468*d4726bddSHONG Yifan version = "0.4.7", 469*d4726bddSHONG Yifan ), 470*d4726bddSHONG Yifan "tokio": crate.spec( 471*d4726bddSHONG Yifan features = ["full"], 472*d4726bddSHONG Yifan version = "1.17.0", 473*d4726bddSHONG Yifan ), 474*d4726bddSHONG Yifan "tower": crate.spec( 475*d4726bddSHONG Yifan features = ["util"], 476*d4726bddSHONG Yifan version = "0.4", 477*d4726bddSHONG Yifan ), 478*d4726bddSHONG Yifan "tower-http": crate.spec( 479*d4726bddSHONG Yifan features = ["trace"], 480*d4726bddSHONG Yifan version = "0.2.1", 481*d4726bddSHONG Yifan ), 482*d4726bddSHONG Yifan "tracing": crate.spec( 483*d4726bddSHONG Yifan version = "0.1", 484*d4726bddSHONG Yifan ), 485*d4726bddSHONG Yifan "tracing-subscriber": crate.spec( 486*d4726bddSHONG Yifan version = "0.3", 487*d4726bddSHONG Yifan ), 488*d4726bddSHONG Yifan }, 489*d4726bddSHONG Yifan splicing_config = splicing_config( 490*d4726bddSHONG Yifan resolver_version = "2", 491*d4726bddSHONG Yifan ), 492*d4726bddSHONG Yifan) 493*d4726bddSHONG Yifan 494*d4726bddSHONG Yifanload( 495*d4726bddSHONG Yifan "@no_cargo//:defs.bzl", 496*d4726bddSHONG Yifan no_cargo_crate_repositories = "crate_repositories", 497*d4726bddSHONG Yifan) 498*d4726bddSHONG Yifan 499*d4726bddSHONG Yifanno_cargo_crate_repositories() 500*d4726bddSHONG Yifan 501*d4726bddSHONG Yifan############################################################################### 502*d4726bddSHONG Yifan# U S I N G C X X C R A T E 503*d4726bddSHONG Yifan############################################################################### 504*d4726bddSHONG Yifan 505*d4726bddSHONG Yifan# CXX crate is a bit different since there are C++ headers provided. 506*d4726bddSHONG Yifan 507*d4726bddSHONG Yifancrates_repository( 508*d4726bddSHONG Yifan name = "using_cxx", 509*d4726bddSHONG Yifan cargo_lockfile = "//using_cxx:Cargo.Bazel.lock", 510*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 511*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 512*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 513*d4726bddSHONG Yifan lockfile = "//using_cxx:cargo-bazel-lock.json", 514*d4726bddSHONG Yifan packages = { 515*d4726bddSHONG Yifan "cxx": crate.spec( 516*d4726bddSHONG Yifan version = "1.0.109", 517*d4726bddSHONG Yifan ), 518*d4726bddSHONG Yifan }, 519*d4726bddSHONG Yifan splicing_config = splicing_config( 520*d4726bddSHONG Yifan resolver_version = "2", 521*d4726bddSHONG Yifan ), 522*d4726bddSHONG Yifan) 523*d4726bddSHONG Yifan 524*d4726bddSHONG Yifanload( 525*d4726bddSHONG Yifan "@using_cxx//:defs.bzl", 526*d4726bddSHONG Yifan using_cxx_crate_repositories = "crate_repositories", 527*d4726bddSHONG Yifan) 528*d4726bddSHONG Yifan 529*d4726bddSHONG Yifanusing_cxx_crate_repositories() 530*d4726bddSHONG Yifan 531*d4726bddSHONG Yifan# The codegen tool needed by cxx. 532*d4726bddSHONG Yifanhttp_archive( 533*d4726bddSHONG Yifan name = "cxxbridge-cmd", 534*d4726bddSHONG Yifan build_file_content = """ 535*d4726bddSHONG Yifanload("@rules_rust//rust:defs.bzl", "rust_binary") 536*d4726bddSHONG Yifanload("@cxxbridge_cmd_deps//:defs.bzl", "aliases", "all_crate_deps") 537*d4726bddSHONG Yifan 538*d4726bddSHONG Yifanrust_binary( 539*d4726bddSHONG Yifan name = "cxxbridge-cmd", 540*d4726bddSHONG Yifan srcs = glob(["src/**/*.rs"]), 541*d4726bddSHONG Yifan aliases = aliases(), 542*d4726bddSHONG Yifan data = [ 543*d4726bddSHONG Yifan "src/gen/include/cxx.h", 544*d4726bddSHONG Yifan ], 545*d4726bddSHONG Yifan edition = "2021", 546*d4726bddSHONG Yifan visibility = ["//visibility:public"], 547*d4726bddSHONG Yifan deps = all_crate_deps( 548*d4726bddSHONG Yifan normal = True, 549*d4726bddSHONG Yifan ), 550*d4726bddSHONG Yifan) 551*d4726bddSHONG Yifan """, 552*d4726bddSHONG Yifan sha256 = "d93600487d429c8bf013ee96719af4e62e809ac57fc4cac24f17cf58e4526009", 553*d4726bddSHONG Yifan strip_prefix = "cxxbridge-cmd-1.0.109", 554*d4726bddSHONG Yifan type = "tar.gz", 555*d4726bddSHONG Yifan urls = ["https://static.crates.io/crates/cxxbridge-cmd/cxxbridge-cmd-1.0.109.crate"], 556*d4726bddSHONG Yifan) 557*d4726bddSHONG Yifan 558*d4726bddSHONG Yifancrates_repository( 559*d4726bddSHONG Yifan name = "cxxbridge_cmd_deps", 560*d4726bddSHONG Yifan cargo_lockfile = "//using_cxx:cxxbridge-cmd.Cargo.lock", 561*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 562*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 563*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 564*d4726bddSHONG Yifan lockfile = "//using_cxx:cxxbridge-cmd.Cargo.Bazel.lock", 565*d4726bddSHONG Yifan manifests = ["@cxxbridge-cmd//:Cargo.toml"], 566*d4726bddSHONG Yifan splicing_config = splicing_config( 567*d4726bddSHONG Yifan resolver_version = "2", 568*d4726bddSHONG Yifan ), 569*d4726bddSHONG Yifan) 570*d4726bddSHONG Yifan 571*d4726bddSHONG Yifanload("@cxxbridge_cmd_deps//:defs.bzl", cxxbridge_cmd_deps = "crate_repositories") 572*d4726bddSHONG Yifan 573*d4726bddSHONG Yifancxxbridge_cmd_deps() 574*d4726bddSHONG Yifan 575*d4726bddSHONG Yifan############################################################################### 576*d4726bddSHONG Yifan# V E N D O R E X T E R N A L 577*d4726bddSHONG Yifan############################################################################### 578*d4726bddSHONG Yifan 579*d4726bddSHONG Yifanhttp_archive( 580*d4726bddSHONG Yifan name = "names_external", 581*d4726bddSHONG Yifan build_file = "//cargo_remote:BUILD.names.bazel", 582*d4726bddSHONG Yifan sha256 = "eab40caca5805624ba31d028913931c3d054b22daafff6f43e3435cfa9fb761e", 583*d4726bddSHONG Yifan strip_prefix = "names-0.13.0", 584*d4726bddSHONG Yifan urls = ["https://github.com/fnichol/names/archive/refs/tags/v0.13.0.zip"], 585*d4726bddSHONG Yifan) 586*d4726bddSHONG Yifan 587*d4726bddSHONG Yifanload( 588*d4726bddSHONG Yifan "//vendor_external/crates:crates.bzl", 589*d4726bddSHONG Yifan crates_vendor_external_repositories = "crate_repositories", 590*d4726bddSHONG Yifan) 591*d4726bddSHONG Yifan 592*d4726bddSHONG Yifancrates_vendor_external_repositories() 593*d4726bddSHONG Yifan 594*d4726bddSHONG Yifan############################################################################### 595*d4726bddSHONG Yifan# V E N D O R R E M O T E M A N I F E S T S 596*d4726bddSHONG Yifan############################################################################### 597*d4726bddSHONG Yifan 598*d4726bddSHONG Yifanload( 599*d4726bddSHONG Yifan "//vendor_remote_manifests/crates:crates.bzl", 600*d4726bddSHONG Yifan crates_vendor_manifests_repositories = "crate_repositories", 601*d4726bddSHONG Yifan) 602*d4726bddSHONG Yifan 603*d4726bddSHONG Yifancrates_vendor_manifests_repositories() 604*d4726bddSHONG Yifan 605*d4726bddSHONG Yifan############################################################################### 606*d4726bddSHONG Yifan# V E N D O R R E M O T E P A C K A G E S 607*d4726bddSHONG Yifan############################################################################### 608*d4726bddSHONG Yifan 609*d4726bddSHONG Yifanload( 610*d4726bddSHONG Yifan "//vendor_remote_pkgs/crates:crates.bzl", 611*d4726bddSHONG Yifan crates_vendor_packages_repositories = "crate_repositories", 612*d4726bddSHONG Yifan) 613*d4726bddSHONG Yifan 614*d4726bddSHONG Yifancrates_vendor_packages_repositories() 615*d4726bddSHONG Yifan 616*d4726bddSHONG Yifan############################################################################### 617*d4726bddSHONG Yifan# C O M P L I C A T E D D E P E N D E N C I E S 618*d4726bddSHONG Yifan############################################################################### 619*d4726bddSHONG Yifan 620*d4726bddSHONG Yifanhttp_archive( 621*d4726bddSHONG Yifan name = "rules_foreign_cc", 622*d4726bddSHONG Yifan sha256 = "1eee5d216a3cec7a4c731f71ed731ac353290b1db61ab68b79440655bcb9acaa", 623*d4726bddSHONG Yifan strip_prefix = "rules_foreign_cc-7ce62009557d73da9aa0d2a1ca7eded49078b3cf", 624*d4726bddSHONG Yifan # Pulls in https://github.com/bazelbuild/rules_foreign_cc/pull/1163 and https://github.com/bazelbuild/rules_foreign_cc/pull/1199 which aren't currently in a release. 625*d4726bddSHONG Yifan url = "https://github.com/bazelbuild/rules_foreign_cc/archive/7ce62009557d73da9aa0d2a1ca7eded49078b3cf.tar.gz", 626*d4726bddSHONG Yifan) 627*d4726bddSHONG Yifan 628*d4726bddSHONG Yifanload("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") 629*d4726bddSHONG Yifan 630*d4726bddSHONG Yifanrules_foreign_cc_dependencies() 631*d4726bddSHONG Yifan 632*d4726bddSHONG Yifanhttp_archive( 633*d4726bddSHONG Yifan name = "aspect_bazel_lib", 634*d4726bddSHONG Yifan sha256 = "f5ea76682b209cc0bd90d0f5a3b26d2f7a6a2885f0c5f615e72913f4805dbb0d", 635*d4726bddSHONG Yifan strip_prefix = "bazel-lib-2.5.0", 636*d4726bddSHONG Yifan url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.5.0/bazel-lib-v2.5.0.tar.gz", 637*d4726bddSHONG Yifan) 638*d4726bddSHONG Yifan 639*d4726bddSHONG Yifanload("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies", "aspect_bazel_lib_register_toolchains") 640*d4726bddSHONG Yifan 641*d4726bddSHONG Yifanaspect_bazel_lib_dependencies() 642*d4726bddSHONG Yifan 643*d4726bddSHONG Yifanaspect_bazel_lib_register_toolchains() 644*d4726bddSHONG Yifan 645*d4726bddSHONG Yifanload("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") 646*d4726bddSHONG Yifan 647*d4726bddSHONG Yifangit_repository( 648*d4726bddSHONG Yifan name = "boringssl", 649*d4726bddSHONG Yifan commit = "44b3df6f03d85c901767250329c571db405122d5", 650*d4726bddSHONG Yifan patch_args = ["-p1"], 651*d4726bddSHONG Yifan patches = [ 652*d4726bddSHONG Yifan "//complicated_dependencies:boringssl-filegroup.patch", 653*d4726bddSHONG Yifan # On the macOS bazelci builders, there's a system-installed openssl, and that takes priority over -isystem flags, which is what cc_library.includes uses. 654*d4726bddSHONG Yifan # This forces our local system-includes to be chosen with higher priority, which avoids conflicts. 655*d4726bddSHONG Yifan "//complicated_dependencies:boringssl-system-includes.patch", 656*d4726bddSHONG Yifan ], 657*d4726bddSHONG Yifan remote = "https://github.com/google/boringssl.git", 658*d4726bddSHONG Yifan) 659*d4726bddSHONG Yifan 660*d4726bddSHONG Yifancrates_repository( 661*d4726bddSHONG Yifan name = "complicated_dependencies", 662*d4726bddSHONG Yifan annotations = { 663*d4726bddSHONG Yifan # boringssl natively builds with Bazel, but boring-sys tries to build it with cmake. 664*d4726bddSHONG Yifan # We could pass boring-sys a cmake binary it can invoke, but the boring-sys build script wouldn't get to exploit the caching and parallelism of full Bazel builds of boringssl. 665*d4726bddSHONG Yifan # Instead, we use the build script env var hooks to point the build script at the output of Bazel building boringssl. 666*d4726bddSHONG Yifan "boring-sys": [ 667*d4726bddSHONG Yifan crate.annotation( 668*d4726bddSHONG Yifan build_script_data = [ 669*d4726bddSHONG Yifan "@//complicated_dependencies:boringssl_gen_dir", 670*d4726bddSHONG Yifan "@boringssl//:headers", 671*d4726bddSHONG Yifan ], 672*d4726bddSHONG Yifan build_script_env = { 673*d4726bddSHONG Yifan # Ideally this would use an execpath macro, but we need to point at a directory and that's fiddly. We could probably copy the directory somewhere and point at that... For now, this works. 674*d4726bddSHONG Yifan "BORING_BSSL_INCLUDE_PATH": "$${pwd}/external/boringssl/src/include", 675*d4726bddSHONG Yifan "BORING_BSSL_PATH": "$(execpath @//complicated_dependencies:boringssl_gen_dir)", 676*d4726bddSHONG Yifan }, 677*d4726bddSHONG Yifan compile_data = [ 678*d4726bddSHONG Yifan "@//complicated_dependencies:boringssl_gen_dir", 679*d4726bddSHONG Yifan "@boringssl//:headers", 680*d4726bddSHONG Yifan ], 681*d4726bddSHONG Yifan ), 682*d4726bddSHONG Yifan ], 683*d4726bddSHONG Yifan # zlib-ng-sys's build script invokes cmake, so we need to make cmake available. 684*d4726bddSHONG Yifan # Fortunately, rules_foreign_cc has a cmake toolchain we can use. 685*d4726bddSHONG Yifan "libz-ng-sys": [crate.annotation( 686*d4726bddSHONG Yifan # Setting build_script_data makes the files available on disk when the rule runs. 687*d4726bddSHONG Yifan build_script_data = ["@rules_foreign_cc//toolchains:current_cmake_toolchain"], 688*d4726bddSHONG Yifan build_script_env = { 689*d4726bddSHONG Yifan # The toolchain supplies a value of $(CMAKE) which is an execroot-relative path, so we need to prefix it with $${pwd}/ because build scripts don't typically run in the execroot unlike most bazel rules, for improved compatibility with Cargo. 690*d4726bddSHONG Yifan "CMAKE": "$${pwd}/$(CMAKE)", 691*d4726bddSHONG Yifan }, 692*d4726bddSHONG Yifan # Setting build_script_toolchains makes makefile variable substitution work so that we can reference $(CNAME) in attributes. 693*d4726bddSHONG Yifan build_script_toolchains = ["@rules_foreign_cc//toolchains:current_cmake_toolchain"], 694*d4726bddSHONG Yifan )], 695*d4726bddSHONG Yifan }, 696*d4726bddSHONG Yifan cargo_lockfile = "//complicated_dependencies:Cargo.Bazel.lock", 697*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 698*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 699*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 700*d4726bddSHONG Yifan lockfile = "//complicated_dependencies:cargo-bazel-lock.json", 701*d4726bddSHONG Yifan packages = { 702*d4726bddSHONG Yifan "boring": crate.spec( 703*d4726bddSHONG Yifan version = "3.0.4", 704*d4726bddSHONG Yifan ), 705*d4726bddSHONG Yifan "libz-ng-sys": crate.spec( 706*d4726bddSHONG Yifan version = "=1.1.15", 707*d4726bddSHONG Yifan ), 708*d4726bddSHONG Yifan }, 709*d4726bddSHONG Yifan splicing_config = splicing_config( 710*d4726bddSHONG Yifan resolver_version = "2", 711*d4726bddSHONG Yifan ), 712*d4726bddSHONG Yifan) 713*d4726bddSHONG Yifan 714*d4726bddSHONG Yifanload( 715*d4726bddSHONG Yifan "@complicated_dependencies//:defs.bzl", 716*d4726bddSHONG Yifan complicated_dependencies_crate_repositories = "crate_repositories", 717*d4726bddSHONG Yifan) 718*d4726bddSHONG Yifan 719*d4726bddSHONG Yifancomplicated_dependencies_crate_repositories() 720*d4726bddSHONG Yifan 721*d4726bddSHONG Yifan############################################################################### 722*d4726bddSHONG Yifan# O V E R R I D E T A R G E T 723*d4726bddSHONG Yifan############################################################################### 724*d4726bddSHONG Yifan 725*d4726bddSHONG Yifancrates_repository( 726*d4726bddSHONG Yifan name = "override_target", 727*d4726bddSHONG Yifan annotations = { 728*d4726bddSHONG Yifan "foo": [crate.annotation( 729*d4726bddSHONG Yifan override_targets = {"lib": "@//override_target:foo"}, 730*d4726bddSHONG Yifan )], 731*d4726bddSHONG Yifan }, 732*d4726bddSHONG Yifan cargo_lockfile = "//override_target:Cargo.Bazel.lock", 733*d4726bddSHONG Yifan # `generator` is not necessary in official releases. 734*d4726bddSHONG Yifan # See load satement for `cargo_bazel_bootstrap`. 735*d4726bddSHONG Yifan generator = "@cargo_bazel_bootstrap//:cargo-bazel", 736*d4726bddSHONG Yifan lockfile = "//override_target:cargo-bazel-lock.json", 737*d4726bddSHONG Yifan packages = { 738*d4726bddSHONG Yifan "foo": crate.spec( 739*d4726bddSHONG Yifan version = "0.0.0", 740*d4726bddSHONG Yifan ), 741*d4726bddSHONG Yifan }, 742*d4726bddSHONG Yifan splicing_config = splicing_config( 743*d4726bddSHONG Yifan resolver_version = "2", 744*d4726bddSHONG Yifan ), 745*d4726bddSHONG Yifan) 746*d4726bddSHONG Yifan 747*d4726bddSHONG Yifanload( 748*d4726bddSHONG Yifan "@override_target//:defs.bzl", 749*d4726bddSHONG Yifan override_target_crate_repositories = "crate_repositories", 750*d4726bddSHONG Yifan) 751*d4726bddSHONG Yifan 752*d4726bddSHONG Yifanoverride_target_crate_repositories() 753*d4726bddSHONG Yifan 754*d4726bddSHONG Yifan############################################################################### 755*d4726bddSHONG Yifan 756*d4726bddSHONG Yifan# Used for Bazel CI 757*d4726bddSHONG Yifanhttp_archive( 758*d4726bddSHONG Yifan name = "bazelci_rules", 759*d4726bddSHONG Yifan sha256 = "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e", 760*d4726bddSHONG Yifan strip_prefix = "bazelci_rules-1.0.0", 761*d4726bddSHONG Yifan url = "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz", 762*d4726bddSHONG Yifan) 763*d4726bddSHONG Yifan 764*d4726bddSHONG Yifanload("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig") 765*d4726bddSHONG Yifan 766*d4726bddSHONG Yifan# Creates a default toolchain config for RBE. 767*d4726bddSHONG Yifan# Use this as is if you are using the rbe_ubuntu16_04 container, 768*d4726bddSHONG Yifan# otherwise refer to RBE docs. 769*d4726bddSHONG Yifanrbe_preconfig( 770*d4726bddSHONG Yifan name = "buildkite_config", 771*d4726bddSHONG Yifan toolchain = "ubuntu1804-bazel-java11", 772*d4726bddSHONG Yifan) 773