Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
 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
Пример #4
0
 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
Пример #5
0
 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
Пример #6
0
 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
Пример #7
0
 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
Пример #8
0
 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
Пример #9
0
    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
Пример #10
0
 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
Пример #11
0
 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
Пример #12
0
 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
Пример #13
0
 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