From f893164f0aae6cbc20f7fae1289cf837268fba21 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Thu, 2 Jan 2020 15:39:35 -0500 Subject: [PATCH] resolve relative paths against PATH during packaging Fixes #389. --- src/compiler/c.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/c.rs b/src/compiler/c.rs index 111110f53..e716df6c4 100644 --- a/src/compiler/c.rs +++ b/src/compiler/c.rs @@ -36,6 +36,7 @@ use std::hash::Hash; use std::io; use std::path::{Path, PathBuf}; use std::process; +use which::which; use crate::errors::*; @@ -544,12 +545,13 @@ impl pkg::ToolchainPackager for CToolchainPackager { output.stdout.pop(); } - // Create our PathBuf from the raw bytes, and return if absolute. + // Create our PathBuf from the raw bytes. Assume that relative + // paths can be found via PATH. let path: PathBuf = OsString::from_vec(output.stdout).into(); if path.is_absolute() { Some(path) } else { - None + which(path).ok() } };