From 81b4f6a76e9caa046d49c5977d7692d58087ee95 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Thu, 2 Jul 2026 11:31:34 -0600 Subject: [PATCH] feat: prefer musl versions for linux when running --update/.update --- src/config/update.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/config/update.rs b/src/config/update.rs index 7ff682a..ce9f514 100644 --- a/src/config/update.rs +++ b/src/config/update.rs @@ -68,6 +68,14 @@ fn normalize_version(requested: Option) -> Option { } } +fn preferred_update_target() -> Option<&'static str> { + match (env::consts::OS, env::consts::ARCH) { + ("linux", "x86_64") => Some("x86_64-unknown-linux-musl"), + ("linux", "aarch64") => Some("aarch64-unknown-linux-musl"), + _ => None, + } +} + fn is_dir_writable(dir: &Path) -> bool { let probe = dir.join(format!(".coyote-update-write-test-{}", process::id())); match OpenOptions::new().write(true).create_new(true).open(&probe) { @@ -147,6 +155,9 @@ pub fn run_self_update(requested: Option, force: bool) -> Result<()> { if let Some(tag) = &target_tag { builder.target_version_tag(tag.as_str()); } + if let Some(target) = preferred_update_target() { + builder.target(target); + } let status = builder .build() .context("Failed to configure the self-update")?