Skip to content

Behavior in multi-crate projects #50

Open

Description

@mainrs

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.

Activity

  1. korrat commented on Dec 22, 2022

    @korrat

    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?

  2. mrchantey commented on Dec 26, 2024

    @mrchantey

    extern crate did not work for me, my workaround is to do the collecting seperately in each crate.

  3. rlabrecque commented on Sep 2, 2025

    @rlabrecque

    Ran into this as well. Just having use IMPL1/2; in the equivalent of CLI solved it, something like this should work:

    https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=ba8d7419eea633650a285e5e5ec7f3d3

    But after reading other threads for a while, it doesn't seem like this really should be necessary?
    For example this issue seems to be a dupe of maybe both of these: which are marked closed + fixed: #7 #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions