From 1161c5ea0fdeacb3892493621c4c94b1c514f6a7 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Mon, 25 Jul 2022 10:57:56 -0700 Subject: [PATCH 1/3] test: make sure dfx can load dfx.json with a custom canister with no build step --- e2e/assets/custom_canister/dfx.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/e2e/assets/custom_canister/dfx.json b/e2e/assets/custom_canister/dfx.json index 66454e0324..b6f89010f6 100644 --- a/e2e/assets/custom_canister/dfx.json +++ b/e2e/assets/custom_canister/dfx.json @@ -12,6 +12,11 @@ "candid": "main.did", "wasm": "main.wasm", "build": "build.sh" + }, + "custom3": { + "type": "custom", + "candid": "main.did", + "wasm": "main.wasm" } }, "defaults": { From c4ed82cdb47bd6e34b5e59c942561fbac965ac7b Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Mon, 25 Jul 2022 11:46:17 -0700 Subject: [PATCH 2/3] allow default for build field --- src/dfx/src/config/dfinity.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dfx/src/config/dfinity.rs b/src/dfx/src/config/dfinity.rs index 38e0e4eefb..3567eba359 100644 --- a/src/dfx/src/config/dfinity.rs +++ b/src/dfx/src/config/dfinity.rs @@ -776,7 +776,7 @@ impl<'de> Visitor<'de> for PropertiesVisitor { source: source.ok_or_else(|| missing_field("source"))?, }, Some("custom") => CanisterTypeProperties::Custom { - build: build.ok_or_else(|| missing_field("build"))?, + build: build.unwrap_or_default()?, candid: candid.ok_or_else(|| missing_field("candid"))?, wasm: wasm.ok_or_else(|| missing_field("wasm"))?, }, From ab2dfbe164d5437634c4b2d153354c2fdea48363 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Mon, 25 Jul 2022 11:50:17 -0700 Subject: [PATCH 3/3] . --- src/dfx/src/config/dfinity.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dfx/src/config/dfinity.rs b/src/dfx/src/config/dfinity.rs index 3567eba359..226125b55c 100644 --- a/src/dfx/src/config/dfinity.rs +++ b/src/dfx/src/config/dfinity.rs @@ -776,7 +776,7 @@ impl<'de> Visitor<'de> for PropertiesVisitor { source: source.ok_or_else(|| missing_field("source"))?, }, Some("custom") => CanisterTypeProperties::Custom { - build: build.unwrap_or_default()?, + build: build.unwrap_or_default(), candid: candid.ok_or_else(|| missing_field("candid"))?, wasm: wasm.ok_or_else(|| missing_field("wasm"))?, },