Merge pull request #3212 from jaredly/cpath

Pass CPATH in to build_c_host_native to fix building the c platform under manual install
This commit is contained in:
Richard Feldman 2022-06-10 17:38:21 -04:00 committed by GitHub
commit a17a6a3147
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -313,6 +313,7 @@ pub fn build_zig_host_wasm32(
pub fn build_c_host_native(
env_path: &str,
env_home: &str,
env_cpath: &str,
dest: &str,
sources: &[&str],
opt_level: OptLevel,
@ -322,6 +323,7 @@ pub fn build_c_host_native(
command
.env_clear()
.env("PATH", &env_path)
.env("CPATH", &env_cpath)
.env("HOME", &env_home)
.args(sources)
.args(&["-o", dest]);
@ -417,6 +419,8 @@ pub fn rebuild_host(
let env_path = env::var("PATH").unwrap_or_else(|_| "".to_string());
let env_home = env::var("HOME").unwrap_or_else(|_| "".to_string());
let env_cpath = env::var("CPATH").unwrap_or_else(|_| "".to_string());
if zig_host_src.exists() {
// Compile host.zig
@ -531,6 +535,7 @@ pub fn rebuild_host(
let output = build_c_host_native(
&env_path,
&env_home,
&env_cpath,
c_host_dest.to_str().unwrap(),
&[c_host_src.to_str().unwrap()],
opt_level,
@ -586,6 +591,7 @@ pub fn rebuild_host(
let output = build_c_host_native(
&env_path,
&env_home,
&env_cpath,
host_dest.to_str().unwrap(),
&[
c_host_src.to_str().unwrap(),
@ -599,6 +605,7 @@ pub fn rebuild_host(
let output = build_c_host_native(
&env_path,
&env_home,
&env_cpath,
c_host_dest.to_str().unwrap(),
&[c_host_src.to_str().unwrap()],
opt_level,
@ -639,6 +646,7 @@ pub fn rebuild_host(
let output = build_c_host_native(
&env_path,
&env_home,
&env_cpath,
host_dest.to_str().unwrap(),
&[c_host_src.to_str().unwrap()],
opt_level,