I encountered a similar problem when I mixed rust + motoko canister an.
At the beginning the project was simple (motoko only has one main.mo file), I add the motoko interface and then rust canister call new motoko interface, dfx deploy successful.
When Motoko canister were complicated ( There are multiple mo files and there is an import relationship), after adding a new interface in rust canister to call motoko canister, and then executing dfx deploy, an error similar to that will occur.
If I only use main.mo.0 (simple) instead of main.mo (complex) in the code repository , it can compile and deploy successfully, and what is even more strange is that complex main.mo can also be compiled and deployed successfully later.
Whenever I add a new function to rust canister and call the motoko canister function, I have two kinds of problems.
I just went through the tutorial with dfx 0.9.2 and it works as expected.
Could you start a fresh new project and follow the tutorial again?
P.S. If you kept "dfx": "0.8.4" in dfx.json, it will actually use the specified version of dfx to build your canister instead of the latest version. I would recommend to copy/paste the final output of dfx.json as described in the tutorial.
All good ! Thanks for the fix ! I don’t know what went wrong, but starting from fresh solved the issue.
PS : I did not have the dfx version in the dfx.json but it still failed.
@lwshang Thanks!
The problem still exists, when multipy_deps has only one mo file, both multiply_deps and rust_deps can be compiled and deployed successfully, but after multiply_deps has multiple mo files, 90% of rust_deps often fail to compile, even if it can be successfully compiled occasionally, when a new method is added to rust_deps , it will also fail.
Do you try to compile and deploy this repo: GitHub - lshoo/rust_deps: DFINITY rust + motoko project?
dfx 0.9.2
windows10 + wsl2 (ubuntu20.04)
Hi @lshoo, currently import doesn’t work for all candid types. When the did file get more complicated, it may trigger the “not implemented” panic.
Could you try didc bind ecdsa.did -t rs , and use the generated rs binding? didc can be found at candid repo. Note that, you will need to get canister id from static env as in cdk-rs/import.rs at main · dfinity/cdk-rs · GitHub.
This issue is on our plate. We are working on improving the developer experience about inter-canister operation.