From d0d0a5efa09b2d381dd5c6ebe21c7306637b4fb7 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Mon, 9 Nov 2015 08:56:03 -0800 Subject: [PATCH] print copy-pastable compilation command in case of failure Summary: public This makes it a bit easier to diagnose errors. This is how it looks: infer -- javac IDontExist.java "javac" "-g" "-cp" "/home/jul/infer/infer/lib/python/inferlib/../../../../infer/lib/java/processor.jar" "-d" "/home/jul/infer/examples" "IDontExist.java" "-J-Duser.language=en" This is how it used to look: ['javac', '-g', '-cp', u'/home/jul/code/infer/infer/bin/../lib/java/processor.jar', '-d', '/home/jul/infer/examples', 'IDontExist.java', '-J-Duser.language=en'] Reviewed By: jberdine Differential Revision: D2631698 fb-gh-sync-id: 09903df --- infer/lib/python/inferlib/jwlib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/infer/lib/python/inferlib/jwlib.py b/infer/lib/python/inferlib/jwlib.py index c5acc07ec..9c22a09a1 100644 --- a/infer/lib/python/inferlib/jwlib.py +++ b/infer/lib/python/inferlib/jwlib.py @@ -86,9 +86,9 @@ class CompilerCall: try: subprocess.check_call(javac_cmd, stderr=file_out) except subprocess.CalledProcessError: - error_msg = 'Javac compilation error with: \n\n{}\n' - failing_cmd = [arg for arg in javac_cmd - if arg != '-verbose'] + error_msg = 'ERROR: Failed to run the following compilation command:\n\n {}\n' + failing_cmd = ' '.join(['"%s"' % arg for arg in javac_cmd + if arg != '-verbose']) utils.error(error_msg.format(failing_cmd)) subprocess.check_call(failing_cmd)