From 4632609a1ce9814f7afe31d89a9e660925123751 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 21 Sep 2023 10:10:52 +0800 Subject: [PATCH 1/2] build: set default value of --with-antlr3 option so we don't need to check if this option is specified. this option will also be used even after switching to CMake. Refs #15379 Signed-off-by: Kefu Chai --- configure.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/configure.py b/configure.py index eedc6ba267..8f6cede7fd 100755 --- a/configure.py +++ b/configure.py @@ -681,7 +681,7 @@ arg_parser.add_argument('--enable-alloc-failure-injector', dest='alloc_failure_i help='enable allocation failure injection') arg_parser.add_argument('--enable-seastar-debug-allocations', dest='seastar_debug_allocations', action='store_true', default=False, help='enable seastar debug allocations') -arg_parser.add_argument('--with-antlr3', dest='antlr3_exec', action='store', default=None, +arg_parser.add_argument('--with-antlr3', dest='antlr3_exec', action='store', default="antlr3", help='path to antlr3 executable') arg_parser.add_argument('--with-ragel', dest='ragel_exec', action='store', default='ragel', help='path to ragel executable') @@ -1793,11 +1793,6 @@ else: os.makedirs(outdir, exist_ok=True) -if args.antlr3_exec: - antlr3_exec = args.antlr3_exec -else: - antlr3_exec = "antlr3" - if args.ragel_exec: ragel_exec = args.ragel_exec else: @@ -1946,7 +1941,7 @@ with open(buildfile, 'w') as f: command = CARGO_BUILD_DEP_INFO_BASEDIR='.' cargo build --locked --manifest-path=rust/Cargo.toml --target-dir=$builddir/{mode} --profile=rust-{mode} $ && touch $out description = RUST_LIB $out - ''').format(mode=mode, antlr3_exec=antlr3_exec, fmt_lib=fmt_lib, test_repeat=test_repeat, test_timeout=test_timeout, **modeval)) + ''').format(mode=mode, antlr3_exec=args.antlr3_exec, fmt_lib=fmt_lib, test_repeat=test_repeat, test_timeout=test_timeout, **modeval)) f.write( 'build {mode}-build: phony {artifacts} {wasms}\n'.format( mode=mode, From f3d6e912879c4c64e2e8f3668150b4762a12731e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 21 Sep 2023 10:16:07 +0800 Subject: [PATCH 2/2] build: do not check for args.ragel_exec args.ragel_exec defaults to "ragel" already, so unless user specifies an empty ragel using `--with-ragel=""`, we won't have an `args.ragel_exec` which evaluates to `False`, so drop this check. Refs #15379 Signed-off-by: Kefu Chai --- configure.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/configure.py b/configure.py index 8f6cede7fd..080d2afe98 100755 --- a/configure.py +++ b/configure.py @@ -1793,10 +1793,7 @@ else: os.makedirs(outdir, exist_ok=True) -if args.ragel_exec: - ragel_exec = args.ragel_exec -else: - ragel_exec = "ragel" +ragel_exec = args.ragel_exec with open(buildfile, 'w') as f: f.write(textwrap.dedent('''\