From 782bf692c9395098a00da291ca3055cbd8787a94 Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Thu, 30 Jan 2020 10:29:01 -0800 Subject: [PATCH 1/2] build: upgrade replica to v0.5.0-alpha.0 --- nix/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index e16fa2ddfa..1e5d37e7f2 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -32,9 +32,9 @@ "type": "git" }, "dfinity": { - "ref": "master", + "ref": "v0.5.0-alpha.0", "repo": "ssh://git@github.com/dfinity-lab/dfinity", - "rev": "fab97e01dcb3ad9e81f7c38098969a548e8ad8fd", + "rev": "85aa86a2b2a5fbba63caff11e38c3d157636658c", "type": "git" }, "motoko": { From f6452d5c0aec3963d0d38a9ccf9cbdbcc1e24d3a Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Thu, 30 Jan 2020 15:59:49 -0800 Subject: [PATCH 2/2] fix: build the JavaScript adapter for canisters without frontend --- src/dfx/src/commands/build.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/dfx/src/commands/build.rs b/src/dfx/src/commands/build.rs index 4a660fd512..2f0198c7b2 100644 --- a/src/dfx/src/commands/build.rs +++ b/src/dfx/src/commands/build.rs @@ -370,15 +370,14 @@ fn build_file( }; motoko_compile(cache.as_ref(), ¶ms, &HashMap::new())?; std::fs::copy(&output_idl_path, &idl_file_path)?; - // Generate JS code - if canister_info.has_frontend() { - let output_did_js_path = canister_info.get_output_did_js_path(); - let canister_id = canister_info.get_canister_id().ok_or_else(|| { - DfxError::BuildError(BuildErrorKind::CouldNotReadCanisterId()) - })?; - build_did_js(cache.as_ref(), &output_idl_path, &output_did_js_path)?; - build_canister_js(&canister_id, &canister_info)?; - } + // Generate JS code even if the canister doesn't have a frontend. It might still be + // used by another canister's frontend. + let output_did_js_path = canister_info.get_output_did_js_path(); + let canister_id = canister_info + .get_canister_id() + .ok_or_else(|| DfxError::BuildError(BuildErrorKind::CouldNotReadCanisterId()))?; + build_did_js(cache.as_ref(), &output_idl_path, &output_did_js_path)?; + build_canister_js(&canister_id, &canister_info)?; Ok(()) }