'Build package
@param p: package name
@type  p: str'

def build(self, p, argument=None, robust_build=False):

    return_string = ''
    try:
        if (argument == 'test'):
            failed_packages = []
        else:
            with self._result_lock:
                failed_packages = [j for j in self.result[argument] if (not (self.result[argument][j] == True))]
        (buildable, error, why) = self.flag_tracker.can_build(p, self.skip_blacklist, failed_packages)
        if (buildable or self.robust_build):
            start_time = time.time()
            (returncode, pstd_out) = self._build_package(p, argument)
            self.profile[argument][p] = (time.time() - start_time)
            self.output[argument][p] = pstd_out
            if argument:
                log_type = ('build_%s' % argument)
            else:
                log_type = 'build'
            if (not returncode):
                self.printer.print_full_verbose(pstd_out)
                with self._result_lock:
                    self.result[argument][p] = True
                warnings = Warnings(pstd_out)
                num_warnings = len(warnings.warning_lines)
                if (num_warnings > 0):
                    return_string = ('[PASS]    [    %.2f    seconds    ]    [    %d    warnings    ' % (self.profile[argument][p], num_warnings))
                    warning_dict = warnings.analyze()
                    for (warntype, warnlines) in warning_dict.items():
                        if (len(warnlines) > 0):
                            return_string = (return_string + '[    {0:d}    {1}    ]    '.format(len(warnlines), warntype))
                    return_string = (return_string + '    ]')
                else:
                    return_string = ('[PASS]    [    %.2f    seconds    ]' % self.profile[argument][p])
                self.output_to_file(p, log_type, pstd_out, (num_warnings > 0))
            else:
                success = False
                no_target = (len(re.findall('No    rule    to    make    target', pstd_out)) > 0)
                interrupt = (len(re.findall('Interrupt', pstd_out)) > 0)
                if no_target:
                    return_string = ('[SKIP]    No    rule    to    make    target    %s' % argument)
                    success = True
                elif interrupt:
                    return_string = '[Interrupted]'
                else:
                    return_string = ('[FAIL]    [    %.2f    seconds    ]' % self.profile[argument][p])
                with self._result_lock:
                    self.result[argument][p] = (True if no_target else False)
                if (success == False):
                    self.printer.print_tail(pstd_out)
                self.output_to_file(p, log_type, pstd_out, always_print=(not (no_target or interrupt)))
                return (success, return_string)
        else:
            with self._result_lock:
                self.result[argument][p] = error
            return_string += why
            return (error, return_string)
        return (True, return_string)
    except rospkg.ResourceNotFound as ex:
        with self._result_lock:
            self.result[argument][p] = False
        self.printer.print_verbose(('[SKIP]    Package    %s    not    found\n' % p))
        self.output[argument][p] = ('Package    not    found    %s' % ex)
        return (False, return_string)
