Skip to content

Commit

Permalink
Revert "improvements: if workspace, pass the workspace flag in cargo …
Browse files Browse the repository at this point in the history
…update"

This reverts commit ccfcfd4.
  • Loading branch information
uncomfyhalomacro committed Nov 17, 2024
1 parent ccfcfd4 commit b386b88
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
16 changes: 0 additions & 16 deletions cargo/src/cargo_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ pub fn cargo_vendor(

if is_manifest_workspace {
info!("ℹ️ This manifest is in WORKSPACE configuration.");
default_options.push("--workspace".to_string());
let workspace_has_deps = workspace_has_dependencies(custom_root, &first_manifest)?;
if !workspace_has_deps {
warn!("⚠️ This WORKSPACE MANIFEST does not seem to contain workspace dependencies and dev-dependencies. Please check member dependencies.");
Expand Down Expand Up @@ -211,7 +210,6 @@ pub fn cargo_vendor(

cargo_update(
update,
is_manifest_workspace,
crates,
&first_manifest_parent,
&first_manifest.to_string_lossy(),
Expand Down Expand Up @@ -306,17 +304,13 @@ pub fn cargo_generate_lockfile(curdir: &Path, manifest: &str) -> io::Result<Stri

pub fn cargo_update(
global_update: bool,
is_workspace: bool,
crates: &[String],
curdir: &Path,
manifest: &str,
respect_lockfile: bool,
) -> io::Result<String> {
let mut default_options = vec![];
if global_update {
if is_workspace {
default_options.push("--workspace".to_string());
}
info!("⏫ Updating dependencies...");
let manifest_path = PathBuf::from(&manifest).canonicalize()?;
let manifest_path_parent = manifest_path.parent().unwrap_or(curdir);
Expand All @@ -341,10 +335,6 @@ pub fn cargo_update(
if !crates.is_empty() {
for crate_ in crates.iter() {
let mut new_cur_dir = curdir.to_path_buf();
default_options = Vec::new();
if is_workspace {
default_options.push("--workspace".to_string());
}
if let Some((crate_name, string_tail)) = crate_.split_once("@") {
info!(
"🦀 Applying update for specified crate dependency {}.",
Expand Down Expand Up @@ -527,12 +517,6 @@ pub fn cargo_update(
}
}
}
} else {
info!(
"🥺 Doing best effort update for specified crate dependency {}",
crate_
);
default_options.push(crate_.to_string());
}
cargo_command("update", &default_options, new_cur_dir)
.inspect(|_| {
Expand Down
2 changes: 0 additions & 2 deletions cargo/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pub fn run_cargo_vendor_home_registry(
.canonicalize()?;
cargo_update(
registry.update,
is_workspace,
&registry.update_crate,
&possible_root_manifest_parent,
&possible_root_manifest.to_string_lossy(),
Expand Down Expand Up @@ -113,7 +112,6 @@ pub fn run_cargo_vendor_home_registry(
}
cargo_update(
registry.update,
is_workspace,
&registry.update_crate,
full_manifest_path_parent,
&full_manifest_path.to_string_lossy(),
Expand Down

0 comments on commit b386b88

Please sign in to comment.