def post_run(self): if self.outputs: error_msg_list = [] # Inspect all of the outputs and only process shared libraries (.so) for output_node in self.outputs: output_path_abs = output_node.abspath() if not output_path_abs.lower().endswith('.so'): continue # Run an 'ldd -r' command on the output shared library. The '-r' flag will process data and function # relocation for the shared library and will uncover any undefined symbols that we may not catch # during the linker process output = subprocess.check_output([ 'ldd', '-r', output_path_abs ]).decode(sys.stdout.encoding or 'iso8859-1', 'replace') output_lines = output.split('\n') for output_line in output_lines: if output_line.startswith('undefined symbol:'): error_msg_list.append( "Linux Clang Error for {}:\n\t{}\n".format( output_path_abs, output_line)) if error_msg_list: self.err_msg = '\n'.join(error_msg_list) raise Errors.BuildError([self]) waflib.Task.Task.post_run(self)
def do_build(self, ctx, srcnode, test, targetdir, optional=False): """ Does the actual taskgen creation for running a particular test. This method is intended to be subclassed """ s = str(srcnode).rpartition(".")[0] t = s + "_" + test.fid + self.ext target = ctx.path.find_or_declare(os.path.join(targetdir.bldpath(), t)) srcs = [srcnode] fonts = test.kw.get('font', []) fonts = fonts if test.kw.get('multifonts', False) or isinstance( fonts, list) else [fonts] for f in fonts: srcs.append(ctx.bldnode.find_resource(str(f.target))) if test.kw.get('usestandards', False): stddir = test.kw.get('standards', ctx.env['STANDARDS'] or 'references') for f in fonts: t = ctx.path.find_resource(os.path.join(stddir, str(f.target))) if t is None: if optional: return None Logs.error( "Cannot find corresponding reference to {} in references dir {}/" .format(f.target, stddir)) raise Errors.BuildError() srcs.append(t) gen = self.cmd.build(ctx, srcs, target, dep=fonts, **test.kw) return target
def perldoc_file(self): source = self.to_nodes(getattr(self, 'source', [])) self.source = [] for node in source: if not node: raise Errors.BuildError('cannot find input file for processing') match = re.search(r"MODULE\s*=\s*(\S+)", node.read()) if match is None: raise Errors.BuildError( '.xs file does not contain a MODULE declaration') module = match.group(1) path = module.replace("::", os.sep) + ".pod" outnode = node.parent.find_or_declare(path) self.create_task('perldoc', node, outnode) base_path = getattr(self, 'install_path', "${INSTALLDIR_PERL_LIB}") self.bld.install_files(os.path.join(base_path, os.path.dirname(path)), outnode)
def compile(self): Logs.debug('build: compile()') self.producer = Runner.Parallel(self, self.jobs) self.producer.biter = self.get_build_iterator() try: self.producer.start() except KeyboardInterrupt: self.store() raise else: if self.producer.dirty: self.store() if self.producer.error: raise Errors.BuildError(self.producer.error)
def process_man(self): source = self.to_nodes(getattr(self, 'source', [])) self.source = [] section = getattr(self, 'section', None) for node in source: if not node: raise Errors.BuildError( 'cannot find input file %s for processing' % x) # s = section or node.name.rpartition('.')[2] s = section or "." in node.name and node.name.rsplit(".", 1)[1] if not s: raise Errors.BuildError( 'cannot determine man section from filename') out = self.path.find_or_declare(node.name + '.gz') tsk = self.create_task('man') tsk.set_inputs(node) tsk.set_outputs(out) self.bld.install_files('${MANDIR}/man%s' % s, out)
def compile(self): """ Run the build by creating an instance of :py:class:`waflib.Runner.Parallel` The cache file is not written if the build is up to date (no task executed). """ Logs.debug('build: compile()') # use another object to perform the producer-consumer logic (reduce the complexity) self.producer = Runner.Parallel(self, self.jobs) self.producer.biter = self.get_build_iterator() self.returned_tasks = [] # not part of the API yet try: self.producer.start() except KeyboardInterrupt: self.store() raise else: if self.producer.dirty: self.store() if self.producer.error: raise Errors.BuildError(self.producer.error)
def compile(self): """ Run the build by creating an instance of :py:class:`waflib.Runner.Parallel` The cache file is written when at least a task was executed. :raises: :py:class:`waflib.Errors.BuildError` in case the build fails """ Logs.debug('build: compile()') # delegate the producer-consumer logic to another object to reduce the complexity self.producer = Runner.Parallel(self, self.jobs) self.producer.biter = self.get_build_iterator() try: self.producer.start() except KeyboardInterrupt: self.store() raise else: if self.producer.dirty: self.store() if self.producer.error: raise Errors.BuildError(self.producer.error)