From 5869e0167a33b5ba0d31f42eb7ed880d93ec684d Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Tue, 26 Nov 2024 10:32:56 +0100 Subject: [PATCH] fix: toolchain overrides were not being resolved (#146) --- src/elan/config.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/elan/config.rs b/src/elan/config.rs index ec92a0b..305cad7 100644 --- a/src/elan/config.rs +++ b/src/elan/config.rs @@ -17,7 +17,7 @@ use toolchain::Toolchain; use toml; -use crate::{gc, lookup_toolchain_desc, lookup_unresolved_toolchain_desc, read_unresolved_toolchain_desc_from_file, UnresolvedToolchainDesc}; +use crate::{gc, lookup_toolchain_desc, lookup_unresolved_toolchain_desc, read_unresolved_toolchain_desc_from_file, resolve_toolchain_desc, UnresolvedToolchainDesc}; #[derive(Debug, Serialize, Clone)] pub enum OverrideReason { @@ -235,7 +235,8 @@ impl Cfg { path: &Path, ) -> Result)>> { if let Some((toolchain, reason)) = self.find_override(path)? { - match self.get_toolchain(&toolchain.0, false) { + let toolchain = resolve_toolchain_desc(&self, &toolchain, false)?; + match self.get_toolchain(&toolchain, false) { Ok(toolchain) => { if toolchain.exists() { Ok(Some((toolchain, Some(reason)))) @@ -281,7 +282,7 @@ impl Cfg { }; Err(e) .chain_err(|| Error::from(reason_err)) - .chain_err(|| ErrorKind::OverrideToolchainNotInstalled(toolchain.0)) + .chain_err(|| ErrorKind::OverrideToolchainNotInstalled(toolchain)) } } } else if let Some(tc) = self.resolve_default()? {