1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

cargo build: skip setup.py if possible

This commit is contained in:
Ryan Dahl 2018-12-20 11:53:56 -05:00
parent 79db3cede2
commit ec76fbccb8

View file

@ -20,9 +20,9 @@ fn main() {
env::var("PROFILE").unwrap()
};
let gn_out_dir = env::current_dir().unwrap();
let gn_out_dir = gn_out_dir.join(format!("target/{}", gn_mode));
let gn_out_dir = normalize_path(gn_out_dir);
let cwd = env::current_dir().unwrap();
let gn_out_path = cwd.join(format!("target/{}", gn_mode));
let gn_out_dir = normalize_path(&gn_out_path);
// Tell Cargo when to re-run this file. We do this first, so these directives
// can take effect even if something goes wrong later in the build process.
@ -76,13 +76,15 @@ fn main() {
}
}
let status = Command::new("python")
.env("DENO_BUILD_PATH", &gn_out_dir)
.env("DENO_BUILD_MODE", &gn_mode)
.arg("./tools/setup.py")
.status()
.expect("setup.py failed");
assert!(status.success());
if !gn_out_path.join("build.ninja").exists() {
let status = Command::new("python")
.env("DENO_BUILD_PATH", &gn_out_dir)
.env("DENO_BUILD_MODE", &gn_mode)
.arg("./tools/setup.py")
.status()
.expect("setup.py failed");
assert!(status.success());
}
let status = Command::new("python")
.env("DENO_BUILD_PATH", &gn_out_dir)