Skip to content

fix: DFX sometimes omits a canister in .env #3834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

# UNRELEASED

# fix: DFX sometimes omits a canister in `.env`

# fix: display error cause of some http-related errors

Some commands that download http resources, for example `dfx extension install`, will
11 changes: 11 additions & 0 deletions src/dfx/src/lib/operations/canister/install_canister.rs
Original file line number Diff line number Diff line change
@@ -253,6 +253,8 @@ The command line value will be used.",
info!(log, "Uploading assets to asset canister...");
post_install_store_assets(canister_info, agent, log).await?;
}

// bad, untested code
if !canister_info.get_post_install().is_empty() {
let config = env.get_config()?;
run_post_install_tasks(
@@ -262,6 +264,15 @@ The command line value will be used.",
pool,
env_file.or_else(|| config.as_ref()?.get_config().output_env_file.as_deref()),
)?;
} else {
if let Some(pool) = pool {
let dependencies = pool
.get_canister_list()
.iter()
.map(|can| can.canister_id())
.collect_vec();
get_and_write_environment_variables(canister_info, &network.name, pool, dependencies.as_slice(), env_file)?;
}
}

Ok(())