From e2878b80a8537ab55a4ee4a00be37d737353bb94 Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Tue, 2 Jun 2020 18:32:47 +0800 Subject: [PATCH] Drop debug output code that writes to source dir cargo publish isn't happy with build.rs modifying source dir, and this piece of code doesn't seem to do anything other than writing the compiler options used to disk. --- sys/build.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/sys/build.rs b/sys/build.rs index 0215afa..161bfd7 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -5,7 +5,7 @@ extern crate pkg_config; extern crate regex; use std::env; -use std::fs::{self, create_dir, symlink_metadata, File}; +use std::fs::{self, File}; use std::io::{self, BufRead, BufReader, Write}; use std::path::{Path, PathBuf}; use std::process::Command; @@ -978,19 +978,6 @@ fn main() { ], ); - let tmp = output().join("tmp"); - if symlink_metadata(&tmp).is_err() { - create_dir(&tmp).expect("Failed to create temporary output dir"); - } - let mut f = File::create(tmp.join(".build")).expect("Filed to create .build"); - let tool = cc::Build::new().get_compiler(); - write!(f, "{}", tool.path().to_string_lossy().into_owned()).expect("failed to write cmd"); - for arg in tool.args() { - write!(f, " {}", arg.to_str().unwrap()).expect("failed to write arg"); - } - for dir in &include_paths { - write!(f, " -I {}", dir.to_string_lossy().into_owned()).expect("failed to write incdir"); - } let clang_includes = include_paths .iter() .map(|include| format!("-I{}", include.to_string_lossy()));