diff --git a/zorg/buildbot/builders/annotated/libc-linux.py b/zorg/buildbot/builders/annotated/libc-linux.py --- a/zorg/buildbot/builders/annotated/libc-linux.py +++ b/zorg/buildbot/builders/annotated/libc-linux.py @@ -14,24 +14,36 @@ ap.add_argument('--asan', action='store_true', default=False) args = ap.parse_args(argv[1:]) - extra_cmake_args = ['-DCMAKE_BUILD_TYPE=Debug'] - if args.asan: - extra_cmake_args.append('-DLLVM_USE_SANITIZER=Address') + source_dir = os.path.join('..', 'llvm-project') - projects = ['llvm', 'libc'] - check_targets = ['check-libc'] + # Cmake step + with step('cmake'): + projects = ['llvm', 'libc', 'clang', 'clang-tools-extra'] - builder = annotated_builder.AnnotatedBuilder() - builder.run_steps(projects=projects, - check_targets=check_targets, - extra_cmake_args=extra_cmake_args) + cmake_args = ['-GNinja', '-DCMAKE_BUILD_TYPE=Debug'] + if args.asan: + cmake_args.append('-DLLVM_USE_SANITIZER=Address') + cmake_args.append('-DLLVM_ENABLE_PROJECTS={}'.format(';'.join(projects))) + + run_command(['cmake', os.path.join(source_dir, 'llvm')] + cmake_args) + + # Build and test step + with step('ninja: build and check'): + run_command(['ninja', 'check-libc']) # AOR tests step if not args.asan: with step('AOR Tests'): - aor_dir = os.path.join('..', 'llvm-project', 'libc', 'AOR_v20.02') + aor_dir = os.path.join(source_dir, 'libc', 'AOR_v20.02') run_command(['make', 'check'], directory=aor_dir) + # Clang-tidy step + with step('build clang-tidy'): + run_command(['ninja', 'clang-tidy']) + with step('run clang-tidy'): + tidy_glob = os.path.join(source_dir,'libc', 'src', '**', '**.cpp') + run_command('bin/clang-tidy ' + tidy_glob, shell=True) + @contextmanager def step(step_name, halt_on_fail=True): @@ -52,8 +64,8 @@ finally: sys.stdout.flush() -def run_command(cmd, directory='.'): - util.report_run_cmd(cmd, cwd=directory) +def run_command(cmd, directory='.', shell=False): + util.report_run_cmd(cmd, cwd=directory, shell=shell) if __name__ == '__main__':