hotg-ai / rune

Rune provides containers to encapsulate and deploy edgeML pipelines and applications
Apache License 2.0
134 stars 15 forks source link

Unable to run runefile-parser tests due to dependency cycle #15

Closed Michael-F-Bryan closed 3 years ago

Michael-F-Bryan commented 3 years ago

When runic_pb_fft::Processor implements the runic_types::proc_block::ProcBlock trait it adds runic_types as a git dependency.

Like any normal trait, when we try to use the Processor's process() method inside runefile-parser tests we get the following compile error:

error[E0599]: no method named `process` found for struct `Processor` in the current scope
  --> runefile-parser/src/lib.rs:38:20
   |
38 |         return fft.process(waveform, map);
   |                    ^^^^^^^
   |
   = help: items from traits can only be used if the trait is in scope
   = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
           `use runic_types::proc_block::ProcBlock;`

Makes sense, we need to pull in the runic_types::proc_block::ProcBlock trait before we can use it... But that doesn't work.

It looks like runic-pb-fft has added runic-types (from the hotg-ai/rune repository) as a git dependency and the runic_types::proc_block::ProcBlock that we use inside runefile-parser comes from ../runic-types. Cargo sees these two as completely different crates, meaning we are importing the wrong ProcBlock.

The two options I see are:

  1. Move runic-pb-fft inside the rune repository so we aren't using git dependencies, or
  2. Move runic-types into its own repository and make both runefile-parser and runic-pb-fft depend on it using git dependencies, probably also pinning the commit (e.g. runic-types = { git = "...", rev = "abcd1234" })
Michael-F-Bryan commented 3 years ago

The runefile-parser has been replaced with the rune-syntax crate, so this is no longer relevant.