diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-09-15 09:43:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-15 09:43:08 -0500 |
commit | f1da967ef707bbc77f023daf28093201e96e19c5 (patch) | |
tree | 811ffb5a3c052884696f518d2228c26c57467312 | |
parent | 7cc0af37cfcd03b0615a408428b53d221e493570 (diff) | |
parent | fc5fd8853e1e231264fa32acf418849b224f9694 (diff) | |
download | servo-f1da967ef707bbc77f023daf28093201e96e19c5.tar.gz servo-f1da967ef707bbc77f023daf28093201e96e19c5.zip |
Auto merge of #18521 - servo:cargotest, r=nox
Fix running `cargo test -p stylo_test` from repo root
… in order to add it to Rust CI though https://github.com/rust-lang/rust/blob/master/src/tools/cargotest/main.rs
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18521)
<!-- Reviewable:end -->
-rw-r--r-- | components/style/build_gecko.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/components/style/build_gecko.rs b/components/style/build_gecko.rs index 32ec46c1334..caf4601a6ea 100644 --- a/components/style/build_gecko.rs +++ b/components/style/build_gecko.rs @@ -550,7 +550,8 @@ mod bindings { } fn generate_atoms() { - let script = Path::new(file!()).parent().unwrap().join("gecko").join("regen_atoms.py"); + let script = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()) + .join("gecko").join("regen_atoms.py"); println!("cargo:rerun-if-changed={}", script.display()); let status = Command::new(&*PYTHON) .arg(&script) @@ -596,11 +597,12 @@ mod bindings { #[cfg(not(feature = "bindgen"))] mod bindings { - use std::path::Path; + use std::env; + use std::path::PathBuf; use super::common::*; pub fn generate() { - let dir = Path::new(file!()).parent().unwrap().join("gecko/generated"); + let dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()).join("gecko/generated"); println!("cargo:rerun-if-changed={}", dir.display()); copy_dir(&dir, &*OUTDIR_PATH, |path| { println!("cargo:rerun-if-changed={}", path.display()); |