Without this, I have been unable to update
https://github.com/dtolnay/cxx to bzlmod. When I run `bazel run
//third-party:vendor` ([this
rule](3c1bcc012f/third-party/BUILD (L3-L11)))
it failed with **"unknown repo 'cargo_bazel.buildifier-linux-amd64'
requested from @@rules_rust~0.35.0"**:
```console
ERROR: no such package '@@[unknown repo 'cargo_bazel.buildifier-linux-amd64' requested from @@rules_rust~0.35.0]//file': The repository '@@[unknown repo 'cargo_bazel.buildifier-linux-amd64' requested from @@rules_rust~0.35.0]' could not be resolved: No repository visible as '@cargo_bazel.buildifier-linux-amd64' from repository '@@rules_rust~0.35.0'
ERROR: ~/.cache/bazel/_bazel_david/ebce1d0721fb68dda9c70c0dd1405803/external/rules_rust~0.35.0/crate_universe/private/vendor/BUILD.bazel:3:27: no such package '@@[unknown repo 'cargo_bazel.buildifier-linux-amd64' requested from @@rules_rust~0.35.0]//file': The repository '@@[unknown repo 'cargo_bazel.buildifier-linux-amd64' requested from @@rules_rust~0.35.0]' could not be resolved: No repository visible as '@cargo_bazel.buildifier-linux-amd64' from repository '@@rules_rust~0.35.0' and referenced by '@@rules_rust~0.35.0//crate_universe/private/vendor:buildifier'
ERROR: Analysis of target '//third-party:vendor' failed; build aborted: Analysis failed
```
After this change, it works. My MODULE.bazel can be seen in
https://github.com/dtolnay/cxx/pull/1294.
This eliminates the annotation introduced by
https://github.com/bazelbuild/rules_rust/pull/2192, because it includes
https://github.com/dtolnay/cxx/pull/1277.
This PR includes handwritten changes to WORKSPACE.bazel followed by the
generated result of running:
- `cd examples/crate_universe/using_cxx`
- `CARGO_BAZEL_REPIN=1 bazel sync --only=using_cxx`
- `CARGO_BAZEL_REPIN=1 bazel sync --only=cxxbridge_cmd_deps`
Tested by running `bazel build ...` in the same directory.