From d2c299a6c79386fe91f3930914d1d3e7162112a3 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 30 Sep 2019 11:20:41 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20rely=20on=20`$CARGO=5FTARGET=5F?= =?UTF-8?q?DIR`=20in=20build=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/script/build.rs | 2 -- components/script/dom/bindings/codegen/run.py | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/components/script/build.rs b/components/script/build.rs index 2699c533c6a..ea2e756490b 100644 --- a/components/script/build.rs +++ b/components/script/build.rs @@ -17,13 +17,11 @@ fn main() { let style_out_dir = PathBuf::from(env::var_os("DEP_SERVO_STYLE_CRATE_OUT_DIR").unwrap()); let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); - let target_dir = PathBuf::from(env::var_os("CARGO_TARGET_DIR").unwrap()); let status = Command::new(find_python()) .arg("dom/bindings/codegen/run.py") .arg(style_out_dir.join("css-properties.json")) .arg(&out_dir) - .arg(target_dir.join("doc").join("servo")) .status() .unwrap(); if !status.success() { diff --git a/components/script/dom/bindings/codegen/run.py b/components/script/dom/bindings/codegen/run.py index fd43ac32bb7..130d35e5268 100644 --- a/components/script/dom/bindings/codegen/run.py +++ b/components/script/dom/bindings/codegen/run.py @@ -11,7 +11,8 @@ def main(): os.chdir(os.path.join(os.path.dirname(__file__))) sys.path[0:0] = ["./parser", "./ply"] - css_properties_json, out_dir, doc_servo = sys.argv[1:] + css_properties_json, out_dir = sys.argv[1:] + doc_servo = "../../../../../target/doc/servo" webidls_dir = "../../webidls" config_file = "Bindings.conf" @@ -19,7 +20,7 @@ def main(): from Configuration import Configuration from CodegenRust import CGBindingRoot - parser = WebIDL.Parser(make_dir(out_dir, "cache")) + parser = WebIDL.Parser(make_dir(os.path.join(out_dir, "cache"))) webidls = [name for name in os.listdir(webidls_dir) if name.endswith(".webidl")] for webidl in webidls: filename = os.path.join(webidls_dir, webidl) @@ -29,7 +30,7 @@ def main(): add_css_properties_attributes(css_properties_json, parser) parser_results = parser.finish() config = Configuration(config_file, parser_results) - make_dir(out_dir, "Bindings") + make_dir(os.path.join(out_dir, "Bindings")) for name, filename in [ ("PrototypeList", "PrototypeList.rs"), @@ -54,8 +55,7 @@ def main(): f.write(module) -def make_dir(out_dir, nested=""): - path = os.path.join(out_dir, nested) +def make_dir(path): if not os.path.exists(path): os.makedirs(path) return path