Skip to content

Commit

Permalink
fix: toolchain overrides were not being resolved (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha authored Nov 26, 2024
1 parent 6eb7c25 commit 5869e01
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/elan/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -235,7 +235,8 @@ impl Cfg {
path: &Path,
) -> Result<Option<(Toolchain, Option<OverrideReason>)>> {
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))))
Expand Down Expand Up @@ -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()? {
Expand Down

0 comments on commit 5869e01

Please sign in to comment.