Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cargo_build_script breakage when SYSROOT is specified #976

Merged
merged 4 commits into from
Oct 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cargo/cargo_build_script_runner/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ extern crate cargo_build_script_output_parser;

use cargo_build_script_output_parser::{BuildScriptOutput, CompileAndLinkFlags};
use std::collections::BTreeMap;
use std::ffi::OsString;
use std::env;
use std::fs::{create_dir_all, read_to_string, write};
use std::path::Path;
Expand Down Expand Up @@ -89,7 +90,7 @@ fn run_buildrs() -> Result<(), String> {
}

if let Some(cc_path) = env::var_os("CC") {
let mut cc_path = exec_root.join(cc_path);
let mut cc_path = exec_root.join(cc_path).into_os_string();
if let Some(sysroot_path) = env::var_os("SYSROOT") {
cc_path.push(" --sysroot=");
cc_path.push(&exec_root.join(sysroot_path));
Expand Down