Skip to content

Crate mongodb cannot be compiled using bazel  #1961

Open
@YaxinCheng

Description

@YaxinCheng

Crate 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, unzip, and cd into the project directory
  2. Run CARGO_BAZEL_REPIN=1 bazel sync --only=crate
  3. Run bazel build //src:main

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions