workspace(name = "examples") local_repository( name = "rules_rust", path = "../../", ) load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains") rules_rust_dependencies() rust_register_toolchains( edition = "2018", ) load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies") crate_universe_dependencies(bootstrap = True) load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository", "splicing_config") ############################################################################### # C A R G O A L I A S E S ############################################################################### crates_repository( name = "cargo_aliases", annotations = { "names": [crate.annotation( shallow_since = "1646516410 -0700", version = "0.12.1-dev", )], }, cargo_lockfile = "//cargo_aliases:Cargo.Bazel.lock", # `generator` is not necessary in official releases. # See load satement for `cargo_bazel_bootstrap`. generator = "@cargo_bazel_bootstrap//:cargo-bazel", lockfile = "//cargo_aliases:cargo-bazel-lock.json", manifests = ["//cargo_aliases:Cargo.toml"], ) load( "@cargo_aliases//:defs.bzl", cargo_aliases_crate_repositories = "crate_repositories", ) cargo_aliases_crate_repositories() ############################################################################### # C A R G O L O C A L ############################################################################### crates_repository( name = "crate_index_cargo_local", cargo_lockfile = "//cargo_local:Cargo.lock", # `generator` is not necessary in official releases. # See load satement for `cargo_bazel_bootstrap`. generator = "@cargo_bazel_bootstrap//:cargo-bazel", manifests = ["//cargo_local:Cargo.toml"], ) load( "@crate_index_cargo_local//:defs.bzl", cargo_local_crate_repositories = "crate_repositories", ) cargo_local_crate_repositories() ############################################################################### # C A R G O R E M O T E ############################################################################### load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "names", build_file = "//cargo_remote:BUILD.names.bazel", sha256 = "eab40caca5805624ba31d028913931c3d054b22daafff6f43e3435cfa9fb761e", strip_prefix = "names-0.13.0", urls = ["https://github.com/fnichol/names/archive/refs/tags/v0.13.0.zip"], ) crates_repository( name = "crate_index_cargo_remote", cargo_lockfile = "@names//:Cargo.lock", # `generator` is not necessary in official releases. # See load satement for `cargo_bazel_bootstrap`. generator = "@cargo_bazel_bootstrap//:cargo-bazel", manifests = ["@names//:Cargo.toml"], ) load( "@crate_index_cargo_remote//:defs.bzl", cargo_remote_crate_repositories = "crate_repositories", ) cargo_remote_crate_repositories() ############################################################################### # C A R G O W O R K S P A C E ############################################################################### crates_repository( name = "crate_index_cargo_workspace", cargo_config = "//cargo_workspace:.cargo/config.toml", cargo_lockfile = "//cargo_workspace:Cargo.Bazel.lock", # `generator` is not necessary in official releases. # See load satement for `cargo_bazel_bootstrap`. generator = "@cargo_bazel_bootstrap//:cargo-bazel", lockfile = "//cargo_workspace:cargo-bazel-lock.json", manifests = [ "//cargo_workspace:Cargo.toml", "//cargo_workspace/num_printer:Cargo.toml", "//cargo_workspace/printer:Cargo.toml", "//cargo_workspace/rng:Cargo.toml", ], ) load( "@crate_index_cargo_workspace//:defs.bzl", cargo_workspace_crate_repositories = "crate_repositories", ) cargo_workspace_crate_repositories() ############################################################################### # M U L T I P A C K A G E ############################################################################### crates_repository( # The name here needs to be short to avoid long path issues on windows # when running the `libnghttp2-sys` build script. name = "m_pkgs", annotations = { "curl-sys": [crate.annotation( gen_build_script = False, deps = [ "@curl", "@libssh2", ], )], "lalrpop": [crate.annotation( data_glob = ["**/*.lalrpop"], )], "libnghttp2-sys": [crate.annotation( build_script_data_glob = ["nghttp2/**"], data_glob = ["nghttp2/**"], )], "openssl-sys": [crate.annotation( build_script_data = [ "@openssl//:gen_dir", "@openssl//:openssl", ], build_script_data_glob = ["build/**/*.c"], build_script_env = { "OPENSSL_DIR": "$(execpath @openssl//:gen_dir)", "OPENSSL_STATIC": "1", }, data = ["@openssl"], deps = ["@openssl"], )], "wepoll-ffi": [crate.annotation( build_script_data_glob = ["vendor/**"], )], }, cargo_lockfile = "//multi_package:Cargo.Bazel.lock", # `generator` is not necessary in official releases. # See load satement for `cargo_bazel_bootstrap`. generator = "@cargo_bazel_bootstrap//:cargo-bazel", lockfile = "//multi_package:cargo-bazel-lock.json", manifests = [ "//multi_package/pkg_a:Cargo.toml", "//multi_package/sub_pkgs/pkg_b:Cargo.toml", "//multi_package/sub_pkgs/pkg_c:Cargo.toml", ], ) load( "@m_pkgs//:defs.bzl", multi_pkg_crate_repositories = "crate_repositories", ) multi_pkg_crate_repositories() # ForeignCc is used to build OpenSSL http_archive( name = "rules_foreign_cc", sha256 = "1df78c7d7eed2dc21b8b325a2853c31933a81e7b780f9a59a5d078be9008b13a", strip_prefix = "rules_foreign_cc-0.7.0", url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.7.0.tar.gz", ) load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") rules_foreign_cc_dependencies() # Load OpenSSL and other 3rd party dependencies load("//multi_package/3rdparty:third_party_deps.bzl", "third_party_deps") third_party_deps() # perl is used to build openssl http_archive( name = "rules_perl", sha256 = "0c0cc01b158321c3c84af49409393c14b66070249d0affb78a88ca594b2aa9c2", strip_prefix = "rules_perl-43d2db0aafe595fe0ac61b808c9c13ea9769ce03", urls = [ "https://github.com/bazelbuild/rules_perl/archive/43d2db0aafe595fe0ac61b808c9c13ea9769ce03.tar.gz", ], ) load("@rules_perl//perl:deps.bzl", "perl_register_toolchains", "perl_rules_dependencies") perl_rules_dependencies() perl_register_toolchains() ############################################################################### # N O C A R G O M A N I F E S T S ############################################################################### crates_repository( name = "no_cargo", annotations = { "axum": [crate.annotation( compile_data_glob = ["**/*.md"], )], }, cargo_lockfile = "//no_cargo_manifests:Cargo.Bazel.lock", # `generator` is not necessary in official releases. # See load satement for `cargo_bazel_bootstrap`. generator = "@cargo_bazel_bootstrap//:cargo-bazel", lockfile = "//no_cargo_manifests:cargo-bazel-lock.json", packages = { "axum": crate.spec( version = "0.4.0", ), "hyper": crate.spec( features = ["full"], version = "0.14", ), "mime": crate.spec( version = "0.3", ), "serde_json": crate.spec( version = "1.0", ), "tokio": crate.spec( features = ["full"], version = "1.17.0", ), "tower": crate.spec( features = ["util"], version = "0.4", ), "tower-http": crate.spec( features = ["trace"], version = "0.2.1", ), "tracing": crate.spec( version = "0.1", ), "tracing-subscriber": crate.spec( version = "0.3", ), }, splicing_config = splicing_config( resolver_version = "2", ), ) load( "@no_cargo//:defs.bzl", no_cargo_crate_repositories = "crate_repositories", ) no_cargo_crate_repositories() ############################################################################### # V E N D O R E X T E R N A L ############################################################################### http_archive( name = "names_external", build_file = "//cargo_remote:BUILD.names.bazel", sha256 = "eab40caca5805624ba31d028913931c3d054b22daafff6f43e3435cfa9fb761e", strip_prefix = "names-0.13.0", urls = ["https://github.com/fnichol/names/archive/refs/tags/v0.13.0.zip"], ) load( "//vendor_external/crates:crates.bzl", crates_vendor_external_repositories = "crate_repositories", ) crates_vendor_external_repositories() ############################################################################### # V E N D O R R E M O T E M A N I F E S T S ############################################################################### load( "//vendor_remote_manifests/crates:crates.bzl", crates_vendor_manifests_repositories = "crate_repositories", ) crates_vendor_manifests_repositories() ############################################################################### # V E N D O R R E M O T E P A C K A G E S ############################################################################### load( "//vendor_remote_pkgs/crates:crates.bzl", crates_vendor_packages_repositories = "crate_repositories", ) crates_vendor_packages_repositories() ############################################################################### # Used for Bazel CI http_archive( name = "bazelci_rules", sha256 = "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e", strip_prefix = "bazelci_rules-1.0.0", url = "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz", ) load("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig") # Creates a default toolchain config for RBE. # Use this as is if you are using the rbe_ubuntu16_04 container, # otherwise refer to RBE docs. rbe_preconfig( name = "buildkite_config", toolchain = "ubuntu1804-bazel-java11", )