Skip to content

Commit

Permalink
Merge branch 'master' into spofford/skip-audit
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity authored Jan 31, 2025
2 parents 9e15a2f + 834f4e2 commit 3d82e20
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### fix: `dfx canister install` and `dfx deploy` with `--no-asset-upgrade` no longer hang indefinitely when wasm is not up to date

### fix: `dfx` downloads `.did` files for remote canisters

### feat: streamlined output during asset synchronization

# 0.25.0
Expand Down
5 changes: 5 additions & 0 deletions e2e/assets/remote/download_did/canister_ids.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hello_backend": {
"ic": "aaaaa-aa"
}
}
25 changes: 25 additions & 0 deletions e2e/assets/remote/download_did/dfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"canisters": {
"hello_backend": {
"main": "main.mo",
"type": "motoko",
"dependencies": [
"internet_identity"
]
},
"internet_identity": {
"type": "custom",
"candid": "https://github.com/dfinity/internet-identity/releases/download/release-2024-12-13/internet_identity.did",
"wasm": "https://github.com/dfinity/internet-identity/releases/download/release-2024-12-13/internet_identity_dev.wasm.gz",
"init_arg": "(opt record { captcha_config = opt record { max_unsolved_captchas= 50:nat64; captcha_trigger = variant {Static = variant {CaptchaDisabled}}}})",
"remote": {
"id": {
"ic": "rdmx6-jaaaa-aaaaa-aaadq-cai"
}
},
"frontend": {}
}
},
"output_env_file": ".env",
"version": 1
}
3 changes: 3 additions & 0 deletions e2e/assets/remote/download_did/main.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import II "canister:internet_identity";

actor {};
6 changes: 6 additions & 0 deletions e2e/tests-dfx/remote.bash
Original file line number Diff line number Diff line change
Expand Up @@ -345,3 +345,9 @@ teardown() {
assert_match "CANISTER_ID_REMOTE: qoctq-giaaa-aaaaa-aaaea-cai"
assert_contains "CANISTER_CANDID_PATH_REMOTE: $(pwd -P)/remotecandid.did"
}

@test "build step downloads dependency .did files" {
install_asset remote/download_did
assert_command dfx build --ic -v
assert_not_contains ".did file for canister 'internet_identity' does not exist"
}
6 changes: 3 additions & 3 deletions src/dfx/src/lib/models/canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ impl CanisterPool {
log: &Logger,
build_config: &BuildConfig,
) -> DfxResult<()> {
self.download(build_config).await?;
self.download().await?;
let outputs = self.build(env, log, build_config)?;

for output in outputs {
Expand All @@ -849,8 +849,8 @@ impl CanisterPool {
Ok(())
}

async fn download(&self, build_config: &BuildConfig) -> DfxResult {
for canister in self.canisters_to_build(build_config) {
async fn download(&self) -> DfxResult {
for canister in self.canisters.iter() {
let info = canister.get_info();

if info.is_custom() {
Expand Down

0 comments on commit 3d82e20

Please sign in to comment.