diff --git a/build_extra/rust/run.py b/build_extra/rust/run.py index aa0ad9ab187609..276e799cc3446a 100644 --- a/build_extra/rust/run.py +++ b/build_extra/rust/run.py @@ -1,17 +1,10 @@ #!/usr/bin/env python -# This file just executes its arguments, except that it extracts a special -# argument --env-out-dir so as to pass it to the given command via environmental -# variable. This backflip is to have compatibility with cargo. +# This file just executes its arguments, except that also adds OUT_DIR to the +# environ. This is for compatibility with cargo. import subprocess -import argparse import sys import os -parser = argparse.ArgumentParser() -parser.add_argument("--env-out-dir", dest="env_out_dir") -flags, args_rest = parser.parse_known_args() - -assert os.path.isdir(flags.env_out_dir) -os.environ["OUT_DIR"] = flags.env_out_dir - -sys.exit(subprocess.call(args_rest, env=os.environ)) +os.environ["OUT_DIR"] = os.path.abspath(".") +assert os.path.isdir(os.environ["OUT_DIR"]) +sys.exit(subprocess.call(sys.argv[1:], env=os.environ)) diff --git a/build_extra/rust/rust.gni b/build_extra/rust/rust.gni index 1f00fd6b39a52c..c7ad376d0d1baf 100644 --- a/build_extra/rust/rust.gni +++ b/build_extra/rust/rust.gni @@ -169,8 +169,6 @@ template("rust_crate") { args += [ "rustc", rebase_path(source_root, root_build_dir), - "--env-out-dir", - rebase_path(root_out_dir), "--crate-name=$crate_name", "--crate-type=$crate_type", "--emit=$emit_type,dep-info",