Add rule for bindgen (#102) (#108)

diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml
index 987d2e4..c7f2b19 100644
--- a/.bazelci/presubmit.yml
+++ b/.bazelci/presubmit.yml
@@ -1,8 +1,11 @@
 ---
 default_targets: &default_targets
+- "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
 - "..."
 - "@docs//..."
 - "@examples//..."
+# Bindgen currently only has a working toolchain for 18.04
+- "-@examples//ffi/rust_calling_c/simple/..."
 platforms:
   ubuntu1404:
     build_targets: *default_targets
@@ -10,6 +13,12 @@
   ubuntu1604:
     build_targets: *default_targets
     test_targets: *default_targets
+  ubuntu1804:
+    build_targets: *default_targets
+    test_targets:
+      - "..."
+      - "@docs//..."
+      - "@examples//..."
   macos:
     osx_targets: &osx_targets
     - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
@@ -19,11 +28,12 @@
     # Skip tests for dylib support on osx, since we don't support it yet.
     - "-@examples//ffi/rust_calling_c:matrix_dylib_test"
     - "-@examples//ffi/rust_calling_c:matrix_dynamically_linked"
+    - "-@examples//ffi/rust_calling_c/simple/..."
     build_targets: *osx_targets
     test_targets: *osx_targets
   rbe_ubuntu1604:
     test_targets:
-    - "--"
+    - "--" # Allows negative patterns; hack for https://github.com/bazelbuild/continuous-integration/pull/245
     - "//test/..."
     - "@examples//..."
     - "-//test/conflicting_deps:conflicting_deps_test"
@@ -32,3 +42,4 @@
     - "-@examples//fibonacci:fibonacci_doc_test"
     - "-@examples//hello_lib:hello_lib_doc_test"
     - "-//tools/runfiles:runfiles_doc_test"
+    - "-@examples//ffi/rust_calling_c/simple/..."
diff --git a/WORKSPACE b/WORKSPACE
index f5b6eee..014a709 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -25,21 +25,22 @@
 )
 
 # TODO: Move this to examples/WORKSPACE when recursive repositories are enabled.
-load("//rust:repositories.bzl", "rust_repositories")
-
+load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")
 rust_repositories()
 
 new_git_repository(
     name = "libc",
-    build_file = "//:libc.BUILD",
+    build_file = "@io_bazel_rules_rust//:libc.BUILD",
     remote = "https://github.com/rust-lang/libc",
     tag = "0.2.20",
 )
 
-load("//proto:repositories.bzl", "rust_proto_repositories")
-
+load("@io_bazel_rules_rust//proto:repositories.bzl", "rust_proto_repositories")
 rust_proto_repositories()
 
+load("@io_bazel_rules_rust//bindgen:repositories.bzl", "rust_bindgen_repositories")
+rust_bindgen_repositories()
+
 # Stardoc and its dependencies
 git_repository(
     name = "io_bazel_skydoc",
@@ -71,6 +72,5 @@
     ],
 )
 
-load(":workspace.bzl", "bazel_version")
-
+load("@io_bazel_rules_rust//:workspace.bzl", "bazel_version")
 bazel_version(name = "bazel_version")
diff --git a/bindgen/BUILD b/bindgen/BUILD
new file mode 100644
index 0000000..c68f15b
--- /dev/null
+++ b/bindgen/BUILD
@@ -0,0 +1,26 @@
+load("@io_bazel_rules_rust//bindgen:bindgen.bzl", "rust_bindgen_toolchain")
+load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
+
+package(default_visibility = ["//visibility:public"])
+
+toolchain_type(name = "bindgen_toolchain")
+
+bzl_library(
+    name = "rules",
+    srcs = glob(["**/*.bzl"]),
+    deps = ["@io_bazel_rules_rust//rust:rules"],
+)
+
+rust_bindgen_toolchain(
+    name = "example-bindgen-toolchain-impl",
+    bindgen = "//bindgen/raze:cargo_bin_bindgen",
+    clang = "@bindgen_clang//:clang",
+    libclang = "@bindgen_clang//:libclang.so",
+    libstdcxx = "@local_libstdcpp//:libstdc++",
+)
+
+toolchain(
+    name = "example-bindgen-toolchain",
+    toolchain = "example-bindgen-toolchain-impl",
+    toolchain_type = "@io_bazel_rules_rust//bindgen:bindgen_toolchain",
+)
diff --git a/bindgen/README.md b/bindgen/README.md
new file mode 100644
index 0000000..79eee77
--- /dev/null
+++ b/bindgen/README.md
@@ -0,0 +1,82 @@
+# Rust Bindgen Rules
+
+<div class="toc">
+  <h2>Rules</h2>
+  <ul>
+    <li><a href="docs/index.md#rust_bindgen_toolchain">rust_bindgen_toolchain</a></li>
+    <li>rust_bindgen</li>
+    <li>rust_bindgen_library</li>
+  </ul>
+</div>
+
+## Overview
+
+These rules are for using [Bindgen][bindgen] to generate [Rust][rust] bindings to C (and some C++) libraries.
+
+[rust]: http://www.rust-lang.org/
+[bindgen]: https://github.com/rust-lang/rust-bindgen
+
+See the [bindgen example](../examples/ffi/rust_calling_c/simple/BUILD#L9) for a more complete example of use.
+
+### Setup
+
+To use the Rust bindgen rules, add the following to your `WORKSPACE` file to add the
+external repositories for the Rust bindgen toolchain (in addition to the [rust rules setup](..)):
+
+```python
+load("@io_bazel_rules_rust//bindgen:repositories.bzl", "rust_bindgen_repositories")
+
+rust_bindgen_repositories()
+```
+This makes the default toolchain defined in [`@io_bazel_rules_rust`](./BUILD) available.
+
+[raze]: https://github.com/google/cargo-raze
+
+It will load crate dependencies of bindgen that are generated using
+[cargo raze][raze] inside the rules_rust
+repository. However, using those dependencies might conflict with other uses
+of [cargo raze][raze]. If you need to change
+those dependencies, please see the [dedicated section below](#custom-deps).
+
+For additional information, see the [Bazel toolchains documentation](https://docs.bazel.build/versions/master/toolchains.html).
+
+## <a name="custom-deps">Customizing dependencies
+
+These rules depends on the [`bindgen`](https://crates.io/crates/bindgen) binary crate, and it 
+in turn depends on both a clang binary and the clang library. To obtain these dependencies,
+`rust_bindgen_repositories` imports bindgen and its dependencies using BUILD files generated with
+[`cargo raze`][raze], along with a tarball of clang.
+
+If you want to change the bindgen used, or use [`cargo raze`][raze] in a more
+complex scenario (with more dependencies), you must redefine those
+dependencies.
+
+To do this, once you've imported the needed dependencies (see our
+[Cargo.toml](./raze/Cargo.toml) file to see the default dependencies), you
+need to create your own toolchain. To do so you can create a BUILD
+file with your [`rust_bindgen_toolchain`](../docs/index.md#rust_bindgen_toolchain) definition, for example:
+
+```python
+load("@io_bazel_rules_rust//bindgen:bindgen.bzl", "rust_bindgen_toolchain")
+
+rust_bindgen_toolchain(
+    name = "bindgen-toolchain-impl",
+    bindgen = "//my/raze:cargo_bin_bindgen",
+    clang = "//my/clang:clang",
+    libclang = "//my/clang:libclang.so",
+    libstdcxx = "//my/cpp:libstdc++",
+)
+
+toolchain(
+    name = "bindgen-toolchain",
+    toolchain = "bindgen-toolchain-impl",
+    toolchain_type = "@io_bazel_rules_rust//bindgen:bindgen_toolchain",
+)
+```
+
+Now that you have your own toolchain, you need to register it by
+inserting the following statement in your `WORKSPACE` file:
+
+```python
+register_toolchains("//my/toolchains:bindgen-toolchain")
+```
diff --git a/bindgen/bindgen.bzl b/bindgen/bindgen.bzl
new file mode 100644
index 0000000..fd267d2
--- /dev/null
+++ b/bindgen/bindgen.bzl
@@ -0,0 +1,182 @@
+# Copyright 2019 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library")
+
+def rust_bindgen_library(
+        name,
+        header,
+        cc_lib,
+        bindgen_flags = None,
+        clang_flags = None,
+        **kwargs):
+    """Generates a rust source file for `header`, and builds a rust_library.
+
+    Arguments are the same as `rust_bindgen`, and `kwargs` are passed directly to rust_library.
+    """
+
+    rust_bindgen(
+        name = name + "__bindgen",
+        header = header,
+        cc_lib = cc_lib,
+        bindgen_flags = bindgen_flags or [],
+        clang_flags = clang_flags or [],
+    )
+    rust_library(
+        name = name,
+        srcs = [name + "__bindgen.rs"],
+        deps = [cc_lib],
+        **kwargs
+    )
+
+def _rust_bindgen_impl(ctx):
+    # nb. We can't grab the cc_library`s direct headers, so a header must be provided.
+    cc_lib = ctx.attr.cc_lib
+    header = ctx.file.header
+    if header not in cc_lib.cc.transitive_headers:
+        fail("Header {} is not in {}'s transitive headers.".format(ctx.attr.header, cc_lib), "header")
+
+    toolchain = ctx.toolchains["@io_bazel_rules_rust//bindgen:bindgen_toolchain"]
+    bindgen_bin = toolchain.bindgen
+    rustfmt_bin = toolchain.rustfmt
+    clang_bin = toolchain.clang
+    libclang = toolchain.libclang
+
+    # TODO: This rule shouldn't need to depend on libstdc++
+    #  This rule requires an explicit dependency on a libstdc++ because
+    #    1. It is a runtime dependency of libclang.so
+    #    2. We cannot locate it in the cc_toolchain yet
+    #  Depending on how libclang.so was compiled, it may try to locate its libstdc++ dependency
+    #  in a way that makes our handling here unnecessary (eg. system /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
+    libstdcxx = toolchain.libstdcxx
+
+    # rustfmt is not where bindgen expects to find it, so we format manually
+    bindgen_args = ["--no-rustfmt-bindings"] + ctx.attr.bindgen_flags
+    clang_args = ctx.attr.clang_flags
+
+    output = ctx.outputs.out
+
+    # libclang should only have 1 output file
+    libclang_dir = libclang.cc.libs.to_list()[0].dirname
+    include_directories = depset(
+        [f.dirname for f in cc_lib.cc.transitive_headers],
+    )
+
+    # Vanilla usage of bindgen produces formatted output, here we do the same if we have `rustfmt` in our toolchain.
+    if rustfmt_bin:
+        unformatted_output = ctx.actions.declare_file(output.basename + ".unformatted")
+    else:
+        unformatted_output = output
+
+    args = ctx.actions.args()
+    args.add_all(bindgen_args)
+    args.add(header.path)
+    args.add("--output", unformatted_output.path)
+    args.add("--")
+    args.add_all(include_directories, before_each = "-I")
+    args.add_all(clang_args)
+    ctx.actions.run(
+        executable = bindgen_bin,
+        inputs = depset(
+            [header],
+            transitive = [cc_lib.cc.transitive_headers, libclang.cc.libs, libstdcxx.cc.libs],
+        ),
+        outputs = [unformatted_output],
+        mnemonic = "RustBindgen",
+        progress_message = "Generating bindings for {}..".format(header.path),
+        env = {
+            "RUST_BACKTRACE": "1",
+            "CLANG_PATH": clang_bin.path,
+            # Bindgen loads libclang at runtime, which also needs libstdc++, so we setup LD_LIBRARY_PATH
+            "LIBCLANG_PATH": libclang_dir,
+            "LD_LIBRARY_PATH": ":".join([f.dirname for f in libstdcxx.cc.libs]),
+        },
+        arguments = [args],
+        tools = [clang_bin],
+    )
+
+    if rustfmt_bin:
+        ctx.actions.run_shell(
+            inputs = depset([rustfmt_bin, unformatted_output]),
+            outputs = [output],
+            command = "{} --emit stdout --quiet {} > {}".format(rustfmt_bin.path, unformatted_output.path, output.path),
+            tools = [rustfmt_bin],
+        )
+
+rust_bindgen = rule(
+    _rust_bindgen_impl,
+    doc = "Generates a rust source file from a cc_library and a header.",
+    attrs = {
+        "header": attr.label(
+            doc = "The .h file to generate bindings for.",
+            allow_single_file = True,
+        ),
+        "cc_lib": attr.label(
+            doc = "The cc_library that contains the .h file. This is used to find the transitive includes.",
+            providers = ["cc"],
+        ),
+        "bindgen_flags": attr.string_list(
+            doc = "Flags to pass directly to the bindgen executable. See https://rust-lang.github.io/rust-bindgen/ for details.",
+        ),
+        "clang_flags": attr.string_list(
+            doc = "Flags to pass directly to the clang executable.",
+        ),
+    },
+    outputs = {"out": "%{name}.rs"},
+    toolchains = [
+        "@io_bazel_rules_rust//bindgen:bindgen_toolchain",
+    ],
+)
+
+def _rust_bindgen_toolchain_impl(ctx):
+    return platform_common.ToolchainInfo(
+        bindgen = ctx.executable.bindgen,
+        clang = ctx.executable.clang,
+        libclang = ctx.attr.libclang,
+        libstdcxx = ctx.attr.libstdcxx,
+        rustfmt = ctx.executable.rustfmt,
+    )
+
+rust_bindgen_toolchain = rule(
+    _rust_bindgen_toolchain_impl,
+    doc = "The tools required for the `rust_bindgen` rule.",
+    attrs = {
+        "bindgen": attr.label(
+            doc = "The label of a `bindgen` executable.",
+            executable = True,
+            cfg = "host",
+        ),
+        "rustfmt": attr.label(
+            doc = "The label of a `rustfmt` executable. If this is provided, generated sources will be formatted.",
+            executable = True,
+            cfg = "host",
+            mandatory = False,
+        ),
+        "clang": attr.label(
+            doc = "The label of a `clang` executable.",
+            executable = True,
+            cfg = "host",
+        ),
+        "libclang": attr.label(
+            doc = "A cc_library that provides bindgen's runtime dependency on libclang.",
+            cfg = "host",
+            providers = ["cc"],
+        ),
+        "libstdcxx": attr.label(
+            doc = "A cc_library that satisfies libclang's libstdc++ dependency.",
+            cfg = "host",
+            providers = ["cc"],
+        ),
+    },
+)
diff --git a/bindgen/clang.BUILD b/bindgen/clang.BUILD
new file mode 100644
index 0000000..46e4eeb
--- /dev/null
+++ b/bindgen/clang.BUILD
@@ -0,0 +1,14 @@
+package(default_visibility = ["//visibility:public"])
+
+sh_binary(
+    name = "clang",
+    srcs = ["bin/clang"],
+    data = glob(["lib/**"]),
+)
+
+cc_library(
+    name = "libclang.so",
+    srcs = [
+        "lib/libclang.so",
+    ],
+)
diff --git a/bindgen/raze/BUILD b/bindgen/raze/BUILD
new file mode 100644
index 0000000..29312ca
--- /dev/null
+++ b/bindgen/raze/BUILD
@@ -0,0 +1,20 @@
+"""
+cargo-raze workspace build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = ["//visibility:public"])
+
+licenses([
+  "notice" # See individual crates for specific licenses
+])
+alias(
+    name = "bindgen",
+    actual = "@raze__bindgen__0_40_0//:bindgen",
+)
+alias(
+    # Extra aliased target, from raze configuration
+    # N.B.: The exact form of this is subject to change.
+    name = "cargo_bin_bindgen",
+    actual = "@raze__bindgen__0_40_0//:cargo_bin_bindgen",
+)
diff --git a/bindgen/raze/Cargo.toml b/bindgen/raze/Cargo.toml
new file mode 100644
index 0000000..cbf38a6
--- /dev/null
+++ b/bindgen/raze/Cargo.toml
@@ -0,0 +1,23 @@
+[raze]
+genmode = "Remote"
+workspace_path = "//bindgen/raze"
+
+[dependencies]
+# TODO: Using "0.47.0" requires yet more overrides for building clang-sys '0.27.0'.
+bindgen = "0.40.0"
+
+[raze.crates.bindgen.'0.40.0']
+gen_buildrs = true
+extra_aliased_targets = ["cargo_bin_bindgen"]
+
+# TODO: Un-patch crates.bzl
+#       See https://github.com/google/cargo-raze/issues/58
+# [raze.crates.libloading.'0.5.0']
+# custom_build_file_path = "//bindgen/raze:libloading.BUILD"
+
+[package]
+name = "fake_lib"
+version = "0.0.1"
+
+[lib]
+path = "fake_lib.rs"
diff --git a/bindgen/raze/crates.bzl b/bindgen/raze/crates.bzl
new file mode 100644
index 0000000..4e0de7b
--- /dev/null
+++ b/bindgen/raze/crates.bzl
@@ -0,0 +1,414 @@
+"""
+cargo-raze crate workspace functions
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
+
+def _new_http_archive(name, **kwargs):
+    if not native.existing_rule(name):
+        http_archive(name=name, **kwargs)
+
+def _new_git_repository(name, **kwargs):
+    if not native.existing_rule(name):
+        new_git_repository(name=name, **kwargs)
+
+def raze_fetch_remote_crates():
+
+    _new_http_archive(
+        name = "raze__aho_corasick__0_6_9",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/aho-corasick/aho-corasick-0.6.9.crate",
+        type = "tar.gz",
+        sha256 = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e",
+        strip_prefix = "aho-corasick-0.6.9",
+        build_file = Label("//bindgen/raze/remote:aho-corasick-0.6.9.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__ansi_term__0_11_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/ansi_term/ansi_term-0.11.0.crate",
+        type = "tar.gz",
+        sha256 = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b",
+        strip_prefix = "ansi_term-0.11.0",
+        build_file = Label("//bindgen/raze/remote:ansi_term-0.11.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__atty__0_2_11",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/atty/atty-0.2.11.crate",
+        type = "tar.gz",
+        sha256 = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652",
+        strip_prefix = "atty-0.2.11",
+        build_file = Label("//bindgen/raze/remote:atty-0.2.11.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__bindgen__0_40_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/bindgen/bindgen-0.40.0.crate",
+        type = "tar.gz",
+        sha256 = "8f4c4ffe91e0f26bdcc5a8dd58cbf0358ad772b8ec1ae274a11a0ba54ec175f4",
+        strip_prefix = "bindgen-0.40.0",
+        build_file = Label("//bindgen/raze/remote:bindgen-0.40.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__bitflags__1_0_4",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/bitflags/bitflags-1.0.4.crate",
+        type = "tar.gz",
+        sha256 = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12",
+        strip_prefix = "bitflags-1.0.4",
+        build_file = Label("//bindgen/raze/remote:bitflags-1.0.4.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__cc__1_0_28",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/cc/cc-1.0.28.crate",
+        type = "tar.gz",
+        sha256 = "bb4a8b715cb4597106ea87c7c84b2f1d452c7492033765df7f32651e66fcf749",
+        strip_prefix = "cc-1.0.28",
+        build_file = Label("//bindgen/raze/remote:cc-1.0.28.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__cexpr__0_2_3",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/cexpr/cexpr-0.2.3.crate",
+        type = "tar.gz",
+        sha256 = "42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c",
+        strip_prefix = "cexpr-0.2.3",
+        build_file = Label("//bindgen/raze/remote:cexpr-0.2.3.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__cfg_if__0_1_6",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/cfg-if/cfg-if-0.1.6.crate",
+        type = "tar.gz",
+        sha256 = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4",
+        strip_prefix = "cfg-if-0.1.6",
+        build_file = Label("//bindgen/raze/remote:cfg-if-0.1.6.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__clang_sys__0_23_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/clang-sys/clang-sys-0.23.0.crate",
+        type = "tar.gz",
+        sha256 = "d7f7c04e52c35222fffcc3a115b5daf5f7e2bfb71c13c4e2321afe1fc71859c2",
+        strip_prefix = "clang-sys-0.23.0",
+        build_file = Label("//bindgen/raze/remote:clang-sys-0.23.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__clap__2_32_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/clap/clap-2.32.0.crate",
+        type = "tar.gz",
+        sha256 = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e",
+        strip_prefix = "clap-2.32.0",
+        build_file = Label("//bindgen/raze/remote:clap-2.32.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__env_logger__0_5_13",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/env_logger/env_logger-0.5.13.crate",
+        type = "tar.gz",
+        sha256 = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38",
+        strip_prefix = "env_logger-0.5.13",
+        build_file = Label("//bindgen/raze/remote:env_logger-0.5.13.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__glob__0_2_11",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/glob/glob-0.2.11.crate",
+        type = "tar.gz",
+        sha256 = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb",
+        strip_prefix = "glob-0.2.11",
+        build_file = Label("//bindgen/raze/remote:glob-0.2.11.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__humantime__1_2_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/humantime/humantime-1.2.0.crate",
+        type = "tar.gz",
+        sha256 = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114",
+        strip_prefix = "humantime-1.2.0",
+        build_file = Label("//bindgen/raze/remote:humantime-1.2.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__lazy_static__1_2_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/lazy_static/lazy_static-1.2.0.crate",
+        type = "tar.gz",
+        sha256 = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1",
+        strip_prefix = "lazy_static-1.2.0",
+        build_file = Label("//bindgen/raze/remote:lazy_static-1.2.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__libc__0_2_48",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/libc/libc-0.2.48.crate",
+        type = "tar.gz",
+        sha256 = "e962c7641008ac010fa60a7dfdc1712449f29c44ef2d4702394aea943ee75047",
+        strip_prefix = "libc-0.2.48",
+        build_file = Label("//bindgen/raze/remote:libc-0.2.48.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__libloading__0_5_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/libloading/libloading-0.5.0.crate",
+        type = "tar.gz",
+        sha256 = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2",
+        strip_prefix = "libloading-0.5.0",
+        build_file = Label("//bindgen/raze/remote:libloading-0.5.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__log__0_4_6",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/log/log-0.4.6.crate",
+        type = "tar.gz",
+        sha256 = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6",
+        strip_prefix = "log-0.4.6",
+        build_file = Label("//bindgen/raze/remote:log-0.4.6.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__memchr__1_0_2",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/memchr/memchr-1.0.2.crate",
+        type = "tar.gz",
+        sha256 = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a",
+        strip_prefix = "memchr-1.0.2",
+        build_file = Label("//bindgen/raze/remote:memchr-1.0.2.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__memchr__2_1_3",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/memchr/memchr-2.1.3.crate",
+        type = "tar.gz",
+        sha256 = "e1dd4eaac298c32ce07eb6ed9242eda7d82955b9170b7d6db59b2e02cc63fcb8",
+        strip_prefix = "memchr-2.1.3",
+        build_file = Label("//bindgen/raze/remote:memchr-2.1.3.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__nom__3_2_1",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/nom/nom-3.2.1.crate",
+        type = "tar.gz",
+        sha256 = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b",
+        strip_prefix = "nom-3.2.1",
+        build_file = Label("//bindgen/raze/remote:nom-3.2.1.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__peeking_take_while__0_1_2",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/peeking_take_while/peeking_take_while-0.1.2.crate",
+        type = "tar.gz",
+        sha256 = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099",
+        strip_prefix = "peeking_take_while-0.1.2",
+        build_file = Label("//bindgen/raze/remote:peeking_take_while-0.1.2.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__proc_macro2__0_3_5",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/proc-macro2/proc-macro2-0.3.5.crate",
+        type = "tar.gz",
+        sha256 = "77997c53ae6edd6d187fec07ec41b207063b5ee6f33680e9fa86d405cdd313d4",
+        strip_prefix = "proc-macro2-0.3.5",
+        build_file = Label("//bindgen/raze/remote:proc-macro2-0.3.5.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__quick_error__1_2_2",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/quick-error/quick-error-1.2.2.crate",
+        type = "tar.gz",
+        sha256 = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0",
+        strip_prefix = "quick-error-1.2.2",
+        build_file = Label("//bindgen/raze/remote:quick-error-1.2.2.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__quote__0_5_2",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/quote/quote-0.5.2.crate",
+        type = "tar.gz",
+        sha256 = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8",
+        strip_prefix = "quote-0.5.2",
+        build_file = Label("//bindgen/raze/remote:quote-0.5.2.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__redox_syscall__0_1_51",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/redox_syscall/redox_syscall-0.1.51.crate",
+        type = "tar.gz",
+        sha256 = "423e376fffca3dfa06c9e9790a9ccd282fafb3cc6e6397d01dbf64f9bacc6b85",
+        strip_prefix = "redox_syscall-0.1.51",
+        build_file = Label("//bindgen/raze/remote:redox_syscall-0.1.51.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__redox_termios__0_1_1",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/redox_termios/redox_termios-0.1.1.crate",
+        type = "tar.gz",
+        sha256 = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76",
+        strip_prefix = "redox_termios-0.1.1",
+        build_file = Label("//bindgen/raze/remote:redox_termios-0.1.1.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__regex__1_1_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/regex/regex-1.1.0.crate",
+        type = "tar.gz",
+        sha256 = "37e7cbbd370869ce2e8dff25c7018702d10b21a20ef7135316f8daecd6c25b7f",
+        strip_prefix = "regex-1.1.0",
+        build_file = Label("//bindgen/raze/remote:regex-1.1.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__regex_syntax__0_6_5",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/regex-syntax/regex-syntax-0.6.5.crate",
+        type = "tar.gz",
+        sha256 = "8c2f35eedad5295fdf00a63d7d4b238135723f92b434ec06774dad15c7ab0861",
+        strip_prefix = "regex-syntax-0.6.5",
+        build_file = Label("//bindgen/raze/remote:regex-syntax-0.6.5.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__strsim__0_7_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/strsim/strsim-0.7.0.crate",
+        type = "tar.gz",
+        sha256 = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550",
+        strip_prefix = "strsim-0.7.0",
+        build_file = Label("//bindgen/raze/remote:strsim-0.7.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__termcolor__1_0_4",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/termcolor/termcolor-1.0.4.crate",
+        type = "tar.gz",
+        sha256 = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f",
+        strip_prefix = "termcolor-1.0.4",
+        build_file = Label("//bindgen/raze/remote:termcolor-1.0.4.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__termion__1_5_1",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/termion/termion-1.5.1.crate",
+        type = "tar.gz",
+        sha256 = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096",
+        strip_prefix = "termion-1.5.1",
+        build_file = Label("//bindgen/raze/remote:termion-1.5.1.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__textwrap__0_10_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/textwrap/textwrap-0.10.0.crate",
+        type = "tar.gz",
+        sha256 = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6",
+        strip_prefix = "textwrap-0.10.0",
+        build_file = Label("//bindgen/raze/remote:textwrap-0.10.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__thread_local__0_3_6",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/thread_local/thread_local-0.3.6.crate",
+        type = "tar.gz",
+        sha256 = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b",
+        strip_prefix = "thread_local-0.3.6",
+        build_file = Label("//bindgen/raze/remote:thread_local-0.3.6.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__ucd_util__0_1_3",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/ucd-util/ucd-util-0.1.3.crate",
+        type = "tar.gz",
+        sha256 = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86",
+        strip_prefix = "ucd-util-0.1.3",
+        build_file = Label("//bindgen/raze/remote:ucd-util-0.1.3.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__unicode_width__0_1_5",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/unicode-width/unicode-width-0.1.5.crate",
+        type = "tar.gz",
+        sha256 = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526",
+        strip_prefix = "unicode-width-0.1.5",
+        build_file = Label("//bindgen/raze/remote:unicode-width-0.1.5.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__unicode_xid__0_1_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/unicode-xid/unicode-xid-0.1.0.crate",
+        type = "tar.gz",
+        sha256 = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc",
+        strip_prefix = "unicode-xid-0.1.0",
+        build_file = Label("//bindgen/raze/remote:unicode-xid-0.1.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__utf8_ranges__1_0_2",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/utf8-ranges/utf8-ranges-1.0.2.crate",
+        type = "tar.gz",
+        sha256 = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737",
+        strip_prefix = "utf8-ranges-1.0.2",
+        build_file = Label("//bindgen/raze/remote:utf8-ranges-1.0.2.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__vec_map__0_8_1",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/vec_map/vec_map-0.8.1.crate",
+        type = "tar.gz",
+        sha256 = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a",
+        strip_prefix = "vec_map-0.8.1",
+        build_file = Label("//bindgen/raze/remote:vec_map-0.8.1.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__which__1_0_5",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/which/which-1.0.5.crate",
+        type = "tar.gz",
+        sha256 = "e84a603e7e0b1ce1aa1ee2b109c7be00155ce52df5081590d1ffb93f4f515cb2",
+        strip_prefix = "which-1.0.5",
+        build_file = Label("//bindgen/raze/remote:which-1.0.5.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__winapi__0_3_6",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/winapi/winapi-0.3.6.crate",
+        type = "tar.gz",
+        sha256 = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0",
+        strip_prefix = "winapi-0.3.6",
+        build_file = Label("//bindgen/raze/remote:winapi-0.3.6.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__winapi_i686_pc_windows_gnu__0_4_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/winapi-i686-pc-windows-gnu/winapi-i686-pc-windows-gnu-0.4.0.crate",
+        type = "tar.gz",
+        sha256 = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6",
+        strip_prefix = "winapi-i686-pc-windows-gnu-0.4.0",
+        build_file = Label("//bindgen/raze/remote:winapi-i686-pc-windows-gnu-0.4.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__winapi_util__0_1_1",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/winapi-util/winapi-util-0.1.1.crate",
+        type = "tar.gz",
+        sha256 = "afc5508759c5bf4285e61feb862b6083c8480aec864fa17a81fdec6f69b461ab",
+        strip_prefix = "winapi-util-0.1.1",
+        build_file = Label("//bindgen/raze/remote:winapi-util-0.1.1.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__winapi_x86_64_pc_windows_gnu__0_4_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/winapi-x86_64-pc-windows-gnu/winapi-x86_64-pc-windows-gnu-0.4.0.crate",
+        type = "tar.gz",
+        sha256 = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f",
+        strip_prefix = "winapi-x86_64-pc-windows-gnu-0.4.0",
+        build_file = Label("//bindgen/raze/remote:winapi-x86_64-pc-windows-gnu-0.4.0.BUILD")
+    )
+
+    _new_http_archive(
+        name = "raze__wincolor__1_0_1",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/wincolor/wincolor-1.0.1.crate",
+        type = "tar.gz",
+        sha256 = "561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba",
+        strip_prefix = "wincolor-1.0.1",
+        build_file = Label("//bindgen/raze/remote:wincolor-1.0.1.BUILD")
+    )
+
diff --git a/bindgen/raze/libloading.BUILD b/bindgen/raze/libloading.BUILD
new file mode 100644
index 0000000..7c02e57
--- /dev/null
+++ b/bindgen/raze/libloading.BUILD
@@ -0,0 +1,34 @@
+"""
+OVERRIDDEN:
+cargo-raze crate build file.
+
+- Libloading has a CC dep that needs to be built.
+"""
+
+licenses([
+    "notice",  # "ISC"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_benchmark",
+    "rust_binary",
+    "rust_library",
+    "rust_test",
+)
+
+cc_library(
+    name = "global_static",
+    srcs = ["src/os/unix/global_static.c"],
+    copts = ["-fPIC"],
+)
+
+rust_library(
+    name = "libloading",
+    srcs = glob(["**/*.rs"]),
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    rustc_flags = ["--cap-lints=allow"],
+    deps = [":global_static"],
+    visibility = ["//visibility:public"],
+)
diff --git a/bindgen/raze/remote/BUILD b/bindgen/raze/remote/BUILD
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bindgen/raze/remote/BUILD
diff --git a/bindgen/raze/remote/aho-corasick-0.6.9.BUILD b/bindgen/raze/remote/aho-corasick-0.6.9.BUILD
new file mode 100644
index 0000000..482324e
--- /dev/null
+++ b/bindgen/raze/remote/aho-corasick-0.6.9.BUILD
@@ -0,0 +1,66 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+  "unencumbered", # "Unlicense"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+rust_binary(
+    # Prefix bin name to disambiguate from (probable) collision with lib name
+    # N.B.: The exact form of this is subject to change.
+    name = "cargo_bin_aho_corasick_dot",
+    crate_root = "src/main.rs",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        # Binaries get an implicit dependency on their lib
+        ":aho_corasick",
+        "@raze__memchr__2_1_3//:memchr",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.6.9",
+    crate_features = [
+    ],
+)
+
+
+rust_library(
+    name = "aho_corasick",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__memchr__2_1_3//:memchr",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.6.9",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "bench" with type "bench" omitted
+# Unsupported target "dict-search" with type "example" omitted
diff --git a/bindgen/raze/remote/ansi_term-0.11.0.BUILD b/bindgen/raze/remote/ansi_term-0.11.0.BUILD
new file mode 100644
index 0000000..8aadd76
--- /dev/null
+++ b/bindgen/raze/remote/ansi_term-0.11.0.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "ansi_term",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.11.0",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "colours" with type "example" omitted
diff --git a/bindgen/raze/remote/atty-0.2.11.BUILD b/bindgen/raze/remote/atty-0.2.11.BUILD
new file mode 100644
index 0000000..2c2fb11
--- /dev/null
+++ b/bindgen/raze/remote/atty-0.2.11.BUILD
@@ -0,0 +1,44 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "atty" with type "example" omitted
+
+rust_library(
+    name = "atty",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__libc__0_2_48//:libc",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.2.11",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/bindgen-0.40.0.BUILD b/bindgen/raze/remote/bindgen-0.40.0.BUILD
new file mode 100644
index 0000000..2272804
--- /dev/null
+++ b/bindgen/raze/remote/bindgen-0.40.0.BUILD
@@ -0,0 +1,141 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "BSD-3-Clause"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+rust_binary(
+    name = "bindgen_build_script",
+    srcs = glob(["**/*.rs"]),
+    crate_root = "build.rs",
+    edition = "2015",
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    crate_features = [
+      "default",
+      "env_logger",
+      "log",
+      "logging",
+    ],
+    data = glob(["*"]),
+    version = "0.40.0",
+    visibility = ["//visibility:private"],
+)
+
+genrule(
+    name = "bindgen_build_script_executor",
+    srcs = glob(["*", "**/*.rs"]),
+    outs = ["bindgen_out_dir_outputs.tar.gz"],
+    tools = [
+      ":bindgen_build_script",
+    ],
+    local = 1,
+    cmd = "mkdir -p bindgen_out_dir_outputs/;"
+        + " (export CARGO_MANIFEST_DIR=\"$$PWD/$$(dirname $(location :Cargo.toml))\";"
+        # TODO(acmcarther): This needs to be revisited as part of the cross compilation story.
+        #                   See also: https://github.com/google/cargo-raze/pull/54
+        + " export TARGET='x86_64-unknown-linux-gnu';"
+        + " export RUST_BACKTRACE=1;"
+        + " export CARGO_FEATURE_DEFAULT=1;"
+        + " export CARGO_FEATURE_ENV_LOGGER=1;"
+        + " export CARGO_FEATURE_LOG=1;"
+        + " export CARGO_FEATURE_LOGGING=1;"
+        + " export OUT_DIR=$$PWD/bindgen_out_dir_outputs;"
+        + " export BINARY_PATH=\"$$PWD/$(location :bindgen_build_script)\";"
+        + " export OUT_TAR=$$PWD/$@;"
+        + " cd $$(dirname $(location :Cargo.toml)) && $$BINARY_PATH && tar -czf $$OUT_TAR -C $$OUT_DIR .)"
+)
+
+rust_binary(
+    # Prefix bin name to disambiguate from (probable) collision with lib name
+    # N.B.: The exact form of this is subject to change.
+    name = "cargo_bin_bindgen",
+    crate_root = "src/main.rs",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        # Binaries get an implicit dependency on their lib
+        ":bindgen",
+        "@raze__bitflags__1_0_4//:bitflags",
+        "@raze__cexpr__0_2_3//:cexpr",
+        "@raze__cfg_if__0_1_6//:cfg_if",
+        "@raze__clang_sys__0_23_0//:clang_sys",
+        "@raze__clap__2_32_0//:clap",
+        "@raze__env_logger__0_5_13//:env_logger",
+        "@raze__lazy_static__1_2_0//:lazy_static",
+        "@raze__log__0_4_6//:log",
+        "@raze__peeking_take_while__0_1_2//:peeking_take_while",
+        "@raze__proc_macro2__0_3_5//:proc_macro2",
+        "@raze__quote__0_5_2//:quote",
+        "@raze__regex__1_1_0//:regex",
+        "@raze__which__1_0_5//:which",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    out_dir_tar = ":bindgen_build_script_executor",
+    version = "0.40.0",
+    crate_features = [
+        "default",
+        "env_logger",
+        "log",
+        "logging",
+    ],
+)
+
+
+rust_library(
+    name = "bindgen",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__bitflags__1_0_4//:bitflags",
+        "@raze__cexpr__0_2_3//:cexpr",
+        "@raze__cfg_if__0_1_6//:cfg_if",
+        "@raze__clang_sys__0_23_0//:clang_sys",
+        "@raze__clap__2_32_0//:clap",
+        "@raze__env_logger__0_5_13//:env_logger",
+        "@raze__lazy_static__1_2_0//:lazy_static",
+        "@raze__log__0_4_6//:log",
+        "@raze__peeking_take_while__0_1_2//:peeking_take_while",
+        "@raze__proc_macro2__0_3_5//:proc_macro2",
+        "@raze__quote__0_5_2//:quote",
+        "@raze__regex__1_1_0//:regex",
+        "@raze__which__1_0_5//:which",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    out_dir_tar = ":bindgen_build_script_executor",
+    version = "0.40.0",
+    crate_features = [
+        "default",
+        "env_logger",
+        "log",
+        "logging",
+    ],
+)
+
diff --git a/bindgen/raze/remote/bitflags-1.0.4.BUILD b/bindgen/raze/remote/bitflags-1.0.4.BUILD
new file mode 100644
index 0000000..66fb925
--- /dev/null
+++ b/bindgen/raze/remote/bitflags-1.0.4.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "bitflags",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.0.4",
+    crate_features = [
+        "default",
+    ],
+)
+
diff --git a/bindgen/raze/remote/cc-1.0.28.BUILD b/bindgen/raze/remote/cc-1.0.28.BUILD
new file mode 100644
index 0000000..7e13706
--- /dev/null
+++ b/bindgen/raze/remote/cc-1.0.28.BUILD
@@ -0,0 +1,63 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "cc",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.0.28",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "cc_env" with type "test" omitted
+rust_binary(
+    # Prefix bin name to disambiguate from (probable) collision with lib name
+    # N.B.: The exact form of this is subject to change.
+    name = "cargo_bin_gcc_shim",
+    crate_root = "src/bin/gcc-shim.rs",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        # Binaries get an implicit dependency on their lib
+        ":cc",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.0.28",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "test" with type "test" omitted
diff --git a/bindgen/raze/remote/cexpr-0.2.3.BUILD b/bindgen/raze/remote/cexpr-0.2.3.BUILD
new file mode 100644
index 0000000..2d402c2
--- /dev/null
+++ b/bindgen/raze/remote/cexpr-0.2.3.BUILD
@@ -0,0 +1,44 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "Apache-2.0,MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "cexpr",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__nom__3_2_1//:nom",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.2.3",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "clang" with type "test" omitted
diff --git a/bindgen/raze/remote/cfg-if-0.1.6.BUILD b/bindgen/raze/remote/cfg-if-0.1.6.BUILD
new file mode 100644
index 0000000..8d7e20a
--- /dev/null
+++ b/bindgen/raze/remote/cfg-if-0.1.6.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "cfg_if",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.1.6",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "xcrate" with type "test" omitted
diff --git a/bindgen/raze/remote/clang-sys-0.23.0.BUILD b/bindgen/raze/remote/clang-sys-0.23.0.BUILD
new file mode 100644
index 0000000..01ca16c
--- /dev/null
+++ b/bindgen/raze/remote/clang-sys-0.23.0.BUILD
@@ -0,0 +1,57 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "build-script-build" with type "custom-build" omitted
+
+rust_library(
+    name = "clang_sys",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__glob__0_2_11//:glob",
+        "@raze__libc__0_2_48//:libc",
+        "@raze__libloading__0_5_0//:libloading",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.23.0",
+    crate_features = [
+        "clang_6_0",
+        "gte_clang_3_6",
+        "gte_clang_3_7",
+        "gte_clang_3_8",
+        "gte_clang_3_9",
+        "gte_clang_4_0",
+        "gte_clang_5_0",
+        "gte_clang_6_0",
+        "libloading",
+        "runtime",
+    ],
+)
+
+# Unsupported target "lib" with type "test" omitted
diff --git a/bindgen/raze/remote/clap-2.32.0.BUILD b/bindgen/raze/remote/clap-2.32.0.BUILD
new file mode 100644
index 0000000..5585d78
--- /dev/null
+++ b/bindgen/raze/remote/clap-2.32.0.BUILD
@@ -0,0 +1,56 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "clap",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__ansi_term__0_11_0//:ansi_term",
+        "@raze__atty__0_2_11//:atty",
+        "@raze__bitflags__1_0_4//:bitflags",
+        "@raze__strsim__0_7_0//:strsim",
+        "@raze__textwrap__0_10_0//:textwrap",
+        "@raze__unicode_width__0_1_5//:unicode_width",
+        "@raze__vec_map__0_8_1//:vec_map",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "2.32.0",
+    crate_features = [
+        "ansi_term",
+        "atty",
+        "color",
+        "default",
+        "strsim",
+        "suggestions",
+        "vec_map",
+    ],
+)
+
diff --git a/bindgen/raze/remote/env_logger-0.5.13.BUILD b/bindgen/raze/remote/env_logger-0.5.13.BUILD
new file mode 100644
index 0000000..253e243
--- /dev/null
+++ b/bindgen/raze/remote/env_logger-0.5.13.BUILD
@@ -0,0 +1,56 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "custom_default_format" with type "example" omitted
+# Unsupported target "custom_format" with type "example" omitted
+# Unsupported target "custom_logger" with type "example" omitted
+# Unsupported target "default" with type "example" omitted
+# Unsupported target "direct_logger" with type "example" omitted
+
+rust_library(
+    name = "env_logger",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__atty__0_2_11//:atty",
+        "@raze__humantime__1_2_0//:humantime",
+        "@raze__log__0_4_6//:log",
+        "@raze__regex__1_1_0//:regex",
+        "@raze__termcolor__1_0_4//:termcolor",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.5.13",
+    crate_features = [
+        "default",
+        "regex",
+    ],
+)
+
+# Unsupported target "log-in-log" with type "test" omitted
+# Unsupported target "regexp_filter" with type "test" omitted
diff --git a/bindgen/raze/remote/glob-0.2.11.BUILD b/bindgen/raze/remote/glob-0.2.11.BUILD
new file mode 100644
index 0000000..e1980c3
--- /dev/null
+++ b/bindgen/raze/remote/glob-0.2.11.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "glob",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.2.11",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "glob-std" with type "test" omitted
diff --git a/bindgen/raze/remote/humantime-1.2.0.BUILD b/bindgen/raze/remote/humantime-1.2.0.BUILD
new file mode 100644
index 0000000..c00bdeb
--- /dev/null
+++ b/bindgen/raze/remote/humantime-1.2.0.BUILD
@@ -0,0 +1,45 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "datetime_format" with type "bench" omitted
+# Unsupported target "datetime_parse" with type "bench" omitted
+
+rust_library(
+    name = "humantime",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__quick_error__1_2_2//:quick_error",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.2.0",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/lazy_static-1.2.0.BUILD b/bindgen/raze/remote/lazy_static-1.2.0.BUILD
new file mode 100644
index 0000000..2bfb3e0
--- /dev/null
+++ b/bindgen/raze/remote/lazy_static-1.2.0.BUILD
@@ -0,0 +1,44 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "lazy_static",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.2.0",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "no_std" with type "test" omitted
+# Unsupported target "test" with type "test" omitted
diff --git a/bindgen/raze/remote/libc-0.2.48.BUILD b/bindgen/raze/remote/libc-0.2.48.BUILD
new file mode 100644
index 0000000..31bd9e8
--- /dev/null
+++ b/bindgen/raze/remote/libc-0.2.48.BUILD
@@ -0,0 +1,45 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "restricted", # "MIT OR Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "build-script-build" with type "custom-build" omitted
+
+rust_library(
+    name = "libc",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.2.48",
+    crate_features = [
+        "default",
+        "use_std",
+    ],
+)
+
diff --git a/bindgen/raze/remote/libloading-0.5.0.BUILD b/bindgen/raze/remote/libloading-0.5.0.BUILD
new file mode 100644
index 0000000..ee505fe
--- /dev/null
+++ b/bindgen/raze/remote/libloading-0.5.0.BUILD
@@ -0,0 +1,46 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "ISC"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "build-script-build" with type "custom-build" omitted
+# Unsupported target "functions" with type "test" omitted
+
+rust_library(
+    name = "libloading",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.5.0",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "markers" with type "test" omitted
+# Unsupported target "windows" with type "test" omitted
diff --git a/bindgen/raze/remote/log-0.4.6.BUILD b/bindgen/raze/remote/log-0.4.6.BUILD
new file mode 100644
index 0000000..4673fea
--- /dev/null
+++ b/bindgen/raze/remote/log-0.4.6.BUILD
@@ -0,0 +1,45 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "filters" with type "test" omitted
+
+rust_library(
+    name = "log",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__cfg_if__0_1_6//:cfg_if",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.4.6",
+    crate_features = [
+        "std",
+    ],
+)
+
diff --git a/bindgen/raze/remote/memchr-1.0.2.BUILD b/bindgen/raze/remote/memchr-1.0.2.BUILD
new file mode 100644
index 0000000..a895f25
--- /dev/null
+++ b/bindgen/raze/remote/memchr-1.0.2.BUILD
@@ -0,0 +1,47 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+  "unencumbered", # "Unlicense"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "bench" with type "bench" omitted
+
+rust_library(
+    name = "memchr",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__libc__0_2_48//:libc",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.0.2",
+    crate_features = [
+        "libc",
+        "use_std",
+    ],
+)
+
diff --git a/bindgen/raze/remote/memchr-2.1.3.BUILD b/bindgen/raze/remote/memchr-2.1.3.BUILD
new file mode 100644
index 0000000..ff1a025
--- /dev/null
+++ b/bindgen/raze/remote/memchr-2.1.3.BUILD
@@ -0,0 +1,49 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+  "unencumbered", # "Unlicense"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "build-script-build" with type "custom-build" omitted
+
+rust_library(
+    name = "memchr",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__cfg_if__0_1_6//:cfg_if",
+        "@raze__libc__0_2_48//:libc",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "2.1.3",
+    crate_features = [
+        "default",
+        "libc",
+        "use_std",
+    ],
+)
+
diff --git a/bindgen/raze/remote/nom-3.2.1.BUILD b/bindgen/raze/remote/nom-3.2.1.BUILD
new file mode 100644
index 0000000..9aca6ca
--- /dev/null
+++ b/bindgen/raze/remote/nom-3.2.1.BUILD
@@ -0,0 +1,64 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "arithmetic" with type "test" omitted
+# Unsupported target "arithmetic_ast" with type "test" omitted
+# Unsupported target "blockbuf-arithmetic" with type "test" omitted
+# Unsupported target "cross_function_backtracking" with type "test" omitted
+# Unsupported target "float" with type "test" omitted
+# Unsupported target "ini" with type "test" omitted
+# Unsupported target "ini_str" with type "test" omitted
+# Unsupported target "issues" with type "test" omitted
+# Unsupported target "json" with type "test" omitted
+# Unsupported target "mp4" with type "test" omitted
+# Unsupported target "multiline" with type "test" omitted
+# Unsupported target "named_args" with type "test" omitted
+
+rust_library(
+    name = "nom",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__memchr__1_0_2//:memchr",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "3.2.1",
+    crate_features = [
+        "default",
+        "memchr",
+        "std",
+        "stream",
+        "verbose-errors",
+    ],
+)
+
+# Unsupported target "omnom" with type "test" omitted
+# Unsupported target "overflow" with type "test" omitted
+# Unsupported target "reborrow_fold" with type "test" omitted
+# Unsupported target "test1" with type "test" omitted
diff --git a/bindgen/raze/remote/peeking_take_while-0.1.2.BUILD b/bindgen/raze/remote/peeking_take_while-0.1.2.BUILD
new file mode 100644
index 0000000..27e8693
--- /dev/null
+++ b/bindgen/raze/remote/peeking_take_while-0.1.2.BUILD
@@ -0,0 +1,42 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "Apache-2.0,MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "peeking_take_while",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.1.2",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/proc-macro2-0.3.5.BUILD b/bindgen/raze/remote/proc-macro2-0.3.5.BUILD
new file mode 100644
index 0000000..92a97b9
--- /dev/null
+++ b/bindgen/raze/remote/proc-macro2-0.3.5.BUILD
@@ -0,0 +1,44 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "proc_macro2",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__unicode_xid__0_1_0//:unicode_xid",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.3.5",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "test" with type "test" omitted
diff --git a/bindgen/raze/remote/quick-error-1.2.2.BUILD b/bindgen/raze/remote/quick-error-1.2.2.BUILD
new file mode 100644
index 0000000..c51de2d
--- /dev/null
+++ b/bindgen/raze/remote/quick-error-1.2.2.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "context" with type "example" omitted
+
+rust_library(
+    name = "quick_error",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.2.2",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/quote-0.5.2.BUILD b/bindgen/raze/remote/quote-0.5.2.BUILD
new file mode 100644
index 0000000..508c1df
--- /dev/null
+++ b/bindgen/raze/remote/quote-0.5.2.BUILD
@@ -0,0 +1,44 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "quote",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__proc_macro2__0_3_5//:proc_macro2",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.5.2",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "test" with type "test" omitted
diff --git a/bindgen/raze/remote/redox_syscall-0.1.51.BUILD b/bindgen/raze/remote/redox_syscall-0.1.51.BUILD
new file mode 100644
index 0000000..8648afb
--- /dev/null
+++ b/bindgen/raze/remote/redox_syscall-0.1.51.BUILD
@@ -0,0 +1,46 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+alias(
+  name = "redox_syscall",
+  actual = ":syscall",
+)
+
+rust_library(
+    name = "syscall",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.1.51",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/redox_termios-0.1.1.BUILD b/bindgen/raze/remote/redox_termios-0.1.1.BUILD
new file mode 100644
index 0000000..6173808
--- /dev/null
+++ b/bindgen/raze/remote/redox_termios-0.1.1.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "redox_termios",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__redox_syscall__0_1_51//:redox_syscall",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.1.1",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/regex-1.1.0.BUILD b/bindgen/raze/remote/regex-1.1.0.BUILD
new file mode 100644
index 0000000..70318bb
--- /dev/null
+++ b/bindgen/raze/remote/regex-1.1.0.BUILD
@@ -0,0 +1,65 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "backtrack" with type "test" omitted
+# Unsupported target "backtrack-bytes" with type "test" omitted
+# Unsupported target "backtrack-utf8bytes" with type "test" omitted
+# Unsupported target "build-script-build" with type "custom-build" omitted
+# Unsupported target "crates-regex" with type "test" omitted
+# Unsupported target "default" with type "test" omitted
+# Unsupported target "default-bytes" with type "test" omitted
+# Unsupported target "nfa" with type "test" omitted
+# Unsupported target "nfa-bytes" with type "test" omitted
+# Unsupported target "nfa-utf8bytes" with type "test" omitted
+
+rust_library(
+    name = "regex",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__aho_corasick__0_6_9//:aho_corasick",
+        "@raze__memchr__2_1_3//:memchr",
+        "@raze__regex_syntax__0_6_5//:regex_syntax",
+        "@raze__thread_local__0_3_6//:thread_local",
+        "@raze__utf8_ranges__1_0_2//:utf8_ranges",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.1.0",
+    crate_features = [
+        "default",
+        "use_std",
+    ],
+)
+
+# Unsupported target "shootout-regex-dna" with type "example" omitted
+# Unsupported target "shootout-regex-dna-bytes" with type "example" omitted
+# Unsupported target "shootout-regex-dna-cheat" with type "example" omitted
+# Unsupported target "shootout-regex-dna-replace" with type "example" omitted
+# Unsupported target "shootout-regex-dna-single" with type "example" omitted
+# Unsupported target "shootout-regex-dna-single-cheat" with type "example" omitted
diff --git a/bindgen/raze/remote/regex-syntax-0.6.5.BUILD b/bindgen/raze/remote/regex-syntax-0.6.5.BUILD
new file mode 100644
index 0000000..5f29f8c
--- /dev/null
+++ b/bindgen/raze/remote/regex-syntax-0.6.5.BUILD
@@ -0,0 +1,44 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "bench" with type "bench" omitted
+
+rust_library(
+    name = "regex_syntax",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__ucd_util__0_1_3//:ucd_util",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.6.5",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/strsim-0.7.0.BUILD b/bindgen/raze/remote/strsim-0.7.0.BUILD
new file mode 100644
index 0000000..a429808
--- /dev/null
+++ b/bindgen/raze/remote/strsim-0.7.0.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "lib" with type "test" omitted
+
+rust_library(
+    name = "strsim",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.7.0",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/termcolor-1.0.4.BUILD b/bindgen/raze/remote/termcolor-1.0.4.BUILD
new file mode 100644
index 0000000..ebdf387
--- /dev/null
+++ b/bindgen/raze/remote/termcolor-1.0.4.BUILD
@@ -0,0 +1,42 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "restricted", # "Unlicense OR MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "termcolor",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.0.4",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/termion-1.5.1.BUILD b/bindgen/raze/remote/termion-1.5.1.BUILD
new file mode 100644
index 0000000..6164736
--- /dev/null
+++ b/bindgen/raze/remote/termion-1.5.1.BUILD
@@ -0,0 +1,59 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "alternate_screen" with type "example" omitted
+# Unsupported target "alternate_screen_raw" with type "example" omitted
+# Unsupported target "async" with type "example" omitted
+# Unsupported target "click" with type "example" omitted
+# Unsupported target "color" with type "example" omitted
+# Unsupported target "commie" with type "example" omitted
+# Unsupported target "detect_color" with type "example" omitted
+# Unsupported target "is_tty" with type "example" omitted
+# Unsupported target "keys" with type "example" omitted
+# Unsupported target "mouse" with type "example" omitted
+# Unsupported target "rainbow" with type "example" omitted
+# Unsupported target "read" with type "example" omitted
+# Unsupported target "rustc_fun" with type "example" omitted
+# Unsupported target "simple" with type "example" omitted
+# Unsupported target "size" with type "example" omitted
+
+rust_library(
+    name = "termion",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__libc__0_2_48//:libc",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.5.1",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "truecolor" with type "example" omitted
diff --git a/bindgen/raze/remote/textwrap-0.10.0.BUILD b/bindgen/raze/remote/textwrap-0.10.0.BUILD
new file mode 100644
index 0000000..777f385
--- /dev/null
+++ b/bindgen/raze/remote/textwrap-0.10.0.BUILD
@@ -0,0 +1,47 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "layout" with type "example" omitted
+# Unsupported target "linear" with type "bench" omitted
+# Unsupported target "termwidth" with type "example" omitted
+
+rust_library(
+    name = "textwrap",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__unicode_width__0_1_5//:unicode_width",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.10.0",
+    crate_features = [
+    ],
+)
+
+# Unsupported target "version-numbers" with type "test" omitted
diff --git a/bindgen/raze/remote/thread_local-0.3.6.BUILD b/bindgen/raze/remote/thread_local-0.3.6.BUILD
new file mode 100644
index 0000000..bc76676
--- /dev/null
+++ b/bindgen/raze/remote/thread_local-0.3.6.BUILD
@@ -0,0 +1,44 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "Apache-2.0,MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "thread_local" with type "bench" omitted
+
+rust_library(
+    name = "thread_local",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__lazy_static__1_2_0//:lazy_static",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.3.6",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/ucd-util-0.1.3.BUILD b/bindgen/raze/remote/ucd-util-0.1.3.BUILD
new file mode 100644
index 0000000..6f8688e
--- /dev/null
+++ b/bindgen/raze/remote/ucd-util-0.1.3.BUILD
@@ -0,0 +1,42 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "ucd_util",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.1.3",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/unicode-width-0.1.5.BUILD b/bindgen/raze/remote/unicode-width-0.1.5.BUILD
new file mode 100644
index 0000000..1ab5a8a
--- /dev/null
+++ b/bindgen/raze/remote/unicode-width-0.1.5.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "unicode_width",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.1.5",
+    crate_features = [
+        "default",
+    ],
+)
+
diff --git a/bindgen/raze/remote/unicode-xid-0.1.0.BUILD b/bindgen/raze/remote/unicode-xid-0.1.0.BUILD
new file mode 100644
index 0000000..511fcf8
--- /dev/null
+++ b/bindgen/raze/remote/unicode-xid-0.1.0.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "unicode_xid",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.1.0",
+    crate_features = [
+        "default",
+    ],
+)
+
diff --git a/bindgen/raze/remote/utf8-ranges-1.0.2.BUILD b/bindgen/raze/remote/utf8-ranges-1.0.2.BUILD
new file mode 100644
index 0000000..c2993e1
--- /dev/null
+++ b/bindgen/raze/remote/utf8-ranges-1.0.2.BUILD
@@ -0,0 +1,44 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+  "unencumbered", # "Unlicense"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "bench" with type "bench" omitted
+
+rust_library(
+    name = "utf8_ranges",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.0.2",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/vec_map-0.8.1.BUILD b/bindgen/raze/remote/vec_map-0.8.1.BUILD
new file mode 100644
index 0000000..4309bea
--- /dev/null
+++ b/bindgen/raze/remote/vec_map-0.8.1.BUILD
@@ -0,0 +1,42 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "vec_map",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.8.1",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/which-1.0.5.BUILD b/bindgen/raze/remote/which-1.0.5.BUILD
new file mode 100644
index 0000000..cc92293
--- /dev/null
+++ b/bindgen/raze/remote/which-1.0.5.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "which",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__libc__0_2_48//:libc",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.0.5",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/winapi-0.3.6.BUILD b/bindgen/raze/remote/winapi-0.3.6.BUILD
new file mode 100644
index 0000000..57928ac
--- /dev/null
+++ b/bindgen/raze/remote/winapi-0.3.6.BUILD
@@ -0,0 +1,54 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "build-script-build" with type "custom-build" omitted
+
+rust_library(
+    name = "winapi",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.3.6",
+    crate_features = [
+        "consoleapi",
+        "errhandlingapi",
+        "fileapi",
+        "libloaderapi",
+        "minwinbase",
+        "minwindef",
+        "processenv",
+        "std",
+        "winbase",
+        "wincon",
+        "winerror",
+    ],
+)
+
diff --git a/bindgen/raze/remote/winapi-i686-pc-windows-gnu-0.4.0.BUILD b/bindgen/raze/remote/winapi-i686-pc-windows-gnu-0.4.0.BUILD
new file mode 100644
index 0000000..11e2028
--- /dev/null
+++ b/bindgen/raze/remote/winapi-i686-pc-windows-gnu-0.4.0.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "build-script-build" with type "custom-build" omitted
+
+rust_library(
+    name = "winapi_i686_pc_windows_gnu",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.4.0",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/winapi-util-0.1.1.BUILD b/bindgen/raze/remote/winapi-util-0.1.1.BUILD
new file mode 100644
index 0000000..1bfd949
--- /dev/null
+++ b/bindgen/raze/remote/winapi-util-0.1.1.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+  "unencumbered", # "Unlicense"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "winapi_util",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.1.1",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/winapi-x86_64-pc-windows-gnu-0.4.0.BUILD b/bindgen/raze/remote/winapi-x86_64-pc-windows-gnu-0.4.0.BUILD
new file mode 100644
index 0000000..cba7ac0
--- /dev/null
+++ b/bindgen/raze/remote/winapi-x86_64-pc-windows-gnu-0.4.0.BUILD
@@ -0,0 +1,43 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT,Apache-2.0"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+# Unsupported target "build-script-build" with type "custom-build" omitted
+
+rust_library(
+    name = "winapi_x86_64_pc_windows_gnu",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "0.4.0",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/raze/remote/wincolor-1.0.1.BUILD b/bindgen/raze/remote/wincolor-1.0.1.BUILD
new file mode 100644
index 0000000..edcc7e6
--- /dev/null
+++ b/bindgen/raze/remote/wincolor-1.0.1.BUILD
@@ -0,0 +1,45 @@
+"""
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+package(default_visibility = [
+  # Public for visibility by "@raze__crate__version//" targets.
+  #
+  # Prefer access through "//bindgen/raze", which limits external
+  # visibility to explicit Cargo.toml dependencies.
+  "//visibility:public",
+])
+
+licenses([
+  "notice", # "MIT"
+  "unencumbered", # "Unlicense"
+])
+
+load(
+    "@io_bazel_rules_rust//rust:rust.bzl",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+
+
+rust_library(
+    name = "wincolor",
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    edition = "2015",
+    srcs = glob(["**/*.rs"]),
+    deps = [
+        "@raze__winapi__0_3_6//:winapi",
+        "@raze__winapi_util__0_1_1//:winapi_util",
+    ],
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    version = "1.0.1",
+    crate_features = [
+    ],
+)
+
diff --git a/bindgen/repositories.bzl b/bindgen/repositories.bzl
new file mode 100644
index 0000000..1817783
--- /dev/null
+++ b/bindgen/repositories.bzl
@@ -0,0 +1,89 @@
+# Copyright 2019 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+load("//bindgen/raze:crates.bzl", "raze_fetch_remote_crates")
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+def maybe(workspace_rule, **kwargs):
+    if not native.existing_rule(kwargs["name"]):
+        workspace_rule(**kwargs)
+
+def rust_bindgen_repositories():
+    """Declare dependencies needed for bindgen."""
+
+    # nb. The bindgen rule itself should work on any platform.
+    _linux_rust_bindgen_repositories()
+
+    maybe(
+        _local_libstdcpp,
+        name = "local_libstdcpp",
+    )
+
+    # This overrides the BUILD file raze generates for libloading with a handwritten one.
+    # TODO: Tidier to implement https://github.com/google/cargo-raze/issues/58
+    maybe(
+        http_archive,
+        name = "raze__libloading__0_5_0",
+        url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/libloading/libloading-0.5.0.crate",
+        type = "tar.gz",
+        sha256 = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2",
+        strip_prefix = "libloading-0.5.0",
+        # TODO: This is a manual patch, need https://github.com/google/cargo-raze/issues/58
+        build_file = Label("//bindgen/raze:libloading.BUILD")
+    )
+    raze_fetch_remote_crates()
+
+    native.register_toolchains("@io_bazel_rules_rust//bindgen:example-bindgen-toolchain")
+
+def _linux_rust_bindgen_repositories():
+    # Releases @ http://releases.llvm.org/download.html
+    maybe(
+        http_archive,
+        name = "bindgen_clang",
+        urls = ["http://releases.llvm.org/7.0.1/clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-18.04.tar.xz"],
+        strip_prefix = "clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-18.04",
+        sha256 = "e74ce06d99ed9ce42898e22d2a966f71ae785bdf4edbded93e628d696858921a",
+        build_file = "@//bindgen:clang.BUILD",
+    )
+
+LIBSTDCPP_LINUX = """
+cc_library(
+  name = "libstdc++",
+  srcs = ["libstdc++.so.6"],
+  visibility = ["//visibility:public"]
+)
+"""
+
+LIBSTDCPP_MAC = """
+cc_library(
+    name = "libstdc++",
+    srcs = ["libstdc++.6.dylib"],
+    visibility = ["//visibility:public"]
+)
+"""
+
+def _local_libstdcpp_impl(repository_ctx):
+    os = repository_ctx.os.name.lower()
+    if os == "linux":
+        repository_ctx.symlink("/usr/lib/x86_64-linux-gnu/libstdc++.so.6", "libstdc++.so.6")
+        repository_ctx.file("BUILD.bazel", LIBSTDCPP_LINUX)
+    elif os.startswith("mac"):
+        repository_ctx.symlink("/usr/lib/libstdc++.6.dylib", "libstdc++.6.dylib")
+        repository_ctx.file("BUILD.bazel", LIBSTDCPP_MAC)
+    else:
+        fail(os + " is not supported.")
+
+_local_libstdcpp = repository_rule(
+    implementation = _local_libstdcpp_impl,
+)
\ No newline at end of file
diff --git a/docs/BUILD b/docs/BUILD
index 9a70e5e..4f94499 100644
--- a/docs/BUILD
+++ b/docs/BUILD
@@ -17,9 +17,13 @@
         "rust_proto_toolchain",
         "rust_proto_library",
         "rust_grpc_library",
+        "rust_bindgen_toolchain",
+        "rust_bindgen",
+        "rust_bindgen_library",
     ],
     deps = [
-        "@io_bazel_rules_rust//proto:rules",
         "@io_bazel_rules_rust//rust:rules",
+        "@io_bazel_rules_rust//proto:rules",
+        "@io_bazel_rules_rust//bindgen:rules",
     ],
 )
diff --git a/docs/all.bzl b/docs/all.bzl
index df22002..8e90348 100644
--- a/docs/all.bzl
+++ b/docs/all.bzl
@@ -19,6 +19,11 @@
 #     _rust_library = "rust_library",
 #     _rust_test = "rust_test",
 # )
+# load("@io_bazel_rules_rust//bindgen:bindgen.bzl",
+#     _rust_bindgen_toolchain = "rust_bindgen_toolchain",
+#     _rust_bindgen = "rust_bindgen",
+#     _rust_bindgen_library = "rust_bindgen_library",
+# )
 #
 # rust_library = _rust_library
 # rust_binary = _rust_binary
@@ -29,6 +34,11 @@
 # # rust_benchmark = _rust_benchmark
 # rust_proto_library = _rust_proto_library
 # rust_grpc_library = _rust_grpc_library
+#
+# rust_bindgen_toolchain = _rust_bindgen_toolchain
+# rust_bindgen = _rust_bindgen
+# # TODO: Macro documentation doesn't seem to work.
+# # rust_bindgen_library = _rust_bindgen_library
 
 # TODO(stardoc): This aliasing isn't mentioned in the docs, but generated documentation is broken without it.
 rust_toolchain = _rust_toolchain
diff --git a/docs/index.md b/docs/index.md
index e65bed6..330d779 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -53,7 +53,7 @@
 rust_library(
     name = "hello_lib",
     srcs = ["src/lib.rs"],
-)
+)   
 ```
 
 `hello_world/src/main.rs`:
@@ -1248,4 +1248,76 @@
   </tbody>
 </table>
 
+<a name="#rust_bindgen_toolchain"></a>
+## rust_bindgen_toolchain
 
+<pre>
+rust_bindgen_toolchain(<a href="#rust_bindgen_toolchain-name">name</a>, <a href="#rust_bindgen_toolchain-bindgen">bindgen</a>, <a href="#rust_bindgen_toolchain-clang">clang</a>, <a href="#rust_bindgen_toolchain-libclang">libclang</a>, <a href="#rust_bindgen_toolchain-libstdcxx">libstdcxx</a>, <a href="#rust_bindgen_toolchain-rustfmt">rustfmt</a>)
+</pre>
+
+The tools required for the `rust_bindgen` rule.
+
+### Attributes
+
+<table class="params-table">
+  <colgroup>
+    <col class="col-param" />
+    <col class="col-description" />
+  </colgroup>
+  <tbody>
+    <tr id="rust_bindgen_toolchain-name">
+      <td><code>name</code></td>
+      <td>
+        <a href="https://bazel.build/docs/build-ref.html#name">Name</a>; required
+        <p>
+          A unique name for this target.
+        </p>
+      </td>
+    </tr>
+    <tr id="rust_bindgen_toolchain-bindgen">
+      <td><code>bindgen</code></td>
+      <td>
+        <a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
+        <p>
+          The label of a `bindgen` executable.
+        </p>
+      </td>
+    </tr>
+    <tr id="rust_bindgen_toolchain-clang">
+      <td><code>clang</code></td>
+      <td>
+        <a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
+        <p>
+          The label of a `clang` executable.
+        </p>
+      </td>
+    </tr>
+    <tr id="rust_bindgen_toolchain-libclang">
+      <td><code>libclang</code></td>
+      <td>
+        <a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
+        <p>
+          A cc_library that provides bindgen's runtime dependency on libclang.
+        </p>
+      </td>
+    </tr>
+    <tr id="rust_bindgen_toolchain-libstdcxx">
+      <td><code>libstdcxx</code></td>
+      <td>
+        <a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
+        <p>
+          A cc_library that satisfies libclang's libstdc++ dependency.
+        </p>
+      </td>
+    </tr>
+    <tr id="rust_bindgen_toolchain-rustfmt">
+      <td><code>rustfmt</code></td>
+      <td>
+        <a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; optional
+        <p>
+          The label of a `rustfmt` executable. If this is provided, generated sources will be formatted.
+        </p>
+      </td>
+    </tr>
+  </tbody>
+</table>
diff --git a/examples/ffi/rust_calling_c/simple/BUILD b/examples/ffi/rust_calling_c/simple/BUILD
new file mode 100644
index 0000000..2c55254
--- /dev/null
+++ b/examples/ffi/rust_calling_c/simple/BUILD
@@ -0,0 +1,27 @@
+load("@io_bazel_rules_rust//rust:rust.bzl", "rust_binary", "rust_doc", "rust_library", "rust_test")
+load("@io_bazel_rules_rust//bindgen:bindgen.bzl", "rust_bindgen_library")
+
+cc_library(
+    name = "simple",
+    srcs = ["simple.h"],
+)
+
+rust_bindgen_library(
+    name = "simple_bindgen",
+    bindgen_flags = [
+        "--whitelist-var=SIMPLE_.*",
+    ],
+    cc_lib = ":simple",
+    header = "simple.h",
+)
+
+rust_binary(
+    name = "simple_example",
+    srcs = ["main.rs"],
+    deps = [":simple_bindgen"],
+)
+
+rust_test(
+    name = "simple_test",
+    deps = [":simple_example"],
+)
diff --git a/examples/ffi/rust_calling_c/simple/main.rs b/examples/ffi/rust_calling_c/simple/main.rs
new file mode 100644
index 0000000..76d6b0d
--- /dev/null
+++ b/examples/ffi/rust_calling_c/simple/main.rs
@@ -0,0 +1,11 @@
+fn main() {
+    println!("The value is {}!", simple_bindgen::SIMPLE_VALUE);
+}
+
+#[cfg(test)]
+mod test {
+    #[test]
+    fn do_the_test() {
+        assert_eq!(43, simple_bindgen::SIMPLE_VALUE);
+    }
+}
\ No newline at end of file
diff --git a/examples/ffi/rust_calling_c/simple/simple.h b/examples/ffi/rust_calling_c/simple/simple.h
new file mode 100644
index 0000000..c32d11d
--- /dev/null
+++ b/examples/ffi/rust_calling_c/simple/simple.h
@@ -0,0 +1,3 @@
+#include <stdint.h>
+
+const int64_t SIMPLE_VALUE = 43;
diff --git a/proto/README.md b/proto/README.md
index bfef428..3d6ec78 100644
--- a/proto/README.md
+++ b/proto/README.md
@@ -29,35 +29,39 @@
 rust_proto_repositories()
 ```
 
+[raze]: https://github.com/google/cargo-raze
+
 This will load crate dependencies of protobuf that are generated using
-[cargo raze](https://github.com/google/cargo-raze) inside the rules_rust
+[cargo raze][raze] inside the rules_rust
 repository. However, using those dependencies might conflict with other uses
-of [cargo raze](https://github.com/google/cargo-raze). If you need to change
+of [cargo raze][raze]. If you need to change
 those dependencies, please see the [dedicated section below](#custom-deps).
 
+For additional information about Bazel toolchains, see [here](https://docs.bazel.build/versions/master/toolchains.html).
+
 ## <a name="custom-deps">Customizing dependencies
 
 These rules depends on the [`protobuf`](https://crates.io/crates/protobuf) and
 the [`grpc`](https://crates.io/crates/grpc) crates in addition to the [protobuf
-compiler](https://github.com/google/protobuf). To do so the
-`rust_proto_repositories` import the given crates using file generated with
-[`cargo raze`](https://github.com/google/cargo-raze).
+compiler](https://github.com/google/protobuf). To obtain these crates,
+`rust_proto_repositories` imports the given crates using BUILD files generated with
+[`cargo raze`][raze].
 
 If you want to either change the protobuf and gRPC rust compilers, or to
-simply use [`cargo raze`](https://github.com/google/cargo-raze) in a more
+simply use [`cargo raze`][raze] in a more
 complex scenario (with more dependencies), you must redefine those
 dependencies.
 
 To do this, once you've imported the needed dependencies (see our
 [Cargo.toml](raze/Cargo.toml) file to see the default dependencies), you
-need to point to the correct toolchain, to do so you can create a BUILD
-file with the toolchain definition, for example:
+need to create your own toolchain. To do so you can create a BUILD
+file with your toolchain definition, for example:
 
 ```python
 load("@io_bazel_rules_rust//proto:toolchain.bzl", "rust_proto_toolchain")
 
 rust_proto_toolchain(
-    name = "toolchain-impl",
+    name = "proto-toolchain-impl",
     # Path to the protobuf compiler.
     protoc = "@com_google_protobuf//:protoc",
     # Protobuf compiler plugin to generate rust gRPC stubs.
@@ -67,8 +71,8 @@
 )
 
 toolchain(
-    name = "toolchain",
-    toolchain = ":toolchain-impl",
+    name = "proto-toolchain",
+    toolchain = ":proto-toolchain-impl",
     toolchain_type = "@io_bazel_rules_rust//proto:toolchain",
 )
 ```
@@ -77,7 +81,7 @@
 inserting the following statement in your `WORKSPACE` file:
 
 ```python
-register_toolchains("//package:toolchain")
+register_toolchains("//my/toolchains:proto-toolchain")
 ```
 
 Finally, you might want to set the `rust_deps` attribute in
diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl
index 028015d..470a85e 100644
--- a/rust/private/rustc.bzl
+++ b/rust/private/rustc.bzl
@@ -258,7 +258,10 @@
     package_dir = ctx.build_file_path[:ctx.build_file_path.rfind("/")]
     manifest_dir_env = "CARGO_MANIFEST_DIR=$(pwd)/{} ".format(package_dir)
     command = '{}{}{} "$@" --remap-path-prefix="$(pwd)"=__bazel_redacted_pwd'.format(
-           manifest_dir_env, out_dir_env, toolchain.rustc.path)
+        manifest_dir_env,
+        out_dir_env,
+        toolchain.rustc.path,
+    )
 
     ctx.actions.run_shell(
         command = command,