Squashed 'third_party/rules_rust/' changes from 078c6908f..bf9ddeb7c

bf9ddeb7c Release 0.25.1 (#2049)
db5b2fd65 Update tinyjson (#2050)
6a7872ae3 Fix prost proto packages not sanitizing to valid module names (#2044)
c080d7bfa Moved legacy protobuf rules to `proto/protobuf` (#2043)
1281cc051 Remove debug code. (#2048)
cd126be1f Fix build failure finding crate_roots when mixed with generated sources (#2041)
7f751cddd Consolidate rust_prost_library and fix extension-only proto generation. (#2047)
6118c81f2 Release 0.25.0 (#2042)
a6f29fd07 Add Prost and Tonic rules. (#2033)
9442aed8c fix: `crate_type` more accurately corresponds to CC linking actions (#1975)
4f4e2b17b Re-enable zig example on CI (#2030)
2ded0c2f5 Fix flaky coverage test in CI (#2028)
36f8251f9 Exclude .tmp_git_root from globs (#1948)
ca750fa83 Eliminate Rustfmt action in Bindgen rules. Bindgen can run rustfmt (#2025)
c55ec0cfb Allow sysroots from cc_toolchains to be added to bindgen actions (#2024)
9314b1b0c Release 0.24.1 (#2023)
92ea74ade Making rust_std attr in rust_toolchain mandatory (#1984)
a54b8e14b Update `rust_library_group` to use `DepVariantInfo` (#2022)
47644346b Release v0.24.0 (#2020)
a6b0a7f39 Rust library group (#1848)
bc43f4841 Fix crate_universe's `all_crate_deps` and `aliases` functions failing in case the crate's Cargo.toml has condtional dependencies (#2018)
8f27ec7c5 fix: load cargo manifest without resolving abs path of deps (#2017)
23f99bb63 feature: `target_compatible_with` added to `CommonAttrs` (#1976)
11f8c9875 Make `rust_doc_test` inherit it's crate aliases attribute (#2007)
8e848414d Regenerated crate_universe outputs for all packages (#2011)
1b6365131 Don't use startup:windows (#2012)
e80582e75 Fix thumbv* platform resolution (#2010)
367f90ef0 Update bindgen version to 0.65.1 (#2008)
e6ed5bf90 Release 0.23.0 (#2003)
93b230bb8 Fix code coverage collection. (#2001)
0a14bfbb0 Minor CI and test cleanup (#2004)
3e2ee941a Update bindgen rules to build clang from source. (#1998)
5a1a7577d Split up cargo_build_script tests (#2002)
eb6413e83 Update various bash scripts to pipe errors to stderr (#1999)
affe947ac Update stardoc version (#1997)
7073146f8 Add support for armv8-m (#1993)
73a06f130 Added Rust 1.70.0 (#1991)
23c20a93f Fixes crates_vendor workspace name detection when using bzlmod (#1990)
f5813fa08 Set windows flags in platform-specific bazelrc (#1988)
c1632b5b5 Fix up anchor link (#1987)
56e760487 Fix typo in crate_universe-generated defs.bzl comment (#1981)
94cbe4c2c Symlink in the exec-root so that relative paths will work, unchanged. (#1781)
af8ef62eb Release 0.22.0 (#1974)
4aaa6de30 Allow specifying exec and target compatibility constraints (#1971)
f1b19c394 Update rules_apple in tests (#1972)
937e63399 Add T2 support for x86_64-unknown-none (#1967)
66b1bf165 fix: lld-link (MSVC) fix flags including `-l` prefix (#1958)
285dcbbb9 feature: expose `extra_rustc_flags` and `extra_exec_rustc_flags` at `rust_register_toolchains` (#1959)
0f25cb462 Removed `rust_toolchain.os` in favor of `rust_toolchain.exec_triple`. (#1960)
a2a1109dc Add T2 support for thumbv7em-none-eabi (#1957)
80f0eb488 Support for `no_std` mode (#1934)
99aaf0830 Rename crates_vendor_manifests to cvm to shorten windows path lengths (#1944)
0a57da049 Added tests for build script dependencies to crate_universe (#1943)
caffb0a08 Release 0.21.1 (#1936)
c869a17c7 Fix regression in building zlib (#1935)
24b9dea4f Release 0.21.0 (#1933)
7677c617e Add support for rustc flags to `rust_proto_library` (#1932)
fa304ae48 Updated zlib BUILD file to support darwin-arm64 (#1931)
a86313282 Added Rust 1.69.0 (#1930)
f0e12c707 Make BuildInfo provider public (#1920)
c6ad23aba Respect `#[global_allocator]` in `cc_common.link` builds (#1926)
d78752504 Exclude target directory from release tars (#1922)
0339cd18a [wasm-bindgen] Update to v0.2.84 (#1919)
07af5678e Handle corner case for windows architecture detection (#1915)
c56e7660d Fix optional deps by platform (#1911)
4663ff6a3 cc_common_link: also respect --custom_malloc if set (#1912)
dab425760 Add Rust 1.68.2 (#1908)
e4bd39f95 Add empty rustfmt.toml (#1907)
eaf513865 Support bzlmod (#1528)
1074ecbab Release v0.20.0 (#1900)
44aec0a79 ci: fix test config in cc_common_link_ubuntu2004 (#1904)
6571cde64 Adds per_crate_rustc_flag build setting. (#1827)
7a47449df Added Rust 1.68.1 (#1898)
e3bcdbad1 Fixed rustdoc warnings in crate_universe (#1897)
529f45900 Added `rustdoc_flags` attribute to rust_doc rule (#1867)
9e3499405 Have rustdoc return its output directory instead of zip default. (#1868)
9d6741f40 Implement support for optional crates enabled with dep: features (#1885)
fd10963ea Skip adding -lstatic to libtest and libstd on Darwin (#1620)
b3314b45e Release 0.19.1 (#1895)
c1a9fd86f Accumulate all features from cargo tree output (#1884)
206f71c95 Disable zig example (#1893)
1a5d07cd2 Add runfiles support to rust_stdlib_filegroup (#1890)
6996cd550 Deleted unused targets and cleanup docs (#1889)
a85e24e20 Fix triple constraints for iOS and watchOS (#1888)
e13fd3bad Release rules_rust and cargo-bazel (#1882)
9e9853d63 Add support for thumbv7em with hard float (#1871)
b3cd5962e Added Rust 1.68.0 (#1866)
f1b7aedf5 Support sparse indexes (#1857)
7f2dd433a Make fetch_shas work with mktemp from coreutils 8.32 (#1870)
a9cc01230 Update crate_universe dependencies (#1872)
c038e94ae Pipe stderr from cargo tree processes (#1879)
222d60322 Parallelize cargo tree calls (#1874)
cdbbf7131 Add Fuchsia platform support (#1833)
17e5b04c2 Use `_make_link_flags_darwin` when target os is `ios`. (#1843)
d9ecc8df4 crate_universe: Support fetching crates with git branch, tag or rev (#1846)
1c694cd60 Forward `toolchains` to `cargo_build_script` targets (#1862)
9affcbfa7 Skip detecting abi for empty values (#1830)
6193fe823 Re-enable crate_universe MacOS tests (#1861)
c25db95ae Updated Rust to 1.67.1 (#1864)
7b8fd06be Support `[patch]` in crate_universe when using multiple `Cargo.toml`s (#1856)
c645fe399 Silence windows build failure (#1863)
75bba7b50 Make rust_clippy providers match rustfmt_test (#1806)
f09d72755 Fix test assertion for arm64 macs (#1845)
f4113bfe1 Fix tests for new Apple toolchain (#1844)
20ce44e30 fix: use target_triple struct instead of string (#1835)
bdbded181 Fix code example in doc (#1838)
4f4014052 Fix typo: plced -> placed (#1834)
baeb0664d Remove ios/android/wasm support for gen_rust_project deps (#1684)
02557a47a Add `render_config` attribute to `crates_vendor`. (#1832)
4357fb154 Updated rules_rust to version 0.18.0 (#1829)
9adfdca9b Various cleanups (#1828)
4fa412385 Added update known shas to include T1-T2 triples (#1824)
905731ad9 Instructions on how to perform `rustfmt` check (#1822) (#1823)
108b1a187 Encapsulate running cargo into a struct (#1815)
57a099b63 Fixes resolver issue with root packages and another dependency format (#1819)
78ca9ba0a Use env method recently added to cargo_metadata (#1813)
92834930f Updated `rust_toolchain.target_json` to take encoded json strings (#1810)
84f1d0657 support `resolver = "2"` target-specific features (#1710)
a5853fd37 Use correct dynamic link args fro proc-macro crates (#1803)
b656e2553 Added tests for the `triple` constructor (#1811)
ea4a79ad9 Disable job in CI to avoid infrastructure failure. (#1816)
2fc02f030 Delete `rust_toolchain.rusrc_srcs` (#1807)
804d5fc1f Convert `rust_toolchain` attrs `exec_triple` and `target_triple` to structs (#1808)
499a2ca38 Updated platform triple values from strings to structs ("triple") (#1804)
aae1dbdcb Unify functions for computing constraint values for platform triple abi (#1805)
0d6d2b1eb Updated rules_rust version to `0.17.0` (#1800)
88e83f2df Added Rust 1.67.0 (#1799)
6922b5012 rustdoc_test: fix and test OUT_DIR (#1779)
ad01d1b0e [crate_universe] add an annotation to disable pipelining (#1733)
f651cd18f Add `CARGO_BAZEL_REPIN_ONLY` repinning allowlist (#1798)
d7f0debb0 Revert "Disable broken clang and ldd CI jobs (#1785)" (#1796)
96f82aaad Fix `cc_common.link` file output name (#1795)
5079b64d5 Fix use of `rustfmt_toolchain` when `rustc` is not provided (#1794)
23c650f35 Have `--experimental_use_cc_common_link` cover `rust_shared_library` (#1792)
ba0fb5956 Added support for `--nolegacy_external_runfiles` to `rust_doc_test` (#1790)
112242bb7 Prevent crates_vendor from restarting bazel. (#1791)
52231ef9f Added compatibility flags to `.bazelrc` to prevent regressions (#1789)
91cd399a0 Add "crate-name={}" tag to Crate Universe targets (#1787)
1b1dae196 Added Rust 1.66.1 (#1767)
fe17e8b8e Add file:// prefix to env var in docs (#1788)
0fe742bff Updated `rust_bindgen` to use `rustfmt_toolchain` (#1770)
042fd6c1c Update docs on setting Rust versions (#1786)
dddd8a0d4 Updated crate_universe dependencies (#1775)
a1330a71f Download `rustc` in `rustfmt_toolchain_repository` (#1769)
e96aad9aa Updated the ios_build example to use `crates_vendor` (#1778)
e315007df Disable broken clang and ldd CI jobs (#1785)
4e89d52a9 rustdoc_test: substitute the root of the current crate (#1777)
a52041fb5 Support `target_settings` in `rust_repository_set` and `rust_toolchain_repository` (#1758)
49906eb29 Update clippy and rustfmt aspects to require CrateInfo providers (#1772)
85564208e Updated rules_rust version to `0.16.1` (#1761)
614499a5b Fixed inability to deserialize crate_universe lockfiles (#1760)
9803d3034 Fix data and compile_data for rust_doc (#1741)
927a364cb Update Release github pipeline to trigger automatically (#1757)
7d03e05f8 Fix release pipeline (#1756)
cf7ca5dfd Updated rules_rust to version `0.16.0` (#1750)
203fe4b9a Remove unnecessary binary file (#1755)
941c7cca9 Don't propagate `compatible_with` to the underlying `cargo_build_script` `rust_binary` target (#1754)
a31490d9a Make loads from @rules_rust//rust:defs.bzl come out on one line (#1753)
7ebad4d50 Generate only the needed subset of binaries for bindgen and proto (#1751)
4ef3d4aaa Repin examples/crate_universe_unnamed (#1752)
d6e300359 Regenerate BUILD files using serde_starlark renderer (#1746)
e7c8a97d1 Convert BUILD.$name-$version.bazel to serde_starlark (#1743)
c09818d3b Exclude generated files from language stats and collapse in code review (#1747)
26a24f030 Added CI for single toolchain channel workspaces (#1712)
caed7d814 Report context on error failing to get version (#1744)
36b57af7b Add gen_binaries annotation to control which bins to make target for (#1718)
d916a6f52 crate_universe re-pinning now defaults to "workspace" (#1723)
f34661ee1 Propagate `compatible_with` attribute to the underlying `_build_script_run` target (#1745)
92977d1bf Re-pinned all dependencies managed by crate_universe (#1735)
d5289ad1c Added `rustfmt_toolchain` and refactored toolchain repository rules (#1719)
532e60ff0 Collect targets in a deterministic order (#1736)
52e02c25b Eliminate all use of hash-based collections from crate_universe (#1737)
31073ff8e Replace tera template with serde_starlark (#1734)
d4e5586d0 Support the RUNFILES_DIR environment variable. (#1732)
1357b85b1 Addressed clippy warnings from `clippy 0.1.67 (ec56537c 2022-12-15)` (#1717)
8bc9f788d Support dsym_folder output group in tests (#1703)
90c5b6eb7 Added CI for minimum supported Rust version (#1720)
be82ff8bd Match prerelease versions with annotation wildcard (#1716)
36c7f285b Arm Thumb Embedded Targets. (#1721)
5ef52e465 Update current_toolchain_files tests to use a dedicated test rule (#1714)
c75ea6f9e Add `Runfiles::current_repository` to runfiles library (#1713)
2f0511782 Updated rules_rust to version `0.15.0` (#1706)
019f87178 Added Rust 1.66.0 (#1705)
1469cd7cb Fix labels to work with canonical label literals. (#1700)
5826a500a Add riscv32imc and riscv64gc to the known sha targets (#1698)
40dee95ce Fixed typos: normla -> normal (#1699)
8f08e77ac load_arbitrary_tool uses tool_suburl to look up sha256 (#1695)
8faec3060 Fix typos in crate_universe rendered comments (#1691)
bd64711ff Silence flaky test (#1693)
46b7ea5af Added a build setting for toolchain channels (#1671)
70b272aad Updated rules_rust to version `0.14.0` (#1669)
91e597dd1 Updated all crates_vendor outputs (#1687)
9a047b0b9 Updated crate_universe dependencies (#1686)
3a91d2f5b Add RV64GC target (#1683)
d9e752ab4 Add per-toolchain `rustc_flags` (#1635)
56237415e stardoc: Use backtick not `<code>` for attr default values  (#1682)
d4b31a494 Allow passing a bazel path to vendor explicitly (#1661)
d51bf9ce0 Updated crate_universe to work with `--nolegacy_external_runfiles` (#1680)
7f40636d1 crate_universe/private/crates_vendor.bzl typo fix (#1678)
025bf7db8 Merge cc toolchain flags into build script env (#1675)
b7c36c051 Fix confusing/misleading crate_universe docs (#1677)
29233e354 Revert #1564 (#1663)
ed32b6de2 Common glob excludes (#1673)
61b99cdd1 fix: add space to crate data exclude list (#1665)
8bb25b8b7 Support Windows ARM64 (aarch64-pc-windows-msvc) (#1664)
ddf2a4c23 Re-render crate BUILD files after #1647 (#1655)
44c7e1588 Group deps and aliases by platform triple rather than by cfg string when generating BUILD files. This avoid bazel errors due to duplicate keys/deps. (#1647)
de18d8bb6 Allow `buildifier` attribute to be a file (#1660)
aa0815dc9 Fix naming of ambiguous libs (#1625)
ff314d4ab Also pass -c opt to tests in opt mode CI (#1626)
ff4e90515 Reenable windows job (#1658)
c45b8e91f Updated rules_rust to version `0.13.0` (#1644)
87d6b6c37 Update `//util/label` to support `+` in packages (#1654)
ab6959db5 fix: Fix issue with wasi-0.11.0+wasi-snapshot-preview1 (#1632)
28c090ed0 Replaced custom platform constraint values with aliases to `@platforms` (#1652)
dfbea4f52 Deprecated `rust_toolchain.rustc_srcs` (#1653)
fd1db4391 Remove deprecated attributes from rust_toolchain and cargo_bootstrap (#1651)
c8ab970c4 Generated rust-project.json files now include sysroot paths (#1641)
0a3e04cf9 Fix vendoring when not in a package (#1646)
aece1e37d Deduplicate expand_location targets in rust-project.json crate creation to avoid a bazel crash (#1639)
03a0b2483 [docs] Fixing typos in CargoConfig doc strings (#1638)
bd4fd2ac5 Upgraded cfg-expr dependency to 0.12.0. (#1636)
330554a13 Disable failing job in CI (#1640)
849f106e6 Consider compilation mode when choosing `pic`/`nopic` object files to link (#1624)
53491d719 Updated rules_rust to version `0.12.0` (#1630)
8e8843724 Remove empty glob (#1628)
1f621a944 Added Rust 1.65.0 (#1627)
c6af4d025 Add `-c opt` mode to CI (#1621)
95320cc8b process_wrapper: print line on error to parse message as json (#1566)
81eaccf39 Fixed CI breakage (#1619)
478fc3a57 Fix ambiguous native dependencies in `proc_macro`s and `staticlib`s (#1611)
9e3d8415e Build deps of _build_script_run in 'exec' mode (#1561)
ea031082b Fixed outdated docs (#1614)
a8c540e49 Restore support for old cargo_build_script load statements (#1613)
295b5ccc7 Renamed `_build_script_run` rule to `cargo_build_script` (#1612)
3778069ec Remove references to Google mirror in docs (#1607)
aad54ba29 Updated crate_universe dependencies (#1606)
c349df2a6 Remove Google mirror from Starlark snippet in release notes (#1604)
0493b998d Avoid rendering a mock root package when possible (#1596)
b04aa053c process_wrapper: Apply substitutions to param files (#1565)
b209b3e15 Updated rules_rust to version `0.11.0`. (#1587)
b1079453b Typo correction on doc (#1593)
ca5678266 Updated crate_universe dependencies (#1591)
a364d448f Fixes crates_vendor labels in remote mode when used from the root workspace (#1575)
1cc37c268 Expose the output directory from cargo_build_script (#1588)
7ffe0a555 Ignore non-utf8 text in build script output (#1583)
c5b38fe00 Merge runfiles from transitive dependencies of rust_test crate attr (#1487)
da3d522d5 Fix build scripts targeting the wrong architecture (#1564)
d288ed634 Add `out_dir` support in `cargo_dep_env` (#1571)
78d6c1b46 fix: incorrect rustfmt edition query (#1582)
48927127e Set CARGO_MANIFEST_DIR at runtime for tests (#1559)
76bd69033 Add an output group for the .rmeta (#1585)
352bfeb05 Cleanup deprecated code (#1577)
86dc561f9 Move crate_root_src to utils (#1570)
beb554eb9 update to wasm-bindgen v0.2.83 (#1567)
73fd1616b Export AbsoluteLabel functionality (#1568)
c57e7a399 Remap $PWD to empty string instead of "." (#1563)
f0cdcedc2 Added Rust 1.64.0 (#1562)
1d326554a Update docs to show release policies and support (#1560)
78c793a0a Fix markdown typo in rust_analyzer.md (#1553)
c13980fb6 Add iOS examples (#1546)
8a5e07e9f Update apple_support (#1549)
6dacd9803 Strip leading '@'s for labels in the splicing manifest (#1547)
f73d1d6fb use crate_info.deps in establish_cc_info (#1543)
4845af6c0 Add android example (#1545)
9570b7aa7 Remove -lgcc from Android builds (#1541)
cb9ca1b81 Fix crate_universe/private/srcs.bzl to work with repo mappings (#1540)
d1fc9accc Minor cleanup of CI pipelines (#1534)
2bb077b3b Updated rules_rust to version 0.10.0 (#1533)
b8751b860 add cc config info to dummy wasm32 cc toolchain (#1532)
f5ed797ee Updates rust_test to use main.rs as the root when use_libtest_harness is false (#1518)
cfcaf21d5 Preserve directory structure of source files when some are generated (#1526)
51c065841 migrating to rbe_preconfig and remove bazel_toolchains (#1524)
055abd402 Fix typo in an example of crates_repository rule (#1520)
8bfed1cd2 Added Rust 1.63.0 (#1512)
3a69ce09b Update wasm_bindgen to 0.2.82 (#1513)

git-subtree-dir: third_party/rules_rust
git-subtree-split: bf9ddeb7c83a9fe8a7d87c76134cdd8e16131b62
Signed-off-by: Adam Snaider <adsnaider@gmail.com>
Change-Id: Id9490c68d6221da66953a915a25042ef8b848505
diff --git a/crate_universe/private/bootstrap_utils.bzl b/crate_universe/private/bootstrap_utils.bzl
index 9df387e..d836331 100644
--- a/crate_universe/private/bootstrap_utils.bzl
+++ b/crate_universe/private/bootstrap_utils.bzl
@@ -10,8 +10,13 @@
 ]
 """
 
+def _format_src_label(label):
+    if label.workspace_name != "":
+        fail("`srcs` must be from the rules_rust repository")
+    return "Label(\"{}\"),".format(str(label).lstrip("@"))
+
 def _srcs_module_impl(ctx):
-    srcs = ["@rules_rust{}".format(src.owner) for src in ctx.files.srcs]
+    srcs = [_format_src_label(src.owner) for src in ctx.files.srcs]
     if not srcs:
         fail("`srcs` cannot be empty")
     output = ctx.actions.declare_file(ctx.label.name)
@@ -19,7 +24,7 @@
     ctx.actions.write(
         output = output,
         content = _SRCS_TEMPLATE.format(
-            srcs = "\n    ".join(["\"{}\",".format(src) for src in srcs]),
+            srcs = "\n    ".join(srcs),
         ),
     )
 
diff --git a/crate_universe/private/common_utils.bzl b/crate_universe/private/common_utils.bzl
index 8faa7e7..22d27b5 100644
--- a/crate_universe/private/common_utils.bzl
+++ b/crate_universe/private/common_utils.bzl
@@ -10,11 +10,15 @@
 CARGO_BAZEL_REPIN = "CARGO_BAZEL_REPIN"
 REPIN = "REPIN"
 
+CARGO_BAZEL_REPIN_ONLY = "CARGO_BAZEL_REPIN_ONLY"
+
 REPIN_ENV_VARS = [
     CARGO_BAZEL_REPIN,
     REPIN,
 ]
 
+REPIN_ALLOWLIST_ENV_VAR = CARGO_BAZEL_REPIN_ONLY
+
 _EXECUTE_ERROR_MESSAGE = """\
 Command {args} failed with exit code {exit_code}.
 STDOUT ------------------------------------------------------------------------
@@ -71,11 +75,18 @@
         cargo_config = repository_ctx.path(repository_ctx.attr.cargo_config)
         repository_ctx.symlink(cargo_config, cargo_home_config)
 
+    if repository_ctx.attr.rust_version.startswith(("beta", "nightly")):
+        channel, _, version = repository_ctx.attr.rust_version.partition("/")
+    else:
+        channel = "stable"
+        version = repository_ctx.attr.rust_version
+
     return _rust_get_rust_tools(
         cargo_template = repository_ctx.attr.rust_toolchain_cargo_template,
         rustc_template = repository_ctx.attr.rust_toolchain_rustc_template,
         host_triple = host_triple,
-        version = repository_ctx.attr.rust_version,
+        channel = channel,
+        version = version,
     )
 
 def _cargo_home_path(repository_ctx):
diff --git a/crate_universe/private/crate.bzl b/crate_universe/private/crate.bzl
index caa9091..ef65183 100644
--- a/crate_universe/private/crate.bzl
+++ b/crate_universe/private/crate.bzl
@@ -21,6 +21,8 @@
         default_features = True,
         features = [],
         git = None,
+        branch = None,
+        tag = None,
         rev = None):
     """A constructor for a crate dependency.
 
@@ -34,7 +36,9 @@
         default_features (bool, optional): Maps to the `default-features` flag.
         features (list, optional): A list of features to use for the crate
         git (str, optional): The Git url to use for the crate. Cannot be used with `version`.
-        rev (str, optional): The git revision of the remote crate. Tied with the `git` param.
+        branch (str, optional): The git branch of the remote crate. Tied with the `git` param. Only one of branch, tag or rev may be specified. Specifying `rev` is recommended for fully-reproducible builds.
+        tag (str, optional): The git tag of the remote crate. Tied with the `git` param. Only one of branch, tag or rev may be specified. Specifying `rev` is recommended for fully-reproducible builds.
+        rev (str, optional): The git revision of the remote crate. Tied with the `git` param. Only one of branch, tag or rev may be specified.
 
     Returns:
         string: A json encoded string of all inputs
@@ -45,6 +49,8 @@
         features = features,
         version = version,
         git = git,
+        branch = branch,
+        tag = tag,
         rev = rev,
     ))
 
@@ -78,6 +84,8 @@
         data = None,
         data_glob = None,
         deps = None,
+        gen_binaries = [],
+        disable_pipelining = False,
         gen_build_script = None,
         patch_args = None,
         patch_tool = None,
@@ -90,7 +98,8 @@
     """A collection of extra attributes and settings for a particular crate
 
     Args:
-        version (str, optional): The version or semver-conditions to match with a crate.
+        version (str, optional): The version or semver-conditions to match with a crate. The wildcard `*`
+            matches any version, including prerelease versions.
         additive_build_file_content (str, optional): Extra contents to write to the bottom of generated BUILD files.
         additive_build_file (str, optional): A file containing extra contents to write to the bottom of
             generated BUILD files.
@@ -114,6 +123,9 @@
         data (list, optional): A list of labels to add to a crate's `rust_library::data` attribute.
         data_glob (list, optional): A list of glob patterns to add to a crate's `rust_library::data` attribute.
         deps (list, optional): A list of labels to add to a crate's `rust_library::deps` attribute.
+        gen_binaries (list or bool, optional): As a list, the subset of the crate's bins that should get `rust_binary`
+            targets produced. Or `True` to generate all, `False` to generate none.
+        disable_pipelining (bool, optional): If True, disables pipelining for library targets for this crate.
         gen_build_script (bool, optional): An authorative flag to determine whether or not to produce
             `cargo_build_script` targets for the current crate.
         patch_args (list, optional): The `patch_args` attribute of a Bazel repository rule. See
@@ -159,6 +171,8 @@
             data = data,
             data_glob = data_glob,
             deps = deps,
+            gen_binaries = gen_binaries,
+            disable_pipelining = disable_pipelining,
             gen_build_script = gen_build_script,
             patch_args = patch_args,
             patch_tool = patch_tool,
diff --git a/crate_universe/private/crates_repository.bzl b/crate_universe/private/crates_repository.bzl
index f429108..76019d8 100644
--- a/crate_universe/private/crates_repository.bzl
+++ b/crate_universe/private/crates_repository.bzl
@@ -61,6 +61,7 @@
             generator = generator,
             cargo_lockfile = lockfiles.cargo,
             splicing_manifest = splicing_manifest,
+            config_path = config_path,
             cargo = cargo_path,
             rustc = rustc_path,
         )
@@ -115,7 +116,8 @@
 | `CARGO_BAZEL_GENERATOR_SHA256` | The sha256 checksum of the file located at `CARGO_BAZEL_GENERATOR_URL` |
 | `CARGO_BAZEL_GENERATOR_URL` | The URL of a cargo-bazel binary. This variable takes precedence over attributes and can use `file://` for local paths |
 | `CARGO_BAZEL_ISOLATED` | An authorative flag as to whether or not the `CARGO_HOME` environment variable should be isolated from the host configuration |
-| `CARGO_BAZEL_REPIN` | An indicator that the dependencies represented by the rule should be regenerated. `REPIN` may also be used. See [Repinning / Updating Dependencies](#crates_repository_repinning_updating_dependencies) for more details. |
+| `CARGO_BAZEL_REPIN` | An indicator that the dependencies represented by the rule should be regenerated. `REPIN` may also be used. See [Repinning / Updating Dependencies](#repinning--updating-dependencies) for more details. |
+| `CARGO_BAZEL_REPIN_ONLY` | A comma-delimited allowlist for rules to execute repinning. Can be useful if multiple instances of the repository rule are used in a Bazel workspace, but repinning should be limited to one of them. |
 
 Example:
 
@@ -138,7 +140,7 @@
 
 crates_repository(
     name = "crate_index",
-    annotations = annotations = {
+    annotations = {
         "rand": [crate.annotation(
             default_features = False,
             features = ["small_rng"],
@@ -155,12 +157,10 @@
 The above will create an external repository which contains aliases and macros for accessing
 Rust targets found in the dependency graph defined by the given manifests.
 
-**NOTE**: The `lockfile` must be manually created. The rule unfortunately does not yet create
+**NOTE**: The `cargo_lockfile` and `lockfile` must be manually created. The rule unfortunately does not yet create
 it on its own. When initially setting up this rule, an empty file should be created and then
 populated by repinning dependencies.
 
-<a id="#crates_repository_repinning_updating_dependencies"></a>
-
 ### Repinning / Updating Dependencies
 
 Dependency syncing and updating is done in the repository rule which means it's done during the
@@ -180,11 +180,20 @@
 
 | Value | Cargo command |
 | --- | --- |
-| Any of [`true`, `1`, `yes`, `on`] | `cargo update` |
-| `workspace` | `cargo update --workspace` |
+| Any of [`true`, `1`, `yes`, `on`, `workspace`] | `cargo update --workspace` |
+| Any of [`full`, `eager`, `all`] | `cargo update` |
 | `package_name` | `cargo upgrade --package package_name` |
 | `package_name@1.2.3` | `cargo upgrade --package package_name --precise 1.2.3` |
 
+If the `crates_repository` is used multiple times in the same Bazel workspace (e.g. for multiple independent
+Rust workspaces), it may additionally be useful to use the `CARGO_BAZEL_REPIN_ONLY` environment variable, which
+limits execution of the repinning to one or multiple instances of the `crates_repository` rule via a comma-delimited
+allowlist:
+
+```shell
+CARGO_BAZEL_REPIN=1 CARGO_BAZEL_REPIN_ONLY=crate_index bazel sync --only=crate_index
+```
+
 """,
     implementation = _crates_repository_impl,
     attrs = {
@@ -204,6 +213,13 @@
             ),
             mandatory = True,
         ),
+        "generate_binaries": attr.bool(
+            doc = (
+                "Whether to generate `rust_binary` targets for all the binary crates in every package. " +
+                "By default only the `rust_library` targets are generated."
+            ),
+            default = False,
+        ),
         "generate_build_scripts": attr.bool(
             doc = (
                 "Whether or not to generate " +
@@ -211,6 +227,13 @@
             ),
             default = True,
         ),
+        "generate_target_compatible_with": attr.bool(
+            doc = (
+                "Whether to generate `target_compatible_with` annotations on the generated BUILD files.  This catches a `target_triple` " +
+                "being targeted that isn't declared in `supported_platform_triples."
+            ),
+            default = True,
+        ),
         "generator": attr.string(
             doc = (
                 "The absolute label of a generator. Eg. `@cargo_bazel_bootstrap//:cargo-bazel`. " +
@@ -264,22 +287,22 @@
             doc = (
                 "The template to use for finding the host `cargo` binary. `{version}` (eg. '1.53.0'), " +
                 "`{triple}` (eg. 'x86_64-unknown-linux-gnu'), `{arch}` (eg. 'aarch64'), `{vendor}` (eg. 'unknown'), " +
-                "`{system}` (eg. 'darwin'), `{cfg}` (eg. 'exec'), and `{tool}` (eg. 'rustc.exe') will be replaced in " +
-                "the string if present."
+                "`{system}` (eg. 'darwin'), `{cfg}` (eg. 'exec'), `{channel}` (eg. 'stable'), and `{tool}` (eg. " +
+                "'rustc.exe') will be replaced in the string if present."
             ),
-            default = "@rust_{system}_{arch}__{triple}_tools//:bin/{tool}",
+            default = "@rust_{system}_{arch}__{triple}__{channel}_tools//:bin/{tool}",
         ),
         "rust_toolchain_rustc_template": attr.string(
             doc = (
                 "The template to use for finding the host `rustc` binary. `{version}` (eg. '1.53.0'), " +
                 "`{triple}` (eg. 'x86_64-unknown-linux-gnu'), `{arch}` (eg. 'aarch64'), `{vendor}` (eg. 'unknown'), " +
-                "`{system}` (eg. 'darwin'), `{cfg}` (eg. 'exec'), and `{tool}` (eg. 'cargo.exe') will be replaced in " +
-                "the string if present."
+                "`{system}` (eg. 'darwin'), `{cfg}` (eg. 'exec'), `{channel}` (eg. 'stable'), and `{tool}` (eg. " +
+                "'cargo.exe') will be replaced in the string if present."
             ),
-            default = "@rust_{system}_{arch}__{triple}_tools//:bin/{tool}",
+            default = "@rust_{system}_{arch}__{triple}__{channel}_tools//:bin/{tool}",
         ),
         "rust_version": attr.string(
-            doc = "The version of Rust the currently registered toolchain is using. Eg. `1.56.0`, or `nightly-2021-09-08`",
+            doc = "The version of Rust the currently registered toolchain is using. Eg. `1.56.0`, or `nightly/2021-09-08`",
             default = rust_common.default_version,
         ),
         "splicing_config": attr.string(
diff --git a/crate_universe/private/crates_vendor.bzl b/crate_universe/private/crates_vendor.bzl
index 021ffc3..19fefc3 100644
--- a/crate_universe/private/crates_vendor.bzl
+++ b/crate_universe/private/crates_vendor.bzl
@@ -12,7 +12,13 @@
 if [[ -z "${{BAZEL_REAL:-}}" ]]; then
     BAZEL_REAL="$(which bazel || echo 'bazel')"
 fi
-eval exec env - BAZEL_REAL="${{BAZEL_REAL}}" BUILD_WORKSPACE_DIRECTORY="${{BUILD_WORKSPACE_DIRECTORY}}" {env} \\
+
+# The path needs to be preserved to prevent bazel from starting with different
+# startup options (requiring a restart of bazel).
+# If you provide an empty path, bazel starts itself with
+# --default_system_javabase set to the empty string, but if you provide a path,
+# it may set it to a value (eg. "/usr/local/buildtools/java/jdk11").
+eval exec env - BAZEL_REAL="${{BAZEL_REAL}}" BUILD_WORKSPACE_DIRECTORY="${{BUILD_WORKSPACE_DIRECTORY}}" PATH="${{PATH}}" {env} \\
 "{bin}" {args} "$@"
 """
 
@@ -26,18 +32,17 @@
 
 CARGO_BAZEL_GENERATOR_PATH = "CARGO_BAZEL_GENERATOR_PATH"
 
-def _runfiles_path(path, is_windows):
+def _runfiles_path(file, is_windows):
     if is_windows:
         runtime_pwd_var = "%RUNTIME_PWD%"
     else:
         runtime_pwd_var = "${RUNTIME_PWD}"
-    if path.startswith("../"):
-        return "{}/external/{}".format(runtime_pwd_var, path[len("../"):])
-    return "{}/{}".format(runtime_pwd_var, path)
+
+    return "{}/{}".format(runtime_pwd_var, file.short_path)
 
 def _is_windows(ctx):
     toolchain = ctx.toolchains[Label("@rules_rust//rust:toolchain_type")]
-    return "windows" in toolchain.target_triple
+    return toolchain.target_os == "windows"
 
 def _get_output_package(ctx):
     # Determine output directory
@@ -48,7 +53,7 @@
             ctx.label.package,
             ctx.attr.vendor_path,
         )
-    return output
+    return output.lstrip("/")
 
 def _write_data_file(ctx, name, data):
     file = ctx.actions.declare_file("{}.{}".format(ctx.label.name, name))
@@ -116,19 +121,24 @@
 
     is_windows = _is_windows(ctx)
 
-    args = ["--splicing-manifest", _runfiles_path(manifest.short_path, is_windows)]
+    args = ["--splicing-manifest", _runfiles_path(manifest, is_windows)]
     runfiles = [manifest] + ctx.files.manifests + ([ctx.file.cargo_config] if ctx.attr.cargo_config else [])
     return args, runfiles
 
 def _write_config_file(ctx):
-    rendering_config = dict(json.decode(render_config(
-        regen_command = "bazel run {}".format(
-            ctx.label,
-        ),
-    )))
+    default_render_config = dict(json.decode(render_config()))
+
+    if ctx.attr.render_config:
+        rendering_config = dict(json.decode(ctx.attr.render_config))
+    else:
+        rendering_config = default_render_config
 
     output_pkg = _get_output_package(ctx)
 
+    workspace_name = ctx.workspace_name
+    if ctx.workspace_name == "__main__" or ctx.workspace_name == "_main":
+        workspace_name = ""
+
     if ctx.attr.mode == "local":
         build_file_base_template = "@{}//{}/{{name}}-{{version}}:BUILD.bazel"
         crate_label_template = "//{}/{{name}}-{{version}}:{{target}}".format(
@@ -138,22 +148,37 @@
         build_file_base_template = "@{}//{}:BUILD.{{name}}-{{version}}.bazel"
         crate_label_template = rendering_config["crate_label_template"]
 
-    rendering_config.update({
+    updates = {
         "build_file_template": build_file_base_template.format(
-            ctx.workspace_name,
+            workspace_name,
             output_pkg,
         ),
         "crate_label_template": crate_label_template,
         "crates_module_template": "@{}//{}:{{file}}".format(
-            ctx.workspace_name,
+            workspace_name,
             output_pkg,
         ),
         "vendor_mode": ctx.attr.mode,
-    })
+    }
+
+    for key in updates:
+        if rendering_config[key] != default_render_config[key]:
+            fail("The `crates_vendor.render_config` attribute does not support the `{}` parameter. Please update {} to remove this value.".format(
+                key,
+                ctx.label,
+            ))
+
+    rendering_config.update(updates)
+
+    # Allow users to override the regen command.
+    if "regen_command" not in rendering_config or not rendering_config["regen_command"]:
+        rendering_config.update({"regen_command": "bazel run {}".format(ctx.label)})
 
     config_data = compile_config(
         crate_annotations = ctx.attr.annotations,
+        generate_binaries = ctx.attr.generate_binaries,
         generate_build_scripts = ctx.attr.generate_build_scripts,
+        generate_target_compatible_with = ctx.attr.generate_target_compatible_with,
         cargo_config = None,
         render_config = rendering_config,
         supported_platform_triples = ctx.attr.supported_platform_triples,
@@ -170,7 +195,7 @@
     )
 
     is_windows = _is_windows(ctx)
-    args = ["--config", _runfiles_path(config.short_path, is_windows)]
+    args = ["--config", _runfiles_path(config, is_windows)]
     runfiles = [config] + ctx.files.manifests
     return args, runfiles
 
@@ -179,8 +204,8 @@
     is_windows = _is_windows(ctx)
 
     environ = {
-        "CARGO": _runfiles_path(toolchain.cargo.short_path, is_windows),
-        "RUSTC": _runfiles_path(toolchain.rustc.short_path, is_windows),
+        "CARGO": _runfiles_path(toolchain.cargo, is_windows),
+        "RUSTC": _runfiles_path(toolchain.rustc, is_windows),
     }
 
     args = ["vendor"]
@@ -191,7 +216,7 @@
     if CARGO_BAZEL_GENERATOR_PATH in ctx.var:
         bin_path = ctx.var[CARGO_BAZEL_GENERATOR_PATH]
     elif ctx.executable.cargo_bazel:
-        bin_path = _runfiles_path(ctx.executable.cargo_bazel.short_path, is_windows)
+        bin_path = _runfiles_path(ctx.executable.cargo_bazel, is_windows)
         cargo_bazel_runfiles.append(ctx.executable.cargo_bazel)
     else:
         fail("{} is missing either the `cargo_bazel` attribute or the '{}' action env".format(
@@ -213,16 +238,21 @@
     if ctx.attr.cargo_lockfile:
         args.extend([
             "--cargo-lockfile",
-            _runfiles_path(ctx.file.cargo_lockfile.short_path, is_windows),
+            _runfiles_path(ctx.file.cargo_lockfile, is_windows),
         ])
         cargo_bazel_runfiles.extend([ctx.file.cargo_lockfile])
 
     # Optionally include buildifier
     if ctx.attr.buildifier:
-        args.extend(["--buildifier", _runfiles_path(ctx.executable.buildifier.short_path, is_windows)])
+        args.extend(["--buildifier", _runfiles_path(ctx.executable.buildifier, is_windows)])
         cargo_bazel_runfiles.append(ctx.executable.buildifier)
 
-    # Dtermine platform specific settings
+    # Optionally include an explicit `bazel` path
+    if ctx.attr.bazel:
+        args.extend(["--bazel", _runfiles_path(ctx.executable.bazel, is_windows)])
+        cargo_bazel_runfiles.append(ctx.executable.bazel)
+
+    # Determine platform specific settings
     if is_windows:
         extension = ".bat"
         template = _WINDOWS_WRAPPER
@@ -261,7 +291,7 @@
 rendered `BUILD` files reduce the number of workspace dependencies, allowing for easier loads. This rule
 handles all the same [workflows](#workflows) `crate_universe` rules do.
 
-Example: 
+Example:
 
 Given the following workspace structure:
 
@@ -316,13 +346,13 @@
 ```
 
 Under the hood, `--repin` will trigger a [cargo update](https://doc.rust-lang.org/cargo/commands/cargo-update.html)
-call against the generated workspace. The following table describes how to controll particular values passed to the
+call against the generated workspace. The following table describes how to control particular values passed to the
 `cargo update` command.
 
 | Value | Cargo command |
 | --- | --- |
-| Any of [`true`, `1`, `yes`, `on`] | `cargo update` |
-| `workspace` | `cargo update --workspace` |
+| Any of [`true`, `1`, `yes`, `on`, `workspace`] | `cargo update --workspace` |
+| Any of [`full`, `eager`, `all`] | `cargo update` |
 | `package_name` | `cargo upgrade --package package_name` |
 | `package_name@1.2.3` | `cargo upgrade --package package_name --precise 1.2.3` |
 
@@ -331,10 +361,17 @@
         "annotations": attr.string_list_dict(
             doc = "Extra settings to apply to crates. See [crate.annotation](#crateannotation).",
         ),
+        "bazel": attr.label(
+            doc = "The path to a bazel binary used to locate the output_base for the current workspace.",
+            cfg = "exec",
+            executable = True,
+            allow_files = True,
+        ),
         "buildifier": attr.label(
             doc = "The path to a [buildifier](https://github.com/bazelbuild/buildtools/blob/5.0.1/buildifier/README.md) binary used to format generated BUILD files.",
             cfg = "exec",
             executable = True,
+            allow_files = True,
             default = Label("//crate_universe/private/vendor:buildifier"),
         ),
         "cargo_bazel": attr.label(
@@ -355,6 +392,13 @@
             doc = "The path to an existing `Cargo.lock` file",
             allow_single_file = True,
         ),
+        "generate_binaries": attr.bool(
+            doc = (
+                "Whether to generate `rust_binary` targets for all the binary crates in every package. " +
+                "By default only the `rust_library` targets are generated."
+            ),
+            default = False,
+        ),
         "generate_build_scripts": attr.bool(
             doc = (
                 "Whether or not to generate " +
@@ -362,6 +406,13 @@
             ),
             default = True,
         ),
+        "generate_target_compatible_with": attr.bool(
+            doc = (
+                "Whether to generate `target_compatible_with` annotations on the generated BUILD files.  This catches a `target_triple` " +
+                "being targeted that isn't declared in `supported_platform_triples."
+            ),
+            default = True,
+        ),
         "manifests": attr.label_list(
             doc = "A list of Cargo manifests (`Cargo.toml` files).",
             allow_files = ["Cargo.toml"],
@@ -381,6 +432,12 @@
         "packages": attr.string_dict(
             doc = "A set of crates (packages) specifications to depend on. See [crate.spec](#crate.spec).",
         ),
+        "render_config": attr.string(
+            doc = (
+                "The configuration flags to use for rendering. Use `//crate_universe:defs.bzl\\%render_config` to " +
+                "generate the value for this field. If unset, the defaults defined there will be used."
+            ),
+        ),
         "repository_name": attr.string(
             doc = "The name of the repository to generate for `remote` vendor modes. If unset, the label name will be used",
         ),
diff --git a/crate_universe/private/generate_utils.bzl b/crate_universe/private/generate_utils.bzl
index 469cb22..cd00f21 100644
--- a/crate_universe/private/generate_utils.bzl
+++ b/crate_universe/private/generate_utils.bzl
@@ -1,6 +1,6 @@
 """Utilities directly related to the `generate` step of `cargo-bazel`."""
 
-load(":common_utils.bzl", "CARGO_BAZEL_ISOLATED", "REPIN_ENV_VARS", "cargo_environ", "execute")
+load(":common_utils.bzl", "CARGO_BAZEL_ISOLATED", "REPIN_ALLOWLIST_ENV_VAR", "REPIN_ENV_VARS", "cargo_environ", "execute")
 
 CARGO_BAZEL_GENERATOR_SHA256 = "CARGO_BAZEL_GENERATOR_SHA256"
 CARGO_BAZEL_GENERATOR_URL = "CARGO_BAZEL_GENERATOR_URL"
@@ -11,6 +11,8 @@
 ]
 
 CRATES_REPOSITORY_ENVIRON = GENERATOR_ENV_VARS + REPIN_ENV_VARS + [
+    REPIN_ALLOWLIST_ENV_VAR,
+] + [
     CARGO_BAZEL_ISOLATED,
 ]
 
@@ -207,7 +209,16 @@
 
     return config
 
-def compile_config(crate_annotations, generate_build_scripts, cargo_config, render_config, supported_platform_triples, repository_name, repository_ctx = None):
+def compile_config(
+        crate_annotations,
+        generate_binaries,
+        generate_build_scripts,
+        generate_target_compatible_with,
+        cargo_config,
+        render_config,
+        supported_platform_triples,
+        repository_name,
+        repository_ctx = None):
     """Create a config file for generating crate targets
 
     [cargo_config]: https://doc.rust-lang.org/cargo/reference/config.html
@@ -215,7 +226,9 @@
     Args:
         crate_annotations (dict): Extra settings to apply to crates. See
             `crates_repository.annotations` or `crates_vendor.annotations`.
+        generate_binaries (bool): Whether to generate `rust_binary` targets for all bins.
         generate_build_scripts (bool): Whether or not to globally disable build scripts.
+        generate_target_compatible_with (bool): Whether to emit `target_compatible_with` on generated rules
         cargo_config (str): The optional contents of a [Cargo config][cargo_config].
         render_config (dict): The deserialized dict of the `render_config` function.
         supported_platform_triples (list): A list of platform triples
@@ -246,7 +259,9 @@
         fail("The following annotations use `additive_build_file` which is not supported for {}: {}".format(repository_name, unexpected))
 
     config = struct(
+        generate_binaries = generate_binaries,
         generate_build_scripts = generate_build_scripts,
+        generate_target_compatible_with = generate_target_compatible_with,
         annotations = annotations,
         cargo_config = cargo_config,
         rendering = _update_render_config(
@@ -270,7 +285,9 @@
 
     config = compile_config(
         crate_annotations = repository_ctx.attr.annotations,
+        generate_binaries = repository_ctx.attr.generate_binaries,
         generate_build_scripts = repository_ctx.attr.generate_build_scripts,
+        generate_target_compatible_with = repository_ctx.attr.generate_target_compatible_with,
         cargo_config = _read_cargo_config(repository_ctx),
         render_config = _get_render_config(repository_ctx),
         supported_platform_triples = repository_ctx.attr.supported_platform_triples,
@@ -319,7 +336,13 @@
     # If a repin environment variable is set, always repin
     for var in REPIN_ENV_VARS:
         if var in repository_ctx.os.environ and repository_ctx.os.environ[var].lower() not in ["false", "no", "0", "off"]:
-            return True
+            # If a repin allowlist is present only force repin if name is in list
+            if REPIN_ALLOWLIST_ENV_VAR in repository_ctx.os.environ:
+                indices_to_repin = repository_ctx.os.environ[REPIN_ALLOWLIST_ENV_VAR].split(",")
+                if repository_ctx.name in indices_to_repin:
+                    return True
+            else:
+                return True
 
     # If a deterministic lockfile was not added then always repin
     if not lockfile_path:
@@ -360,13 +383,14 @@
     # flag indicating repinning was requested, an error is raised
     # since repinning should be an explicit action
     if result.stdout.strip().lower() == "repin":
-        # buildifier: disable=print
-        print(result.stderr)
-        fail((
-            "The current `lockfile` is out of date for '{}'. Please re-run " +
-            "bazel using `CARGO_BAZEL_REPIN=true` if this is expected " +
-            "and the lockfile should be updated."
-        ).format(repository_ctx.name))
+        fail(("\n".join([
+            result.stderr,
+            (
+                "The current `lockfile` is out of date for '{}'. Please re-run " +
+                "bazel using `CARGO_BAZEL_REPIN=true` if this is expected " +
+                "and the lockfile should be updated."
+            ).format(repository_ctx.name),
+        ])))
 
     return False
 
diff --git a/crate_universe/private/selects.bzl b/crate_universe/private/selects.bzl
index bcbad19..39fc05d 100644
--- a/crate_universe/private/selects.bzl
+++ b/crate_universe/private/selects.bzl
@@ -1,41 +1,43 @@
-"""A helper module solving for complex select statements in rendered cargo-bazel modules"""
+"""Function for preserving `select` entries for Cargo cfg expressions which did
+not match any enabled target triple / Bazel platform.
 
+For example we might generate:
+
+    rust_library(
+        ...
+        deps = [
+            "//common:unconditional_dep",
+        ] + selects.with_unmapped({
+            "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [
+                "//third-party/rust:windows-sys",  # cfg(windows)
+            ],
+            "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [
+                "//third-party/rust:libc",  # cfg(any(unix, target_os = "wasi"))
+            ],
+            "//conditions:default": [],
+            selects.NO_MATCHING_PLATFORM_TRIPLES: [
+                "//third-party/rust:hermit-abi",  # cfg(target_os = "hermit")
+            ],
+        })
+    )
+"""
+
+_SENTINEL = struct()
+
+def _with_unmapped(configurations):
+    configurations.pop(_SENTINEL)
+    return select(configurations)
+
+selects = struct(
+    with_unmapped = _with_unmapped,
+    NO_MATCHING_PLATFORM_TRIPLES = _SENTINEL,
+)
+
+# TODO: No longer used by the serde_starlark-based renderer. Delete after all
+# BUILD files using it have been regenerated.
+#
+# buildifier: disable=function-docstring
 def select_with_or(input_dict, no_match_error = ""):
-    """Drop-in replacement for `select()` that supports ORed keys.
-
-    This is notably different from [@bazel_skylib//lib:selects.bzl%selects.with_or][swo] in that
-    the input dict must have a list as it's values and they keys will continue to expand for each
-    entry instead of failing on duplicates.
-
-    Example:
-    ```starlark
-    deps = selects.with_or({
-        "//configs:one": [":dep1"],
-        ("//configs:two", "//configs:three"): [":dep2or3"],
-        "//configs:four": [":dep4"],
-        "//conditions:default": [":default"]
-    })
-    ```
-    Key labels may appear at most once anywhere in the input.
-
-    This macro eturns a native `select` that expands `("//configs:two", "//configs:three"): [":dep2or3"]` to
-    ```starlark
-    "//configs:two": [":dep2or3"],
-    "//configs:three": [":dep2or3"],
-    ```
-
-    [swo]: https://github.com/bazelbuild/bazel-skylib/blob/1.1.1/docs/selects_doc.md#selectswith_or
-
-    Args:
-        input_dict: The same dictionary `select()` takes, except keys may take
-            either the usual form `"//foo:config1"` or
-            `("//foo:config1", "//foo:config2", ...)` to signify
-            `//foo:config1` OR `//foo:config2` OR `...`.
-        no_match_error: Optional custom error to report if no condition matches.
-
-    Returns:
-        A native `select()`
-    """
     output_dict = {}
     for (key, value) in input_dict.items():
         if type(key) == type(()):
diff --git a/crate_universe/private/splicing_utils.bzl b/crate_universe/private/splicing_utils.bzl
index f574466..98b9e7c 100644
--- a/crate_universe/private/splicing_utils.bzl
+++ b/crate_universe/private/splicing_utils.bzl
@@ -67,6 +67,15 @@
 
     return dict(splicing_config.items() + splicing_manifest_content.items())
 
+def _no_at_label(label):
+    """Strips leading '@'s for stringified labels in the main repository for backwards-comaptibility reasons."""
+    s = str(label)
+    if s.startswith("@@//"):
+        return s[2:]
+    if s.startswith("@//"):
+        return s[1:]
+    return s
+
 def create_splicing_manifest(repository_ctx):
     """Produce a manifest containing required components for splciing a new Cargo workspace
 
@@ -77,7 +86,7 @@
         path: The path to a json encoded manifest
     """
 
-    manifests = {str(repository_ctx.path(m)): str(m) for m in repository_ctx.attr.manifests}
+    manifests = {str(repository_ctx.path(m)): _no_at_label(m) for m in repository_ctx.attr.manifests}
 
     if repository_ctx.attr.cargo_config:
         cargo_config = str(repository_ctx.path(repository_ctx.attr.cargo_config))
@@ -109,7 +118,7 @@
 
     return splicing_manifest
 
-def splice_workspace_manifest(repository_ctx, generator, cargo_lockfile, splicing_manifest, cargo, rustc):
+def splice_workspace_manifest(repository_ctx, generator, cargo_lockfile, splicing_manifest, config_path, cargo, rustc):
     """Splice together a Cargo workspace from various other manifests and package definitions
 
     Args:
@@ -117,6 +126,7 @@
         generator (path): The `cargo-bazel` binary.
         cargo_lockfile (path): The path to a "Cargo.lock" file.
         splicing_manifest (path): The path to a splicing manifest.
+        config_path: The path to the config file (containing `cargo_bazel::config::Config`.)
         cargo (path): The path to a Cargo binary.
         rustc (path): The Path to a Rustc binary.
 
@@ -136,6 +146,8 @@
         splicing_output_dir,
         "--splicing-manifest",
         splicing_manifest,
+        "--config",
+        config_path,
         "--cargo",
         cargo,
         "--rustc",
diff --git a/crate_universe/private/srcs.bzl b/crate_universe/private/srcs.bzl
index acdfa61..46746d6 100644
--- a/crate_universe/private/srcs.bzl
+++ b/crate_universe/private/srcs.bzl
@@ -3,49 +3,40 @@
 # Each source file is tracked as a target so the `cargo_bootstrap_repository`
 # rule will know to automatically rebuild if any of the sources changed.
 CARGO_BAZEL_SRCS = [
-    "@rules_rust//crate_universe:src/cli.rs",
-    "@rules_rust//crate_universe:src/cli/generate.rs",
-    "@rules_rust//crate_universe:src/cli/query.rs",
-    "@rules_rust//crate_universe:src/cli/splice.rs",
-    "@rules_rust//crate_universe:src/cli/vendor.rs",
-    "@rules_rust//crate_universe:src/config.rs",
-    "@rules_rust//crate_universe:src/context.rs",
-    "@rules_rust//crate_universe:src/context/crate_context.rs",
-    "@rules_rust//crate_universe:src/context/platforms.rs",
-    "@rules_rust//crate_universe:src/lib.rs",
-    "@rules_rust//crate_universe:src/lockfile.rs",
-    "@rules_rust//crate_universe:src/main.rs",
-    "@rules_rust//crate_universe:src/metadata.rs",
-    "@rules_rust//crate_universe:src/metadata/dependency.rs",
-    "@rules_rust//crate_universe:src/metadata/metadata_annotation.rs",
-    "@rules_rust//crate_universe:src/rendering.rs",
-    "@rules_rust//crate_universe:src/rendering/template_engine.rs",
-    "@rules_rust//crate_universe:src/rendering/templates/crate_build_file.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/module_build_file.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/module_bzl.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/crate/aliases.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/crate/binary.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/crate/build_script.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/crate/common_attrs.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/crate/deps.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/crate/library.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/crate/proc_macro.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/header.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/module/aliases_map.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/module/deps_map.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/module/repo_git.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/module/repo_http.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/starlark/glob.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/starlark/selectable_dict.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/partials/starlark/selectable_list.j2",
-    "@rules_rust//crate_universe:src/rendering/templates/vendor_module.j2",
-    "@rules_rust//crate_universe:src/splicing.rs",
-    "@rules_rust//crate_universe:src/splicing/cargo_config.rs",
-    "@rules_rust//crate_universe:src/splicing/splicer.rs",
-    "@rules_rust//crate_universe:src/test.rs",
-    "@rules_rust//crate_universe:src/utils.rs",
-    "@rules_rust//crate_universe:src/utils/starlark.rs",
-    "@rules_rust//crate_universe:src/utils/starlark/glob.rs",
-    "@rules_rust//crate_universe:src/utils/starlark/label.rs",
-    "@rules_rust//crate_universe:src/utils/starlark/select.rs",
+    Label("//crate_universe:src/cli.rs"),
+    Label("//crate_universe:src/cli/generate.rs"),
+    Label("//crate_universe:src/cli/query.rs"),
+    Label("//crate_universe:src/cli/splice.rs"),
+    Label("//crate_universe:src/cli/vendor.rs"),
+    Label("//crate_universe:src/config.rs"),
+    Label("//crate_universe:src/context.rs"),
+    Label("//crate_universe:src/context/crate_context.rs"),
+    Label("//crate_universe:src/context/platforms.rs"),
+    Label("//crate_universe:src/lib.rs"),
+    Label("//crate_universe:src/lockfile.rs"),
+    Label("//crate_universe:src/main.rs"),
+    Label("//crate_universe:src/metadata.rs"),
+    Label("//crate_universe:src/metadata/dependency.rs"),
+    Label("//crate_universe:src/metadata/metadata_annotation.rs"),
+    Label("//crate_universe:src/rendering.rs"),
+    Label("//crate_universe:src/rendering/template_engine.rs"),
+    Label("//crate_universe:src/rendering/templates/module_bzl.j2"),
+    Label("//crate_universe:src/rendering/templates/partials/header.j2"),
+    Label("//crate_universe:src/rendering/templates/partials/module/aliases_map.j2"),
+    Label("//crate_universe:src/rendering/templates/partials/module/deps_map.j2"),
+    Label("//crate_universe:src/rendering/templates/partials/module/repo_git.j2"),
+    Label("//crate_universe:src/rendering/templates/partials/module/repo_http.j2"),
+    Label("//crate_universe:src/rendering/templates/vendor_module.j2"),
+    Label("//crate_universe:src/splicing.rs"),
+    Label("//crate_universe:src/splicing/cargo_config.rs"),
+    Label("//crate_universe:src/splicing/crate_index_lookup.rs"),
+    Label("//crate_universe:src/splicing/splicer.rs"),
+    Label("//crate_universe:src/test.rs"),
+    Label("//crate_universe:src/utils.rs"),
+    Label("//crate_universe:src/utils/starlark.rs"),
+    Label("//crate_universe:src/utils/starlark/glob.rs"),
+    Label("//crate_universe:src/utils/starlark/label.rs"),
+    Label("//crate_universe:src/utils/starlark/select.rs"),
+    Label("//crate_universe:src/utils/starlark/serialize.rs"),
+    Label("//crate_universe:src/utils/starlark/target_compatible_with.rs"),
 ]