diff options
author | Zachary Turner <zturner@google.com> | 2015-11-30 22:31:24 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-11-30 22:31:24 +0000 |
commit | 6f12d3335d03f7e5db35f8af482e9d71840da601 (patch) | |
tree | 51b711db45c826b677846163e4c5fa1a2e770c34 /lldb/scripts/swig_bot_lib/server.py | |
parent | 24a95f852d3664a0b397cd6cedeee5a0bd01d8dc (diff) | |
download | bcm5719-llvm-6f12d3335d03f7e5db35f8af482e9d71840da601.tar.gz bcm5719-llvm-6f12d3335d03f7e5db35f8af482e9d71840da601.zip |
Unpack the output on the client, completing the cycle.
llvm-svn: 254341
Diffstat (limited to 'lldb/scripts/swig_bot_lib/server.py')
-rw-r--r-- | lldb/scripts/swig_bot_lib/server.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lldb/scripts/swig_bot_lib/server.py b/lldb/scripts/swig_bot_lib/server.py index b7f14cfd599..f83e0be44a5 100644 --- a/lldb/scripts/swig_bot_lib/server.py +++ b/lldb/scripts/swig_bot_lib/server.py @@ -81,7 +81,13 @@ def accept_once(sock, options): pack_location = None try: - pack_location = local.unpack_archive("swig-bot", data) + tempfolder = os.path.join(tempfile.gettempdir(), "swig-bot") + os.makedirs(tempfolder, exist_ok=True) + + pack_location = tempfile.mkdtemp(dir=tempfolder) + logging.debug("Extracting archive to {}".format(pack_location)) + + local.unpack_archive(pack_location, data) logging.debug("Successfully unpacked archive...") config_file = os.path.normpath(os.path.join(pack_location, @@ -98,12 +104,16 @@ def accept_once(sock, options): .format(config.languages, config.swig_executable, config.src_root, config.target_dir)) - local.generate(config) - logging.debug("Finished running swig. Packaging up output") + status = local.generate(config) + logging.debug("Finished running swig. Packaging up files {}" + .format(os.listdir(config.target_dir))) zip_data = io.BytesIO() - zip_file = local.pack_archive(zip_data, - config.target_dir, - [(".", None)]) + zip_file = local.pack_archive(zip_data, config.target_dir, None) + response_status = remote.serialize_response_status(status) + logging.debug("Sending response status {}".format(response_status)) + logging.info("(swig output) -> swig_output.json") + zip_file.writestr("swig_output.json", response_status) + zip_file.close() response_data = zip_data.getvalue() logging.info("Sending {} byte response".format(len(response_data))) |