Having some comple problems with my project layout

.
├── Cargo.lock
├── Cargo.toml
├── src
│   ├── framework
│   │   ├── callrecord.rs
│   │   ├── config.rs
│   │   ├── endpoint_registry.rs
│   │   ├── endpoint_repo.rs
│   │   ├── environment.rs
│   │   ├── framework_defs.rs
│   │   ├── kafka_producer.rs
│   │   ├── mod.rs
│   │   ├── pluginchain_manager.rs
│   │   ├── pluginchain.rs
│   │   ├── publisher_pool.rs
│   │   └── transaction_record.rs
│   ├── lib.rs
│   ├── main.rs
│   └── plugins
│       ├── audio_plugin.rs
│       ├── audiorecord_plugin.rs
│       ├── channelcapture_plugin.rs
│       ├── cloudqueue_plugin.rs
│       ├── condition_plugin.rs
│       ├── counter_plugin.rs
│       ├── dial_plugin.rs
│       ├── dtmf_plugin.rs
│       ├── dtmfv2_plugin.rs
│       ├── endcall_plugin.rs
│       ├── extwebcall_plugin.rs
│       ├── facebook_plugin.rs
│       ├── hangup_plugin.rs
│       ├── ibapi_plugin.rs
│       ├── ibcall_plugin.rs
│       ├── ibfacebook_plugin.rs
│       ├── ibsms_plugin.rs
│       ├── ibwhatsapp_plugin.rs
│       ├── jumpfrom_plugin.rs
│       ├── jumpto_plugin.rs
│       ├── menutree_plugin.rs
│       ├── mod.rs
│       ├── obcall_plugin.rs
│       ├── pausecapture_plugin.rs
│       ├── pause_plugin.rs
│       ├── percentswitch_plugin.rs
│       ├── plugin.rs
│       ├── plugins_defs.rs
│       ├── regex_plugin.rs
│       ├── regexswitch_plugin.rs
│       ├── resumecapture_plugin.rs
│       ├── senddtmf_plugin.rs
│       ├── sentiment_plugin.rs
│       ├── setvariable_plugin.rs
│       ├── sms_plugin.rs
│       ├── speechrecord_plugin.rs
│       ├── stopcapture_plugin.rs
│       ├── switch_plugin.rs
│       ├── tonality_plugin.rs
│       ├── transfer_plugin.rs
│       ├── tts_plugin.rs
│       ├── voicecapture_plugin.rs
│       ├── watsontts_plugin.rs
│       ├── whatsapp_plugin.rs
│       └── wildcard_plugin.rs

Above is my project layout. I originally was using workspaces, separating the framework and plugins directories into their own workspace. But then I ran into some cyclic dependency issues when compiling since these two workspaces were still inter-dependent.

Now I'm trying this with lib.rs having

pub mod framework;
pub mod plugins;

And within each sub-directory a mod.rs file including "pub mod" of each source code file.

It still is having an issue compiling. A framework source including one of the plugin crates gets this. Then changing that to use cpaasd::plugins also fails. cpaasd is the project name, and that error follows the first one below.

error[E0433]: failed to resolve: unresolved import
 --> src/framework/pluginchain.rs:1:12
  |
1 | use crate::plugins::{
  |            ^^^^^^^
  |            |
  |            unresolved import
  |            help: a similar path exists: `cpaasd::plugins`

cpaasd error

error[E0433]: failed to resolve: use of undeclared crate or module `cpaasd`
 --> src/framework/pluginchain.rs:1:5
  |
1 | use cpaasd::plugins::{
  |     ^^^^^^ use of undeclared crate or module `cpaasd`

And here's my Cargo.toml file

[package]
name = "cpaasd"
version = "0.1.0"
edition = "2021"

[lib]
path = "src/lib.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
container = { path = "../container" }
log = "0.4.20"
once_cell = "1.19.0"
serde_json = "1.0.113"
xmltree = "0.10.3"
threadpool = "1.8.1"
tracing = "0.1.40"
tracing-appender = "0.2.3"
tracing-subscriber = { version = "0.3.18", features = ["json"] }
enum-as-inner = "0.6.0"

Hard to say without seeing the rest of the code but seeing that you have both a lib.rs and main.rs, is there any chance you are declaring the same module in both? In other words, can you show us all the mod statements in lib.rs as well as main.rs?