diff --git a/infer/lib/python/inferlib/capture/buck.py b/infer/lib/python/inferlib/capture/buck.py index eabe3c89a..555dde5ff 100644 --- a/infer/lib/python/inferlib/capture/buck.py +++ b/infer/lib/python/inferlib/capture/buck.py @@ -209,10 +209,10 @@ class BuckAnalyzer: def capture_with_compilation_database(self): buck_args = self.cmd cmd = [utils.get_cmd_in_bin_dir('InferBuckCompilationDatabase')] - for arg in buck_args: - cmd += ['--Xbuck'] + [arg] if self.args.project_root: - cmd += ['--project-root'] + [self.args.project_root] + cmd += ['--project-root', self.args.project_root] + cmd += ['--'] + cmd += buck_args return subprocess.check_call(cmd) def capture_without_flavors(self): diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 20a2b2366..8feb1bbae 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -493,7 +493,8 @@ let anon_args = and rest = CLOpt.mk_rest - ~exes:CLOpt.[Toplevel] "Stop argument processing, use remaining arguments as a build command" + ~exes:CLOpt.[Toplevel;BuckCompilationDatabase] + "Stop argument processing, use remaining arguments as a build command" and absolute_paths = CLOpt.mk_bool ~long:"absolute-paths" diff --git a/infer/src/base/Process.ml b/infer/src/base/Process.ml index 77bf80b66..dfea373ef 100644 --- a/infer/src/base/Process.ml +++ b/infer/src/base/Process.ml @@ -42,7 +42,7 @@ let create_process_and_wait cmd = | _ -> 1 in if exit_code <> 0 then print_error_and_exit ~exit_code:exit_code - "Failed to execute: %s" (String.concat " " (Array.to_list cmd)) + "Failed to execute: %s\n" (String.concat " " (Array.to_list cmd)) (** Given a process id and a function that describes the command that the process id represents, prints a message explaining the command and its status, if in debug or stats mode. diff --git a/infer/src/integration/BuckCompilationDatabase.ml b/infer/src/integration/BuckCompilationDatabase.ml index 47e1105ba..d21ef9801 100644 --- a/infer/src/integration/BuckCompilationDatabase.ml +++ b/infer/src/integration/BuckCompilationDatabase.ml @@ -172,7 +172,7 @@ let run_compilation_database compilation_database = (** Computes the compilation database: a map from a file path to info to compile the file, i.e. the dir where the compilation should be executed and the arguments to clang.*) let get_compilation_database changed_files = - let cmd = IList.rev Config.buck_build_args in + let cmd = IList.rev_append Config.rest (IList.rev Config.buck_build_args) in match cmd with | buck :: build :: args -> (check_args_for_targets args;