[buck compilation db] use -- to pass buck command to BuckCompilationDatabase

Summary:
The integration would not work if other arguments were passed to Buck via infer
using Xbuck.

Reviewed By: akotulski

Differential Revision: D4044371

fbshipit-source-id: 742b5b3
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent 76908712e9
commit fa53fc6efb

@ -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):

@ -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"

@ -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.

@ -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;

Loading…
Cancel
Save