Build.rs not able to access crates

I'm trying to use build.rs for running code generation before the main.rs. But I'm not able to use any crates inside build.rs. I get below error(sample)

 2 | use arysn::generator::config::{BelongsToConfig, Config,HasOneConfig, HasManyConfig};
  |     ^^^^^ use of undeclared type or module `arysn`

build.rs can only access external crates under build-dependencies section of Cargo.toml, not the ordinary dependencies. Check Cargo book for further reference.

2 Likes