bazelbuild / bazelbuild/rules_rust
Crate `mongodb` cannot be compiled using bazel
- Dominant language
- Starlark
- Stars
- 843
- Forks
- 651
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
Crate [mongodb](https://crates.io/crates/mongodb) cannot be compiled with the following error message, while cargo compiles it fine:
```
ERROR: /private/var/tmp/_bazel_cheng/3300dddb442501c4c0a49ee86c897909/external/crate__bson-2.6.1/BUILD.bazel:20:13: Compiling Rust rlib bson v2.6.1 (39 files) failed: (Exit 1): process_wrapper failed: error executing command (from target @crate__bson-2.6.1//:bson) bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/rules_rust/util/process_wrapper/process_wrapper --arg-file ... (remaining 73 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
error[E0433]: failed to resolve: use of undeclared crate or module `uuid`
--> external/crate__bson-2.6.1/src/uuid/mod.rs:174:11
|
174 | uuid: uuid::Uuid,
| ^^^^ use of undeclared crate or module `uuid`
...
```
Bazel version: `bazel 6.1.1-homebrew`
OS version: `macOS 13.3.1 (a) (22E772610a)`
Rustc version: `rustc 1.68.0 (2c8cc3432 2023-03-06)`
Chip: `Apple Silicon M2`
Mongodb crate version: `2`
## How to reproduce
1. Download the package: [bazel_test.zip](https://github.com/bazelbuild/rules_rust/files/11413917/bazel_test.zip), unzip, and cd into the project directory
2. Run `CARGO_BAZEL_REPIN=1 bazel sync --only=crate`
3. Run `bazel build //src:main`
Contributor guide
Assessment
This issue has not been assessed yet.