From f96b6d927088db90286844a472d45a5ac9d3f3d6 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 24 Apr 2019 13:23:19 +0000 Subject: Kill modify-python-lldb.py Summary: After the last round of cleanups, this script was almost a no-op. The only piece of functionality that remained was the one which tried to make the swig-generated function signatures more pythonic. The "tried" part is important here, as it wasn't doing a really good job and the end result was not valid python nor c (e.g., SetExecutable(SBAttachInfo self, str const * path)). Doing these transformations another way is not possible, as these signatures are generated by swig, and not present in source. However, given that this is the only reason why we need a swig post-process step, and that the current implementation is pretty sub-optimal, this patch simply abandons the signature fixup idea, and chooses to simplify our build process instead. Reviewers: amccarth, jingham, clayborg Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D61000 llvm-svn: 359092 --- lldb/scripts/Python/prepare_binding_Python.py | 47 --------------------------- 1 file changed, 47 deletions(-) (limited to 'lldb/scripts/Python/prepare_binding_Python.py') diff --git a/lldb/scripts/Python/prepare_binding_Python.py b/lldb/scripts/Python/prepare_binding_Python.py index f9da16fb678..31aef6cf8f0 100644 --- a/lldb/scripts/Python/prepare_binding_Python.py +++ b/lldb/scripts/Python/prepare_binding_Python.py @@ -257,48 +257,6 @@ def do_swig_rebuild(options, dependency_file, config_build_dir, settings): sys.exit(-10) -def run_python_script(script_and_args): - """Runs a python script, logging appropriately. - - If the command returns anything non-zero, it is registered as - an error and exits the program. - - @param script_and_args the python script to execute, along with - the command line arguments to pass to it. - """ - command = [sys.executable] + script_and_args - process = subprocess.Popen(command) - script_stdout, script_stderr = process.communicate() - return_code = process.returncode - if return_code != 0: - logging.error("failed to run %r: %r", command, script_stderr) - sys.exit(return_code) - else: - logging.info("ran script %r'", command) - if script_stdout is not None: - logging.info("output: %s", script_stdout) - - -def do_modify_python_lldb(options, config_build_dir): - """Executes the modify-python-lldb.py script. - - @param options the parsed command line arguments - @param config_build_dir the directory where the Python output was created. - """ - script_path = os.path.normcase( - os.path.join( - options.src_root, - "scripts", - "Python", - "modify-python-lldb.py")) - - if not os.path.exists(script_path): - logging.error("failed to find python script: '%s'", script_path) - sys.exit(-11) - - run_python_script([script_path, config_build_dir]) - - def get_python_module_path(options): """Returns the location where the lldb Python module should be placed. @@ -426,11 +384,6 @@ def main(options): # Generate the Python binding with swig. logging.info("Python binding is out of date, regenerating") do_swig_rebuild(options, dependency_file, config_build_dir, settings) - if options.generate_dependency_file: - return - - # Post process the swig-generated file. - do_modify_python_lldb(options, config_build_dir) # This script can be called by another Python script by calling the main() -- cgit v1.2.3