When parse.expand is enabled, cbindgen invokes Cargo to expand macros in the specified crates. If the dependencies of the crates in question have already been built, Cargo is smart enough to not build them from scratch. However, if the dependencies were only built in release mode, Cargo won't see them as valid build artifacts, and will rebuild everything (using the debug profile) just to do the expansion. If the cargo invocation in cargo_expand.rs allowed passing --release, this extra build could be avoided.