dtolnay / inventory

Typed distributed plugin registration
Apache License 2.0
948 stars 43 forks source link

Behavior in multi-crate projects #50

Open mainrs opened 1 year ago

mainrs commented 1 year ago

Hello!

Is inventory supposed to work when using a multi-crate structure? I sketched out my project structure here: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9da89efa993ce084845d5d7417cac9ae

I use Rust 1.62.1 on Linux. I ran cargo run --release -p cli.

korrat commented 1 year ago

I've had a similar problem with a multi-crate setup. What worked for me was adding extern crate declarations for the plugin crates (IMPL1/IPML2 in your crates) to the consumer (LIB for you).

Does that work?