From 3c443e683e93b711e5bd52f06ca16d9014d2ebd8 Mon Sep 17 00:00:00 2001 From: Dmitry Stepanov Date: Mon, 6 Jan 2025 16:07:20 +0300 Subject: [PATCH] force run `cargo update` in the project manager before running a project --- project-manager/src/manager.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/project-manager/src/manager.rs b/project-manager/src/manager.rs index e0817d415..93f844cb2 100644 --- a/project-manager/src/manager.rs +++ b/project-manager/src/manager.rs @@ -1031,6 +1031,17 @@ impl ProjectManager { build_profile: &BuildProfile, ui: &mut UserInterface, ) { + let mut build_profile = build_profile.clone(); + // Force run `cargo update` before running the project to prevent various issues with + // dependency versions incompatibility. + build_profile.build_commands.insert( + 0, + CommandDescriptor { + command: "cargo".to_string(), + args: vec!["update".to_string()], + environment_variables: vec![], + }, + ); self.run_selected_project_command(name, build_profile.build_and_run_queue(), ui); }