Closed Michael-F-Bryan closed 3 years ago
In https://github.com/hotg-ai/rune/pull/160#pullrequestreview-668065863, @Mi1ind mentioned running into an issue where we'd updated rune-codegen
from using proc_block.with_foo()
to proc_block.set_foo()
for setting proc block parameters (#158).
@Michael-F-Bryan Tried building mobilenet_non_quantized with the proc_block. I am getting the following error when running rune build Runefile:
error[E0599]: no method named `set_count` found for struct `MostConfidentIndices` in the current scope --> lib.rs:23:20 | 23 | most_confident.set_count(3i32); | ^^^^^^^^^ help: there is an associated function with a similar name: `with_count` error[E0599]: no method named `set_labels` found for struct `Label` in the current scope --> lib.rs:25:13 | 25 | label . set_labels (["background" , "tench/Tinca_tinca" , "goldfish/Carassius_auratus" , "great_white_shark/white_shark/man_eater/man... | ^^^^^^^^^^ help: there is an associated function with a similar name: `with_labels` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0599`. error: could not compile `mobilenet_non_quantized` To learn more, run the command again with --verbose. Error: Rune compilation failed Caused by: 0: Compilation failed 1: Compilation failed 2: Cargo exited with a return code of 101
Rune version:
rune 0.2.1 (574b452 2021-05-23)
If we had a way for rune build
to figure out which parameters a proc block has, we would have been able to emit a much better error message.
There is still some work to be done to improve our ProcBlock
custom derive (see #197), but the bulk of this is complete.
At the moment, a proc block is just a normal Rust crate and we use a couple conventions to make sure it is "well formed". These aren't really checked when analysing a Runefile and constructing a pipeline graph, meaning the only way you'll find out that you've written your Runefile incorrectly is when
rustc
spits out an ugly type error.My thoughts are to create a macro which expands to a bunch of functions that can be compiled to WebAssembly and called during
rune build
to discover more about the proc block. Almost like a poor man's reflection mechanism.