From 09a8300e108f60c6e38bdc3ce53d34533c6bbcde Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Mon, 30 Sep 2019 02:18:50 -0700 Subject: [PATCH 1/2] Add a default for JS_ENGINES Since we are guaranteed that `NODE_JS` is part of the config (since all users need this) we can set a sensible default for `JS_ENGINES`. This default was supposed to be part of #9469, but a bug meant the code was dead and it was removed in #9499. `JS_ENGINES` is needed for any users that want to run test code. Fix `gen_struct_info.py` to explicitly use NODE_JS since this is the only engine we expect users to have installed and the only one we officially support outside of test code. --- tools/gen_struct_info.py | 2 +- tools/shared.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/gen_struct_info.py b/tools/gen_struct_info.py index 29ad77585dd77..d91e1f36da1e6 100755 --- a/tools/gen_struct_info.py +++ b/tools/gen_struct_info.py @@ -417,7 +417,7 @@ def inspect_code(headers, cpp_opts, structs, defines): # Run the compiled program. show('Calling generated program...') try: - info = shared.run_js(js_file[1]).splitlines() + info = shared.run_js(js_file[1], shared.NODE_JS).splitlines() except subprocess.CalledProcessError: sys.stderr.write('FAIL: Running the generated program failed!\n') sys.exit(1) diff --git a/tools/shared.py b/tools/shared.py index 690761addd37b..20bf003d285e0 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -891,6 +891,9 @@ def apply_configuration(): apply_configuration() # EM_CONFIG stuff +if not JS_ENGINES: + JS_ENGINES = [NODE_JS] + if CLOSURE_COMPILER is None: CLOSURE_COMPILER = path_from_root('third_party', 'closure-compiler', 'compiler.jar') From 71372a519ea2319e85593dbc5e2d4322a8ffd560 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Tue, 8 Oct 2019 09:44:52 -0700 Subject: [PATCH 2/2] revert --- tools/gen_struct_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gen_struct_info.py b/tools/gen_struct_info.py index d91e1f36da1e6..29ad77585dd77 100755 --- a/tools/gen_struct_info.py +++ b/tools/gen_struct_info.py @@ -417,7 +417,7 @@ def inspect_code(headers, cpp_opts, structs, defines): # Run the compiled program. show('Calling generated program...') try: - info = shared.run_js(js_file[1], shared.NODE_JS).splitlines() + info = shared.run_js(js_file[1]).splitlines() except subprocess.CalledProcessError: sys.stderr.write('FAIL: Running the generated program failed!\n') sys.exit(1)