Hey everyone. I’ve encountered an issue recently where the dev (debug) build of a Rust + Forc project works, but the release build (forc build --release && cargo build --release) fails to compile. To provide a bit more details, the issue is in the abigen! macro mostly. In debug, it generates ABI properly, but in the release build I get this:
error: proc macro panicked
--> src/orderbook_utils.rs:17:1
|
17 | / abigen!(Contract(
18 | | name = "OrderbookContract",
19 | | abi = "contract/out/debug/orderbook-abi.json"
20 | | ));
| |__^
|
= help: message: failed to parse JSON ABI from string: "failed to read artifact JSON file with path /home/raven/gitproj/complabs/spark-matcher-rs/contract/out/debug/orderbook-abi.json No such file or directory (os error 2)"
error[E0432]: unresolved import `self::abigen_bindings`
--> src/orderbook_utils.rs:15:11
|
15 | use self::abigen_bindings::orderbook_contract_mod;
| ^^^^^^^^^^^^^^^ could not find `abigen_bindings` in `self`
error[E0412]: cannot find type `OrderbookContract` in this scope
--> src/orderbook_utils.rs:23:19
Let me know what else I can provide in terms of info to help you investigate this.