From 8deb431582276ad851f57a148ad1d4338610f090 Mon Sep 17 00:00:00 2001 From: Claudio Russo Date: Wed, 5 Oct 2022 03:23:26 +0100 Subject: [PATCH] fix: Compute Motoko dependencies in linear (not exponential) time by detecting visited imports (#2647) * add import before descending, to prevent exponential revisting of imports * reorder check * formatting * revert ref * edit changelog --- CHANGELOG.md | 2 ++ src/dfx/src/lib/builders/motoko.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23d1736214..62eecf3cd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ## DFX +### fix: Compute Motoko dependencies in linear (not exponential) time by detecting visited imports. + ### fix(generate): add missing typescript types and fix issues with bindings array in dfx.json ### chore: update Candid UI canister with commit 79d55e7f568aec00e16dd0329926cc7ea8e3a28b diff --git a/src/dfx/src/lib/builders/motoko.rs b/src/dfx/src/lib/builders/motoko.rs index a7921ae0f6..2b250c02f0 100644 --- a/src/dfx/src/lib/builders/motoko.rs +++ b/src/dfx/src/lib/builders/motoko.rs @@ -59,6 +59,8 @@ impl CanisterBuilder for MotokoBuilder { return Ok(()); } + result.insert(MotokoImport::Relative(file.to_path_buf())); + let mut command = cache.get_binary_command("moc")?; let command = command.arg("--print-deps").arg(&file); let output = command