style: format all code to comply with cargo fmt check
This commit is contained in:
@@ -154,7 +154,8 @@ pub async fn prebake(
|
|||||||
.map(|c| c.repology_endpoint)
|
.map(|c| c.repology_endpoint)
|
||||||
.unwrap_or(workshop_engine::RepologyEndpoint::Default);
|
.unwrap_or(workshop_engine::RepologyEndpoint::Default);
|
||||||
|
|
||||||
let pm_name = dependencies.system
|
let pm_name = dependencies
|
||||||
|
.system
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|sys| sys.keys().next().cloned());
|
.and_then(|sys| sys.keys().next().cloned());
|
||||||
|
|
||||||
|
|||||||
@@ -64,4 +64,4 @@ pub enum BootstrapError {
|
|||||||
|
|
||||||
#[error("Invalid bootstrap configuration: {0}")]
|
#[error("Invalid bootstrap configuration: {0}")]
|
||||||
InvalidConfig(String),
|
InvalidConfig(String),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,10 @@ pub async fn bootstrap(
|
|||||||
match BootstrapSource::parse(&raw) {
|
match BootstrapSource::parse(&raw) {
|
||||||
BootstrapSource::Inline(script) => {
|
BootstrapSource::Inline(script) => {
|
||||||
if ctx.dry_run {
|
if ctx.dry_run {
|
||||||
log::info!("[DRY_RUN] User provided inline bootstrap script:\n{}", script);
|
log::info!(
|
||||||
|
"[DRY_RUN] User provided inline bootstrap script:\n{}",
|
||||||
|
script
|
||||||
|
);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
log::debug!("Using inline bootstrap script ({} bytes)", script.len());
|
log::debug!("Using inline bootstrap script ({} bytes)", script.len());
|
||||||
@@ -86,13 +89,16 @@ pub async fn bootstrap(
|
|||||||
// Should support: checksum verification, retry, timeout.
|
// Should support: checksum verification, retry, timeout.
|
||||||
log::info!("Custom bootstrap from URL: {}", url);
|
log::info!("Custom bootstrap from URL: {}", url);
|
||||||
log::info!(" Target: {}", bootstrap_path.display());
|
log::info!(" Target: {}", bootstrap_path.display());
|
||||||
unimplemented!("HTTP bootstrap fetching requires bakerd-level network infrastructure");
|
unimplemented!(
|
||||||
|
"HTTP bootstrap fetching requires bakerd-level network infrastructure"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
BootstrapSource::File(path) => {
|
BootstrapSource::File(path) => {
|
||||||
// Local file copy. This is the simplest case — we can implement
|
// Local file copy. This is the simplest case — we can implement
|
||||||
// this directly without bakerd infrastructure.
|
// this directly without bakerd infrastructure.
|
||||||
log::info!("Custom bootstrap from local file: {}", path);
|
log::info!("Custom bootstrap from local file: {}", path);
|
||||||
tokio::fs::copy(&path, &bootstrap_path).await
|
tokio::fs::copy(&path, &bootstrap_path)
|
||||||
|
.await
|
||||||
.map_err(BootstrapError::IOError)?;
|
.map_err(BootstrapError::IOError)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,7 +172,8 @@ impl BootstrapSource {
|
|||||||
if let Some(name) = raw.strip_prefix("server://") {
|
if let Some(name) = raw.strip_prefix("server://") {
|
||||||
return BootstrapSource::Server(name.to_string());
|
return BootstrapSource::Server(name.to_string());
|
||||||
}
|
}
|
||||||
if let Some(url) = raw.strip_prefix("https://")
|
if let Some(url) = raw
|
||||||
|
.strip_prefix("https://")
|
||||||
.or_else(|| raw.strip_prefix("http://"))
|
.or_else(|| raw.strip_prefix("http://"))
|
||||||
{
|
{
|
||||||
return BootstrapSource::Http(url.to_string());
|
return BootstrapSource::Http(url.to_string());
|
||||||
@@ -325,9 +332,7 @@ fn generate_bootstrap(
|
|||||||
///
|
///
|
||||||
/// Returns `Some(Box<dyn PackageManager>)` if a configured package manager is known,
|
/// Returns `Some(Box<dyn PackageManager>)` if a configured package manager is known,
|
||||||
/// or `None` if no package manager is configured or recognized.
|
/// or `None` if no package manager is configured or recognized.
|
||||||
fn get_package_manager(
|
fn get_package_manager(config: &PrebakeConfig) -> Option<Box<dyn pm::PackageManager>> {
|
||||||
config: &PrebakeConfig,
|
|
||||||
) -> Option<Box<dyn pm::PackageManager>> {
|
|
||||||
config
|
config
|
||||||
.dependencies
|
.dependencies
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ pub trait PackageManager {
|
|||||||
/// Returns the name of the package manager.
|
/// Returns the name of the package manager.
|
||||||
fn name(&self) -> &'static str;
|
fn name(&self) -> &'static str;
|
||||||
|
|
||||||
|
|
||||||
/// Returns the binary name of the package manager.
|
/// Returns the binary name of the package manager.
|
||||||
fn binary(&self) -> &'static str;
|
fn binary(&self) -> &'static str;
|
||||||
|
|
||||||
@@ -24,7 +23,6 @@ pub trait PackageManager {
|
|||||||
/// Generates commands to install the specified packages.
|
/// Generates commands to install the specified packages.
|
||||||
fn install(&self, package: &[String]) -> Vec<Command>;
|
fn install(&self, package: &[String]) -> Vec<Command>;
|
||||||
|
|
||||||
|
|
||||||
/// Generates commands to change the primary mirror repository.
|
/// Generates commands to change the primary mirror repository.
|
||||||
fn change_mirror(&self, repo: &str, osinfo: Option<&Info>) -> Vec<Command>;
|
fn change_mirror(&self, repo: &str, osinfo: Option<&Info>) -> Vec<Command>;
|
||||||
|
|
||||||
@@ -42,7 +40,6 @@ pub fn all_managers() -> Vec<Box<dyn PackageManager>> {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn select(manager: &str) -> Option<Box<dyn PackageManager>> {
|
pub fn select(manager: &str) -> Option<Box<dyn PackageManager>> {
|
||||||
all_managers().into_iter().find(|pm| pm.name() == manager)
|
all_managers().into_iter().find(|pm| pm.name() == manager)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,10 +73,8 @@ impl PackageManager for Apk {
|
|||||||
// Download and trust GPG key if provided
|
// Download and trust GPG key if provided
|
||||||
if let Some(key_url) = &repo_cfg.key_url {
|
if let Some(key_url) = &repo_cfg.key_url {
|
||||||
let mut cmd = Command::new("sh");
|
let mut cmd = Command::new("sh");
|
||||||
cmd.arg("-c").arg(format!(
|
cmd.arg("-c")
|
||||||
"wget -qO- '{}' | apk keys --stdin",
|
.arg(format!("wget -qO- '{}' | apk keys --stdin", key_url));
|
||||||
key_url
|
|
||||||
));
|
|
||||||
cmds.push(cmd);
|
cmds.push(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,10 +85,8 @@ impl PackageManager for Apk {
|
|||||||
format!("{}\n", repo_cfg.url)
|
format!("{}\n", repo_cfg.url)
|
||||||
};
|
};
|
||||||
let mut cmd = Command::new("sh");
|
let mut cmd = Command::new("sh");
|
||||||
cmd.arg("-c").arg(format!(
|
cmd.arg("-c")
|
||||||
"echo '{}' >> /etc/apk/repositories",
|
.arg(format!("echo '{}' >> /etc/apk/repositories", line.trim()));
|
||||||
line.trim()
|
|
||||||
));
|
|
||||||
cmds.push(cmd);
|
cmds.push(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,9 +202,7 @@ mod tests {
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
serde_yaml::Value::String("key_url".to_string()),
|
serde_yaml::Value::String("key_url".to_string()),
|
||||||
serde_yaml::Value::String(
|
serde_yaml::Value::String("https://example.com/alpine-key".to_string()),
|
||||||
"https://example.com/alpine-key".to_string(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
@@ -238,8 +232,7 @@ mod tests {
|
|||||||
(
|
(
|
||||||
serde_yaml::Value::String("url".to_string()),
|
serde_yaml::Value::String("url".to_string()),
|
||||||
serde_yaml::Value::String(
|
serde_yaml::Value::String(
|
||||||
"https://dl-cdn.alpinelinux.org/alpine/v3.19/community"
|
"https://dl-cdn.alpinelinux.org/alpine/v3.19/community".to_string(),
|
||||||
.to_string(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -209,9 +209,7 @@ fn extract_codename(info: Option<&Info>) -> Option<String> {
|
|||||||
|
|
||||||
// 2. Try to infer from version string
|
// 2. Try to infer from version string
|
||||||
match info.version() {
|
match info.version() {
|
||||||
Version::Custom(v)
|
Version::Custom(v) if !v.chars().next().map(|c| c.is_numeric()).unwrap_or(true) => {
|
||||||
if !v.chars().next().map(|c| c.is_numeric()).unwrap_or(true)
|
|
||||||
=> {
|
|
||||||
// Some systems put codename in Custom field
|
// Some systems put codename in Custom field
|
||||||
return Some(v.clone());
|
return Some(v.clone());
|
||||||
}
|
}
|
||||||
@@ -296,9 +294,7 @@ mod tests {
|
|||||||
[
|
[
|
||||||
(
|
(
|
||||||
serde_yaml::Value::String("url".to_string()),
|
serde_yaml::Value::String("url".to_string()),
|
||||||
serde_yaml::Value::String(
|
serde_yaml::Value::String("https://repo.example.com/ubuntu".to_string()),
|
||||||
"https://repo.example.com/ubuntu".to_string(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
serde_yaml::Value::String("distro".to_string()),
|
serde_yaml::Value::String("distro".to_string()),
|
||||||
@@ -340,9 +336,7 @@ mod tests {
|
|||||||
[
|
[
|
||||||
(
|
(
|
||||||
serde_yaml::Value::String("url".to_string()),
|
serde_yaml::Value::String("url".to_string()),
|
||||||
serde_yaml::Value::String(
|
serde_yaml::Value::String("https://repo.example.com/ubuntu".to_string()),
|
||||||
"https://repo.example.com/ubuntu".to_string(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
serde_yaml::Value::String("distro".to_string()),
|
serde_yaml::Value::String("distro".to_string()),
|
||||||
@@ -350,9 +344,7 @@ mod tests {
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
serde_yaml::Value::String("key_url".to_string()),
|
serde_yaml::Value::String("key_url".to_string()),
|
||||||
serde_yaml::Value::String(
|
serde_yaml::Value::String("https://repo.example.com/key.gpg".to_string()),
|
||||||
"https://repo.example.com/key.gpg".to_string(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
@@ -377,8 +369,14 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_sanitize_repo_name() {
|
fn test_sanitize_repo_name() {
|
||||||
assert_eq!(sanitize_repo_name("https://example.com/repo"), "example.com_repo");
|
assert_eq!(
|
||||||
assert_eq!(sanitize_repo_name("http://mirror.tuna.tsinghua.edu.cn/ubuntu"), "mirror.tuna.tsinghua.edu.cn_ubuntu");
|
sanitize_repo_name("https://example.com/repo"),
|
||||||
|
"example.com_repo"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
sanitize_repo_name("http://mirror.tuna.tsinghua.edu.cn/ubuntu"),
|
||||||
|
"mirror.tuna.tsinghua.edu.cn_ubuntu"
|
||||||
|
);
|
||||||
assert_eq!(sanitize_repo_name("ppa:user/name"), "user_name");
|
assert_eq!(sanitize_repo_name("ppa:user/name"), "user_name");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,9 +399,7 @@ mod tests {
|
|||||||
serde_yaml::Value::Mapping(
|
serde_yaml::Value::Mapping(
|
||||||
[(
|
[(
|
||||||
serde_yaml::Value::String("url".to_string()),
|
serde_yaml::Value::String("url".to_string()),
|
||||||
serde_yaml::Value::String(
|
serde_yaml::Value::String("https://repo.example.com/ubuntu".to_string()),
|
||||||
"https://repo.example.com/ubuntu".to_string(),
|
|
||||||
),
|
|
||||||
)]
|
)]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect(),
|
.collect(),
|
||||||
|
|||||||
@@ -96,17 +96,17 @@ impl PackageManager for Dnf {
|
|||||||
|
|
||||||
// Download and import the GPG key
|
// Download and import the GPG key
|
||||||
let mut key_cmd = Command::new("sh");
|
let mut key_cmd = Command::new("sh");
|
||||||
key_cmd.arg("-c").arg(format!(
|
key_cmd.arg("-c").arg(format!("rpm --import '{}'", gpgkey));
|
||||||
"rpm --import '{}'",
|
|
||||||
gpgkey
|
|
||||||
));
|
|
||||||
cmds.push(key_cmd);
|
cmds.push(key_cmd);
|
||||||
} else {
|
} else {
|
||||||
content.push_str("gpgcheck=0\n");
|
content.push_str("gpgcheck=0\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write the .repo file
|
// Write the .repo file
|
||||||
let repo_path = format!("/etc/yum.repos.d/{}.repo", sanitize_repo_name(&repo_cfg.name));
|
let repo_path = format!(
|
||||||
|
"/etc/yum.repos.d/{}.repo",
|
||||||
|
sanitize_repo_name(&repo_cfg.name)
|
||||||
|
);
|
||||||
let mut cmd = Command::new("sh");
|
let mut cmd = Command::new("sh");
|
||||||
cmd.arg("-c").arg(format!(
|
cmd.arg("-c").arg(format!(
|
||||||
"cat > '{}' << 'DNF_EOF'\n{}DNF_EOF",
|
"cat > '{}' << 'DNF_EOF'\n{}DNF_EOF",
|
||||||
@@ -200,9 +200,7 @@ mod tests {
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
serde_yaml::Value::String("baseurl".to_string()),
|
serde_yaml::Value::String("baseurl".to_string()),
|
||||||
serde_yaml::Value::String(
|
serde_yaml::Value::String("https://repo.example.com/fedora".to_string()),
|
||||||
"https://repo.example.com/fedora".to_string(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
@@ -236,15 +234,11 @@ mod tests {
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
serde_yaml::Value::String("baseurl".to_string()),
|
serde_yaml::Value::String("baseurl".to_string()),
|
||||||
serde_yaml::Value::String(
|
serde_yaml::Value::String("https://repo.example.com/fedora".to_string()),
|
||||||
"https://repo.example.com/fedora".to_string(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
serde_yaml::Value::String("gpgkey".to_string()),
|
serde_yaml::Value::String("gpgkey".to_string()),
|
||||||
serde_yaml::Value::String(
|
serde_yaml::Value::String("https://repo.example.com/gpg".to_string()),
|
||||||
"https://repo.example.com/gpg".to_string(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ impl PackageManager for Pacman {
|
|||||||
"pacman"
|
"pacman"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn binary(&self) -> &'static str {
|
fn binary(&self) -> &'static str {
|
||||||
"pacman"
|
"pacman"
|
||||||
}
|
}
|
||||||
@@ -198,7 +197,6 @@ mod tests {
|
|||||||
assert_eq!(pacman.binary(), "pacman");
|
assert_eq!(pacman.binary(), "pacman");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_update_command_contents() {
|
fn test_update_command_contents() {
|
||||||
let cmds = Pacman.update();
|
let cmds = Pacman.update();
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ pub struct DeltaExecutionContext {
|
|||||||
pub timeout: Option<Duration>,
|
pub timeout: Option<Duration>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl Default for ExecutionContext {
|
impl Default for ExecutionContext {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
@@ -47,7 +47,12 @@ pub trait UserPackageManager {
|
|||||||
|
|
||||||
/// Returns a list of all available user package managers.
|
/// Returns a list of all available user package managers.
|
||||||
pub fn all_managers() -> Vec<Box<dyn UserPackageManager>> {
|
pub fn all_managers() -> Vec<Box<dyn UserPackageManager>> {
|
||||||
vec![Box::new(rust::Rust), Box::new(python::Python), Box::new(go::Go), Box::new(custom::Custom)]
|
vec![
|
||||||
|
Box::new(rust::Rust),
|
||||||
|
Box::new(python::Python),
|
||||||
|
Box::new(go::Go),
|
||||||
|
Box::new(custom::Custom),
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Selects a user package manager by name.
|
/// Selects a user package manager by name.
|
||||||
|
|||||||
@@ -84,11 +84,7 @@ impl UserPackageManager for Go {
|
|||||||
for mod_path in &cfg.modules {
|
for mod_path in &cfg.modules {
|
||||||
let dir = mod_path.parent().unwrap_or(mod_path);
|
let dir = mod_path.parent().unwrap_or(mod_path);
|
||||||
let cmd = "go mod download".to_string();
|
let cmd = "go mod download".to_string();
|
||||||
log::info!(
|
log::info!("Go UPM executing: cd {} && {}", dir.display(), cmd);
|
||||||
"Go UPM executing: cd {} && {}",
|
|
||||||
dir.display(),
|
|
||||||
cmd
|
|
||||||
);
|
|
||||||
|
|
||||||
let cd_delta = DeltaExecutionContext {
|
let cd_delta = DeltaExecutionContext {
|
||||||
working_dir: Some(dir.to_path_buf()),
|
working_dir: Some(dir.to_path_buf()),
|
||||||
@@ -166,7 +162,10 @@ env:
|
|||||||
"#;
|
"#;
|
||||||
let cfg: GoConfig = serde_yaml::from_str(yaml).unwrap();
|
let cfg: GoConfig = serde_yaml::from_str(yaml).unwrap();
|
||||||
assert_eq!(cfg.proxy.as_deref(), Some("https://goproxy.cn,direct"));
|
assert_eq!(cfg.proxy.as_deref(), Some("https://goproxy.cn,direct"));
|
||||||
assert_eq!(cfg.packages, vec!["honnef.co/go/tools/cmd/staticcheck@latest"]);
|
assert_eq!(
|
||||||
|
cfg.packages,
|
||||||
|
vec!["honnef.co/go/tools/cmd/staticcheck@latest"]
|
||||||
|
);
|
||||||
assert_eq!(cfg.modules, vec![PathBuf::from("/workspace/server/go.mod")]);
|
assert_eq!(cfg.modules, vec![PathBuf::from("/workspace/server/go.mod")]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
cfg.env_.get("GOMODCACHE").and_then(|v| v.as_deref()),
|
cfg.env_.get("GOMODCACHE").and_then(|v| v.as_deref()),
|
||||||
|
|||||||
@@ -123,8 +123,7 @@ impl UserPackageManager for Python {
|
|||||||
ctx: &ExecutionContext,
|
ctx: &ExecutionContext,
|
||||||
event_tx: &EventSender,
|
event_tx: &EventSender,
|
||||||
) -> Result<(), DependencyError> {
|
) -> Result<(), DependencyError> {
|
||||||
let cfg: PythonConfig =
|
let cfg: PythonConfig = serde_yaml::from_value(config.clone()).map_err(|e| {
|
||||||
serde_yaml::from_value(config.clone()).map_err(|e| {
|
|
||||||
log::error!("Failed to parse user.python config: {}", e);
|
log::error!("Failed to parse user.python config: {}", e);
|
||||||
DependencyError::ParseError()
|
DependencyError::ParseError()
|
||||||
})?;
|
})?;
|
||||||
@@ -152,8 +151,7 @@ impl Python {
|
|||||||
|
|
||||||
// ── 1. venv ──────────────────────────────────────────────
|
// ── 1. venv ──────────────────────────────────────────────
|
||||||
if let Some(ref dir) = action.directory {
|
if let Some(ref dir) = action.directory {
|
||||||
let venv_cmd =
|
let venv_cmd = format!("{} -m venv '{}'", python_bin(action), dir.display());
|
||||||
format!("{} -m venv '{}'", python_bin(action), dir.display());
|
|
||||||
log::info!("Python UPM creating venv: {}", venv_cmd);
|
log::info!("Python UPM creating venv: {}", venv_cmd);
|
||||||
let r = engine
|
let r = engine
|
||||||
.execute_command_with_delta(&venv_cmd, ctx, event_tx, &delta)
|
.execute_command_with_delta(&venv_cmd, ctx, event_tx, &delta)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
use crate::error::DependencyError;
|
||||||
|
use crate::types::{DeltaExecutionContext, Engine, EventSender, ExecutionContext};
|
||||||
|
use crate::upm::UPMSysDeps;
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use crate::error::DependencyError;
|
|
||||||
use crate::types::{DeltaExecutionContext, Engine, EventSender, ExecutionContext};
|
|
||||||
use crate::upm::UPMSysDeps;
|
|
||||||
|
|
||||||
use super::UserPackageManager;
|
use super::UserPackageManager;
|
||||||
|
|
||||||
@@ -67,7 +67,9 @@ struct RustConfig {
|
|||||||
cargo: CargoSubConfig,
|
cargo: CargoSubConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_rust_type() -> String { "rustup".to_string() }
|
fn default_rust_type() -> String {
|
||||||
|
"rustup".to_string()
|
||||||
|
}
|
||||||
|
|
||||||
// ── Cargo sub-config ───────────────────────────────────────────────
|
// ── Cargo sub-config ───────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -134,18 +136,12 @@ impl UserPackageManager for Rust {
|
|||||||
|
|
||||||
// ── 2. rustup component add <comp…> ──────────────────────
|
// ── 2. rustup component add <comp…> ──────────────────────
|
||||||
if !cfg.components.is_empty() {
|
if !cfg.components.is_empty() {
|
||||||
commands.push(format!(
|
commands.push(format!("rustup component add {}", cfg.components.join(" ")));
|
||||||
"rustup component add {}",
|
|
||||||
cfg.components.join(" ")
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── 3. rustup target add <target…> ───────────────────────
|
// ── 3. rustup target add <target…> ───────────────────────
|
||||||
if !cfg.targets.is_empty() {
|
if !cfg.targets.is_empty() {
|
||||||
commands.push(format!(
|
commands.push(format!("rustup target add {}", cfg.targets.join(" ")));
|
||||||
"rustup target add {}",
|
|
||||||
cfg.targets.join(" ")
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── 4. cargo fetch ───────────────────────────────────────
|
// ── 4. cargo fetch ───────────────────────────────────────
|
||||||
@@ -161,11 +157,7 @@ impl UserPackageManager for Rust {
|
|||||||
}
|
}
|
||||||
for manifest in &cargo.manifests {
|
for manifest in &cargo.manifests {
|
||||||
// Host target (no --target)
|
// Host target (no --target)
|
||||||
commands.push(format!(
|
commands.push(format!("{} --manifest-path '{}'", base, manifest.display()));
|
||||||
"{} --manifest-path '{}'",
|
|
||||||
base,
|
|
||||||
manifest.display()
|
|
||||||
));
|
|
||||||
// Cross-compilation targets
|
// Cross-compilation targets
|
||||||
for target in &cfg.targets {
|
for target in &cfg.targets {
|
||||||
commands.push(format!(
|
commands.push(format!(
|
||||||
|
|||||||
Reference in New Issue
Block a user