Enable argument files in build.py. (#10040)

This commit is contained in:
Edward Chen 2021-12-15 08:22:15 -08:00 committed by GitHub
parent 20f8a06f1f
commit 6cdab06255
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,9 +125,14 @@ def _openvino_verify_device_type(device_read):
def parse_arguments():
parser = argparse.ArgumentParser(
class Parser(argparse.ArgumentParser):
# override argument file line parsing behavior - allow multiple arguments per line and handle quotes
def convert_arg_line_to_args(self, arg_line):
return shlex.split(arg_line)
parser = Parser(
description="ONNXRuntime CI build driver.",
usage=""" # noqa
usage="""
Default behavior is --update --build --test for native architecture builds.
Default behavior is --update --build for cross-compiled builds.
@ -136,7 +141,10 @@ def parse_arguments():
The Test phase will run all unit tests, and optionally the ONNX tests.
Use the individual flags to only run the specified stages.
""")
""",
# files containing arguments can be specified on the command line with "@<filename>" and the arguments within
# will be included at that point
fromfile_prefix_chars="@")
# Main arguments
parser.add_argument(
"--build_dir", required=True, help="Path to the build directory.")