From d6f861e7afa08ba366e12108b6bd84d64eb1988c Mon Sep 17 00:00:00 2001 From: figsoda Date: Tue, 17 Feb 2026 13:44:56 -0500 Subject: [PATCH] rust: demote importCargoLock when suggesting builders --- src/main.rs | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/src/main.rs b/src/main.rs index 52e0ec0..8355dbf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -408,38 +408,41 @@ async fn run() -> Result<()> { } (None, rust) => { let mut builders = Vec::new(); - let cargo_vendors = if has_cargo { - match rust { - Some(vendor) => &[vendor] as &[_], - None => &[CargoVendor::FetchCargoVendor, CargoVendor::ImportCargoLock], - } - } else { - &[] - }; - if has_go { builders.push(Builder::BuildGoModule); } - if has_python { - for rust in cargo_vendors.iter().map(Some).chain(Some(None)) { - for application in [true, false] { - builders.push(Builder::BuildPythonPackage { - application, - rust: rust.copied(), - }); - } - } - } - if has_cargo { + let cargo_vendors: &[_] = match rust { + Some(vendor) => &[vendor], + None => &[CargoVendor::FetchCargoVendor, CargoVendor::ImportCargoLock], + }; + for &vendor in cargo_vendors { + if has_python { + for application in [true, false] { + builders.push(Builder::BuildPythonPackage { + application, + rust: Some(vendor), + }); + } + } + let drv = Builder::MkDerivation { rust: Some(vendor) }; let rust = Builder::BuildRustPackage { vendor }; builders.extend(if has_meson { [drv, rust] } else { [rust, drv] }); } } + if has_python { + for application in [true, false] { + builders.push(Builder::BuildPythonPackage { + application, + rust: None, + }); + } + } + builders.push(Builder::MkDerivation { rust: None }); builders.push(Builder::MkDerivationNoCC);