I’ve encountered a Rosetta error while attempting to deploy a canister to the local replica. During the build, DFX will pause for about 5 minutes and then eventually return the following:
rosetta error: unexpectedly need to EmulateForward on a synchronous exception x86_rip=0x7fff2017ff6f arm_pc=0x7ffe94440320 num_insts=5 inst_index=3 x86 instruction bytes: 0x56415741e5894855 0x8941505354415541
zsh: trace trap dfx deploy RoutingTable
I’ve checked out the repo, reintroduced the new fixed cyclic dependency, but can’t seem to reproduce the hang and just get a cyclic import error on some of the files:
[nix-shell:~/uNFT-Prototype/src]$ moc --package base ../../motoko-base/src Ext/Route.mo
../../motoko-base/src/Trie.mo:244.37-244.42: warning [M0155], operator may trap for inferred type
Nat
Ext/Route.mo:17.1-17.17: import error [M0003], file Ext/Sub.mo must not depend on itself
[nix-shell:~/uNFT-Prototype/src]$ moc --package base ../../motoko-base/src Ext/Sub.mo
../../motoko-base/src/Trie.mo:244.37-244.42: warning [M0155], operator may trap for inferred type
Nat
Ext/Sub.mo:2.1-2.26: import error [M0003], file Ext/Route.mo must not depend on itself
[nix-shell:~/uNFT-Prototype/src]$ moc --package base ../../motoko-base/src Ext/
Registry.mo Route.mo Services.mo Sub.mo
[nix-shell:~/uNFT-Prototype/src]$ moc --package base ../../motoko-base/src Ext/Services.mo
[nix-shell:~/uNFT-Prototype/src]$ moc --package base ../../motoko-base/src Ext/Registry.mo
Ext/Registry.mo:1.1-1.46: import error [M0009], file "motoko/util/AccountIdentifier/lib.mo" does not exist
Ext/Registry.mo:2.1-2.36: import error [M0009], file "motoko/ext/Core/lib.mo" does not exist
But maybe I’m not trying to build the right code… (or the problem is higher up in dfx somehow).
@claudio@ggreif thank you both for taking the time to follow-up on this.
I was able to recreate the problem. I simply commented out the “Route” type definition in the Sub.mo file and added an import statement for Route.mo. Please see below.
import Bool "mo:base/Bool";
import Text "mo:base/Text";
import Iter "mo:base/Iter";
import Principal "mo:base/Principal";
import Hash "mo:base/Hash";
import Trie "mo:base/Trie";
import TrieSet "mo:base/TrieSet";
import ExtRoute "Route";
module {
public type Route = ExtRoute.Route;
//public type Route = {
// from : Text;
// msg : Nat;
//};
Trying to build again gave me the same Rosetta Error. I am currently running DFX version 0.11.0