@@ -59,13 +59,10 @@ fn get_imports(cache: &dyn Cache, info: &CanisterInfo, imports: &mut ImportsTrac
59
59
let parent = if let Some ( top) = top {
60
60
MotokoImport :: Canister ( top. get_name ( ) . to_string ( ) ) // a little inefficient
61
61
} else {
62
+ println ! ( "FILE: {}" , file. to_path_buf( ) . to_str( ) . unwrap( ) ) ;
62
63
MotokoImport :: Relative ( file. to_path_buf ( ) )
63
64
} ;
64
- if imports. nodes . contains_key ( & parent) {
65
- return Ok ( ( ) ) ;
66
- }
67
- let parent_node_index = * imports. nodes . entry ( parent. clone ( ) ) . or_insert_with ( || imports. graph . add_node ( parent. clone ( ) ) ) ;
68
- imports. nodes . insert ( parent. clone ( ) , parent_node_index) ;
65
+ imports. nodes . entry ( parent. clone ( ) ) . or_insert_with ( || imports. graph . add_node ( parent. clone ( ) ) ) ;
69
66
70
67
let mut command = cache. get_binary_command ( "moc" ) ?;
71
68
let command = command. arg ( "--print-deps" ) . arg ( file) ;
@@ -200,10 +197,13 @@ impl CanisterBuilder for MotokoBuilder {
200
197
if let Ok ( wasm_file_metadata) = metadata ( output_wasm_path) {
201
198
let wasm_file_time = wasm_file_metadata. modified ( ) ?;
202
199
let mut imports = pool. imports . borrow_mut ( ) ;
200
+ println ! ( "NODES: {:?}" , imports. nodes) ;
201
+ println ! ( "NAME: {}" , canister_info. get_name( ) . to_string( ) ) ;
203
202
// TODO: ineffective to_string()
204
203
let start = if let Some ( node_index) = imports. nodes . get ( & MotokoImport :: Canister ( canister_info. get_name ( ) . to_string ( ) ) ) {
205
- * node_index
204
+ * node_index
206
205
} else {
206
+ println ! ( "XILE: {}" , motoko_info. get_main_path( ) . to_str( ) . unwrap( ) ) ;
207
207
let node = MotokoImport :: Relative ( motoko_info. get_main_path ( ) . to_path_buf ( ) ) ;
208
208
let node_index = imports. graph . add_node ( node. clone ( ) ) ;
209
209
imports. nodes . insert ( node, node_index) ;
0 commit comments