Unresolved imports in workspace member

⚓ Rust    📅 2026-02-21    👤 surdeus    👁️ 1      

surdeus

Hi, folks!

I have created a few Rust projects, but this is the first time I've tried to use a workspace, and I'm having a problem with dependencies. I'm sure I must be missing something really basic ...

The directory structure of my project looks like this:

.
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── ocap/
│   ├── Cargo.toml
│   └── src/
│       └── main.rs
├── omega-store/
│   ├── Cargo.toml
│   └── src/
│       ├── card.rs
│       ├── database.rs
│       ├── lib.rs
│       ├── metadata.rs
│       ├── sql_queries.rs
│       └── util.rs
└── otm/
    ├── Cargo.toml
    └── src/
        └── main.rs

ocap and otm are binary crates, which don't yet contain any significant code. omega-store is a library crate, and is what I'm currently working on.

[ROOT]/Cargo.toml:

[workspace]
members = ["ocap", "otm", "omega-store"]
default-members = ["ocap", "otm", "omega-store"]
resolver = "3"

[workspace.package]
version = "0.1.0"
edition = "2024"
authors = ["Caelia R. Chapin <some@email.address>"]
license = "GPL-3.0"

[workspace.dependencies]
chrono = "0.4"
anyhow = "1.0"
configura = "1.1"

omega-store/Cargo.toml:

[package]
name = "omega-store"
version.workspace = true
authors.workspace = true
license.workspace = true

[dependencies]
rusqlite = "0.38"
blake3 = "1.8"
chrono.workspace = true
anyhow.workspace = true

But when I run cargo check, with or without the --workspace flag, in either the project root or the omega-store directory, I get a number of errors like:

error[E0432]: unresolved import `blake3`
 --> omega-store/src/util.rs:5:5
  |
5 | use blake3::hash as b3hash;
  |     ^^^^^^ use of unresolved module or unlinked crate `blake3`

It appears that cargo is failing to find all of my external dependencies. What am I doing wrong?

3 posts - 2 participants

Read full topic

🏷️ Rust_feed