def _run_buck_with_flavors(self): # TODO: Use buck to identify the project's root folder if not os.path.isfile('.buckconfig'): print('Please run this command from the folder where .buckconfig ' 'is located') return os.EX_USAGE env_vars = utils.read_env() infer_args = env_vars['INFER_ARGS'] if infer_args != '': infer_args += '^' # '^' must be CommandLineOption.env_var_sep infer_args += '--fcp-syntax-only' env_vars['INFER_ARGS'] = infer_args env = utils.encode_env(env_vars) command = self.cmd command += ['-j', str(self.args.multicore)] if self.args.load_average is not None: command += ['-L', str(self.args.load_average)] command += self.create_cxx_buck_configuration_args() try: subprocess.check_call(command, env=env) return os.EX_OK except subprocess.CalledProcessError as e: if self.keep_going: print('Buck failed, but continuing the analysis ' 'because --keep-going was passed') return -1 else: raise e
def capture(self): try: env = utils.encode_env(self.get_envvars()) cmd = map(utils.encode, self.cmd) logging.info('Running command %s with env:\n%s' % (cmd, env)) subprocess.check_call(cmd, env=env) return os.EX_OK except subprocess.CalledProcessError as exc: if self.args.debug: traceback.print_exc() return exc.returncode
def _run_buck_with_flavors(self): # TODO: Use buck to identify the project's root folder if not os.path.isfile('.buckconfig'): print('Please run this command from the folder where .buckconfig ' 'is located') return os.EX_USAGE env_vars = utils.read_env() env_vars['FCP_RUN_SYNTAX_ONLY'] = '1' env = utils.encode_env(env_vars) subprocess.check_call( self.cmd + self.create_cxx_buck_configuration_args(), env=env) return os.EX_OK
def _run_buck_with_flavors(self): # TODO: Use buck to identify the project's root folder if not os.path.isfile('.buckconfig'): print('Please run this command from the folder where .buckconfig ' 'is located') return os.EX_USAGE env_vars = utils.read_env() env_vars['FCP_RUN_SYNTAX_ONLY'] = '1' env = utils.encode_env(env_vars) command = self.cmd command += ['-j', str(self.args.multicore)] if self.args.load_average is not None: command += ['-L', str(self.args.load_average)] command += self.create_cxx_buck_configuration_args() subprocess.check_call(command, env=env) return os.EX_OK
def capture(self): # these settings will instruct xcodebuild on which clang to use self.cmd += ['CC={wrapper}'.format(wrapper=CLANG_WRAPPER)] self.cmd += ['CPLUSPLUS={wrapper}'.format(wrapper=CLANGPLUSPLUS_WRAPPER)] # skip the ProcessPCH phase to fix the "newer/older" incompatibility # error for the pch files generated by apple's clang and # the open-source one self.cmd += ['GCC_PRECOMPILE_PREFIX_HEADER=NO'] try: env = utils.encode_env(self.get_envvars()) cmd = map(utils.encode, self.cmd) subprocess.check_call(cmd, env=env) return os.EX_OK except subprocess.CalledProcessError as exc: if self.args.debug: traceback.print_exc() return exc.returncode
def capture(self): try: env = utils.encode_env(self.get_envvars()) cmd = map(utils.encode, self.cmd) logging.info('Running command %s with env:\n%s' % (cmd, env)) subprocess.check_call(cmd, env=env) capture_dir = os.path.join(self.args.infer_out, 'captured') if len(os.listdir(capture_dir)) < 1: # Don't return with a failure code unless we're # running make. It could be normal to have captured # nothing (eg, empty source file). Further output will # alert the user that there was nothing to analyze. if self.cmd[0] == 'make': # reuse code from gradle, etc. integration return util.run_compilation_commands([], 'make clean') return os.EX_OK except subprocess.CalledProcessError as exc: if self.args.debug: traceback.print_exc() return exc.returncode
def _run_buck_with_flavors(self): # TODO: Use buck to identify the project's root folder if not os.path.isfile('.buckconfig'): print('Please run this command from the folder where .buckconfig ' 'is located') return os.EX_USAGE env_vars = utils.read_env() infer_args = env_vars['INFER_ARGS'] if infer_args != '': infer_args += '^' # '^' must be CommandLineOption.env_var_sep infer_args += '--fcp-syntax-only' env_vars['INFER_ARGS'] = infer_args env = utils.encode_env(env_vars) command = self.cmd command += ['-j', str(self.args.multicore)] if self.args.load_average is not None: command += ['-L', str(self.args.load_average)] command += self.create_cxx_buck_configuration_args() subprocess.check_call(command, env=env) return os.EX_OK
def _run_buck_with_flavors(self): env_vars = utils.read_env() infer_args = env_vars['INFER_ARGS'] if infer_args != '': infer_args += '^' # '^' must be CommandLineOption.env_var_sep infer_args += '--fcp-syntax-only' env_vars['INFER_ARGS'] = infer_args env = utils.encode_env(env_vars) command = self.cmd command += ['-j', str(self.args.multicore)] if self.args.load_average is not None: command += ['-L', str(self.args.load_average)] command += self.create_cxx_buck_configuration_args() try: subprocess.check_call(command, env=env) return os.EX_OK except subprocess.CalledProcessError as e: if self.keep_going: print('Buck failed, but continuing the analysis ' 'because --keep-going was passed') return -1 else: raise e