fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
120f911d
0.7.0
1workspace ( name = "examples" ) 2 3# Users of `rules_rust` will commonly be unable to load it 4# using a `local_repository`. Instead, to setup the rules, 5# please see https://bazelbuild.github.io/rules_rust/#setup 6local_repository ( 7name = "rules_rust" , 8path = ".." , 9) 10 11load ( "@rules_rust//rust:repositories.bzl" , "rules_rust_dependencies" , "rust_register_toolchains" ) 12 13rules_rust_dependencies () 14 15rust_register_toolchains ( 16edition = "2018" , 17include_rustc_srcs = True , 18) 19 20load ( "@rules_rust//bindgen:repositories.bzl" , "rust_bindgen_dependencies" , "rust_bindgen_register_toolchains" ) 21 22rust_bindgen_dependencies () 23 24rust_bindgen_register_toolchains () 25 26load ( "@rules_rust//proto:repositories.bzl" , "rust_proto_repositories" ) 27 28rust_proto_repositories () 29 30load ( "@rules_rust//proto:transitive_repositories.bzl" , "rust_proto_transitive_repositories" ) 31 32rust_proto_transitive_repositories () 33 34load ( "@rules_rust//wasm_bindgen:repositories.bzl" , "rust_wasm_bindgen_dependencies" , "rust_wasm_bindgen_register_toolchains" ) 35 36rust_wasm_bindgen_dependencies () 37 38rust_wasm_bindgen_register_toolchains () 39 40load ( "@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" ) 41 42############################################################################### 43# Workspace examples 44############################################################################### 45 46# buildifier: disable=same-origin-load 47load ( "@rules_rust//rust:repositories.bzl" , "rust_repository_set" ) 48 49# `rust_repository_set` is the core repository rule for downloading and defining 50# a rust_toolchain. Should there be a need for a customized toolchain, this macro can 51# be used to define and register one. 52rust_repository_set ( 53name = "fake_toolchain_for_test_of_sha256" , 54edition = "2018" , 55exec_triple = "x86_64-unknown-linux-gnu" , 56extra_target_triples = [], 57rustfmt_version = "1.4.12" , 58sha256s = { 59"rust-1.46.0-x86_64-unknown-linux-gnu" : "e3b98bc3440fe92817881933f9564389eccb396f5f431f33d48b979fa2fbdcf5" , 60"rust-std-1.46.0-x86_64-unknown-linux-gnu" : "ac04aef80423f612c0079829b504902de27a6997214eb58ab0765d02f7ec1dbc" , 61"rustfmt-1.4.12-x86_64-unknown-linux-gnu" : "1894e76913303d66bf40885a601462844eec15fca9e76a6d13c390d7000d64b0" , 62}, 63version = "1.46.0" , 64) 65 66############################################################################### 67# Examples dependencies 68############################################################################### 69 70http_archive ( 71name = "build_bazel_rules_nodejs" , 72sha256 = "e328cb2c9401be495fa7d79c306f5ee3040e8a03b2ebb79b022e15ca03770096" , 73urls = [ "https://github.com/bazelbuild/rules_nodejs/releases/download/5.4.2/rules_nodejs-5.4.2.tar.gz" ], 74) 75 76load ( "@build_bazel_rules_nodejs//:index.bzl" , "node_repositories" ) 77 78node_repositories () 79 80http_archive ( 81name = "rules_foreign_cc" , 82sha256 = "69023642d5781c68911beda769f91fcbc8ca48711db935a75da7f6536b65047f" , 83strip_prefix = "rules_foreign_cc-0.6.0" , 84url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.6.0.tar.gz" , 85) 86 87load ( "@rules_foreign_cc//foreign_cc:repositories.bzl" , "rules_foreign_cc_dependencies" ) 88 89rules_foreign_cc_dependencies () 90 91load ( "//sys:sys_deps.bzl" , "sys_deps" ) 92 93sys_deps () 94 95local_repository ( 96name = "rules_rust_example_cargo_manifest_dir" , 97path = "cargo_manifest_dir/external_crate" , 98) 99 100_LIBC_BUILD_FILE_CONTENT = """\ 101load("@rules_rust//rust:defs.bzl", "rust_library") 102 103rust_library( 104name = "libc", 105srcs = glob(["src/**/*.rs"]), 106edition = "2015", 107rustc_flags = [ 108# In most cases, warnings in 3rd party crates are not interesting as 109# they're out of the control of consumers. The flag here silences 110# warnings. For more details see: 111# https://doc.rust-lang.org/rustc/lints/levels.html 112"--cap-lints=allow", 113], 114visibility = ["//visibility:public"], 115) 116""" 117 118http_archive ( 119name = "libc" , 120build_file_content = _LIBC_BUILD_FILE_CONTENT , 121sha256 = "1ac4c2ac6ed5a8fb9020c166bc63316205f1dc78d4b964ad31f4f21eb73f0c6d" , 122strip_prefix = "libc-0.2.20" , 123urls = [ 124"https://mirror.bazel.build/github.com/rust-lang/libc/archive/0.2.20.zip" , 125"https://github.com/rust-lang/libc/archive/0.2.20.zip" , 126], 127) 128 129############################################################################### 130 131http_archive ( 132name = "bazel_toolchains" , 133sha256 = "179ec02f809e86abf56356d8898c8bd74069f1bd7c56044050c2cd3d79d0e024" , 134strip_prefix = "bazel-toolchains-4.1.0" , 135urls = [ 136"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz" , 137"https://github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz" , 138], 139) 140 141load ( "@bazel_toolchains//rules:rbe_repo.bzl" , "rbe_autoconfig" ) 142 143# Creates a default toolchain config for RBE. 144# Use this as is if you are using the rbe_ubuntu16_04 container, 145# otherwise refer to RBE docs. 146rbe_autoconfig ( name = "buildkite_config" )