[PATCH] D109833: [Dexter] Mutually exclusive argument group for --builder and --binary
Stephen Tozer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 17 10:44:29 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9c0366274838: [Dexter] Mutually exclusive argument group for --builder and --binary (authored by StephenTozer).
Changed prior to commit:
https://reviews.llvm.org/D109833?vs=372716&id=373280#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109833/new/
https://reviews.llvm.org/D109833
Files:
cross-project-tests/debuginfo-tests/dexter/dex/builder/ParserOptions.py
cross-project-tests/debuginfo-tests/dexter/dex/tools/TestToolBase.py
Index: cross-project-tests/debuginfo-tests/dexter/dex/tools/TestToolBase.py
===================================================================
--- cross-project-tests/debuginfo-tests/dexter/dex/tools/TestToolBase.py
+++ cross-project-tests/debuginfo-tests/dexter/dex/tools/TestToolBase.py
@@ -54,15 +54,11 @@
def handle_options(self, defaults):
options = self.context.options
- # We accept either or both of --binary and --builder.
- if not options.binary and not options.builder:
- raise Error('expected --builder or --binary')
+ if not options.builder and (options.cflags or options.ldflags):
+ warn(self.context, '--cflags and --ldflags will be ignored when not'
+ ' using --builder')
- # --binary overrides --builder
if options.binary:
- if options.builder:
- warn(self.context, "overriding --builder with --binary\n")
-
options.binary = os.path.abspath(options.binary)
if not os.path.isfile(options.binary):
raise Error('<d>could not find binary file</> <r>"{}"</>'
Index: cross-project-tests/debuginfo-tests/dexter/dex/builder/ParserOptions.py
===================================================================
--- cross-project-tests/debuginfo-tests/dexter/dex/builder/ParserOptions.py
+++ cross-project-tests/debuginfo-tests/dexter/dex/builder/ParserOptions.py
@@ -38,11 +38,12 @@
def add_builder_tool_arguments(parser):
- parser.add_argument('--binary',
- metavar="<file>",
- help='provide binary file to override --builder')
+ build_group = parser.add_mutually_exclusive_group(required=True)
+ build_group.add_argument('--binary',
+ metavar="<file>",
+ help='provide binary file instead of --builder')
- parser.add_argument(
+ build_group.add_argument(
'--builder',
type=str,
choices=sorted(_find_build_scripts().keys()),
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109833.373280.patch
Type: text/x-patch
Size: 2061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210917/34437213/attachment.bin>
More information about the llvm-commits
mailing list