def Spec(): buildbot.Step('spec') # Spec builds in-tree. Always clobber and run the tests. proc.check_call(['make', 'clean'], cwd=ML_DIR) proc.check_call(['make', 'all'], cwd=ML_DIR) wasm = os.path.join(ML_DIR, 'wasm.opt') CopyBinaryToArchive(wasm)
def CompilerRT(): # TODO(sbc): Figure out how to do this step as part of the llvm build. # I suspect that this can be done using the llvm/runtimes directory but # have yet to make it actually work this way. buildbot.Step('compiler-rt') # TODO(sbc): Remove this. # The compiler-rt doesn't currently rebuild libraries when a new -DCMAKE_AR # value is specified. if os.path.isdir(COMPILER_RT_OUT_DIR): Remove(COMPILER_RT_OUT_DIR) Mkdir(COMPILER_RT_OUT_DIR) command = [ CMAKE_BIN, '-G', CMAKE_GENERATOR, WindowsFSEscape(os.path.join(COMPILER_RT_SRC_DIR, 'lib', 'builtins')), '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_TOOLCHAIN_FILE=' + WindowsFSEscape(os.path.join(HOST_DIR, 'wavix_toolchain.cmake')), '-DCMAKE_EXPORT_COMPILE_COMMANDS=YES', '-DCMAKE_C_COMPILER_WORKS=YES', '-DCMAKE_CXX_COMPILER_WORKS=YES', '-DCOMPILER_RT_BAREMETAL_BUILD=On', '-DCOMPILER_RT_BUILD_XRAY=OFF', '-DCOMPILER_RT_INCLUDE_TESTS=OFF', '-DCOMPILER_RT_ENABLE_IOS=OFF', '-DCOMPILER_RT_DEFAULT_TARGET_ONLY=On', '-DLLVM_CONFIG_PATH=' + WindowsFSEscape(os.path.join(HOST_DIR, 'bin', 'llvm-config')), '-DCOMPILER_RT_OS_DIR=wavix', '-DCMAKE_INSTALL_PREFIX=' + WindowsFSEscape(os.path.join(HOST_DIR, 'lib', 'clang', '9.0.0')) ] proc.check_call(command, cwd=COMPILER_RT_OUT_DIR) proc.check_call([NINJA_BIN, 'install'], cwd=COMPILER_RT_OUT_DIR)
def HostLLVM(): buildbot.Step('host-llvm') Mkdir(HOST_LLVM_OUT_DIR) build_dylib = 'ON' if not IsWindows() else 'OFF' command = [ CMAKE_BIN, '-G', CMAKE_GENERATOR, LLVM_SRC_DIR, '-DCMAKE_EXPORT_COMPILE_COMMANDS=YES', '-DLLVM_EXTERNAL_CLANG_SOURCE_DIR=' + CLANG_SRC_DIR, '-DLLVM_EXTERNAL_LLD_SOURCE_DIR=' + LLD_SRC_DIR, '-DLLVM_TOOL_CLANG_BUILD=ON', '-DLLVM_TOOL_LLD_BUILD=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DLLVM_BUILD_TESTS=OFF', '-DCMAKE_BUILD_TYPE=Release', #'-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_INSTALL_PREFIX=' + HOST_DIR, '-DCLANG_INCLUDE_TESTS=OFF', '-DCLANG_INCLUDE_DOCS=OFF', '-DLLVM_INCLUDE_EXAMPLES=OFF', '-DLLVM_INCLUDE_DOCS=OFF', '-DLLVM_INCLUDE_GO_TESTS=OFF', '-DLLVM_INCLUDE_TESTS=OFF', '-DLLVM_BUILD_LLVM_DYLIB=%s' % build_dylib, '-DLLVM_LINK_LLVM_DYLIB=%s' % build_dylib, # Our mac bot's toolchain's ld64 is too old for trunk libLTO. '-DLLVM_TOOL_LTO_BUILD=OFF', '-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly', '-DLLVM_TARGETS_TO_BUILD=X86' ] proc.check_call(command, cwd=HOST_LLVM_OUT_DIR) proc.check_call([NINJA_BIN, 'install'], cwd=HOST_LLVM_OUT_DIR)
def Musl(): buildbot.Step('musl') Mkdir(MUSL_OUT_DIR) path = os.environ['PATH'] try: # Build musl directly to wasm object files in an ar library proc.check_call([ os.path.join(MUSL_SRC_DIR, 'libc.py'), '--clang_dir', HOST_BIN, '--out', os.path.join(MUSL_OUT_DIR, 'libc.a'), '--musl', MUSL_SRC_DIR ]) CopyLibraryToSysroot(SYSROOT_DIR, os.path.join(MUSL_OUT_DIR, 'libc.a')) CopyLibraryToSysroot(SYSROOT_DIR, os.path.join(MUSL_OUT_DIR, 'crt1.o')) CopyLibraryToSysroot( SYSROOT_DIR, os.path.join(MUSL_SRC_DIR, 'arch', 'wasm32', 'libc.imports')) CopyTree(os.path.join(MUSL_SRC_DIR, 'include'), os.path.join(SYSROOT_DIR, 'include')) CopyTree(os.path.join(MUSL_SRC_DIR, 'arch', 'generic'), os.path.join(SYSROOT_DIR, 'include')) CopyTree(os.path.join(MUSL_SRC_DIR, 'arch', 'wasm32'), os.path.join(SYSROOT_DIR, 'include')) CopyTree(os.path.join(MUSL_OUT_DIR, 'obj', 'include'), os.path.join(SYSROOT_DIR, 'include')) except proc.CalledProcessError: # Note the failure but allow the build to continue. buildbot.Fail() finally: os.environ['PATH'] = path
def LibCXXABI(): buildbot.Step('libcxxabi') # TODO(sbc): Remove this. # The compiler-rt doesn't currently rebuild libraries when a new -DCMAKE_AR # value is specified. if os.path.isdir(LIBCXXABI_OUT_DIR): Remove(LIBCXXABI_OUT_DIR) Mkdir(LIBCXXABI_OUT_DIR) command = [ CMAKE_BIN, '-G', CMAKE_GENERATOR, LIBCXXABI_SRC_DIR, '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_TOOLCHAIN_FILE=' + WindowsFSEscape(os.path.join(HOST_DIR, 'wavix_toolchain.cmake')), '-DCMAKE_EXPORT_COMPILE_COMMANDS=YES', '-DCMAKE_C_COMPILER_WORKS=YES', '-DCMAKE_CXX_COMPILER_WORKS=YES', '-DLIBCXXABI_LIBCXX_PATH=' + LIBCXX_SRC_DIR, '-DLIBCXXABI_LIBCXX_INCLUDES=' + os.path.join(LIBCXX_SRC_DIR, 'include'), '-DLIBCXXABI_ENABLE_STATIC=ON', '-DLIBCXXABI_ENABLE_SHARED=OFF', '-DLIBCXXABI_ENABLE_THREADS=ON', '-DLIBCXXABI_SYSROOT=' + SYSROOT_DIR, '-DLIBCXXABI_USE_COMPILER_RT=ON', '-DLIBCXXABI_ENABLE_PIC=OFF', '-DCMAKE_INSTALL_PREFIX=' + WindowsFSEscape(SYSROOT_DIR) ] proc.check_call(command, cwd=LIBCXXABI_OUT_DIR) proc.check_call([NINJA_BIN, 'install'], cwd=LIBCXXABI_OUT_DIR) CopyLibraryToSysroot(SYSROOT_DIR, os.path.join(LIBCXXABI_SRC_DIR, 'libc++abi.imports'))
def ExecuteLLVMTorture(name, runner, indir, fails, extension, outdir='', wasmjs='', extra_files=None, warn_only=False): extra_files = [] if extra_files is None else extra_files buildbot.Step('Execute LLVM Torture with %s' % name) if not indir: print 'Step skipped: no input' buildbot.Fail(True) return None assert os.path.isfile(runner), 'Cannot find runner at %s' % runner files = os.path.join(indir, '*.%s' % extension) unexpected_result_count = execute_files.run(runner=runner, files=files, fails=fails, out=outdir, wasmjs=wasmjs, extra_files=extra_files) if 0 != unexpected_result_count: buildbot.Fail(warn_only) return outdir
def ExecuteLLVMTorture(name, runner, indir, fails, attributes, extension, opt, outdir='', wasmjs='', extra_files=None, warn_only=False): extra_files = [] if extra_files is None else extra_files buildbot.Step('Execute LLVM Torture (%s, %s)' % (name, opt)) if not indir: print 'Step skipped: no input' buildbot.Warn() return None assert os.path.isfile(runner), 'Cannot find runner at %s' % runner files = os.path.join(indir, '*.%s' % extension) unexpected_result_count = execute_files.run( runner=runner, files=files, fails=fails, attributes=attributes + [opt], out=outdir, extra_args=['--sysroot', SYSROOT_DIR], exclude_files=[os.path.join(indir, '930529-1.c.o.wasm')], wasmjs=wasmjs, extra_files=extra_files) if 0 != unexpected_result_count: buildbot.FailUnless(lambda: warn_only)
def Toolchain(): buildbot.Step('Toolchain') Mkdir(HOST_DIR) Mkdir(os.path.join(HOST_DIR, 'cmake', 'Modules', 'Platform')) shutil.copy2(os.path.join(SCRIPT_DIR, 'cmake', 'Modules', 'Platform', 'Wavix.cmake'), os.path.join(HOST_DIR, 'cmake', 'Modules', 'Platform')) shutil.copy2(os.path.join(SCRIPT_DIR, 'wavix_toolchain.cmake'), HOST_DIR)
def LLVM(): buildbot.Step('LLVM') Mkdir(LLVM_OUT_DIR) command = [ PREBUILT_CMAKE_BIN, '-G', 'Ninja', LLVM_SRC_DIR, '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DLLVM_BUILD_TESTS=ON', '-DCMAKE_C_COMPILER=' + CC, '-DCMAKE_CXX_COMPILER=' + CXX, '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_INSTALL_PREFIX=' + INSTALL_DIR, '-DLLVM_INCLUDE_EXAMPLES=OFF', '-DCOMPILER_RT_BUILD_XRAY=OFF', '-DCOMPILER_RT_INCLUDE_TESTS=OFF', '-DLLVM_BUILD_LLVM_DYLIB=ON', '-DLLVM_LINK_LLVM_DYLIB=ON', '-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON', '-DLLVM_ENABLE_ASSERTIONS=ON', '-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly', '-DLLVM_TARGETS_TO_BUILD=X86' ] compiler_launcher = None jobs = [] if 'GOMA_DIR' in os.environ: compiler_launcher = os.path.join(os.environ['GOMA_DIR'], 'gomacc') jobs = ['-j', '50'] else: ccache = Which('ccache') if ccache: compiler_launcher = ccache command.extend([ '-DCMAKE_%s_FLAGS=-Qunused-arguments' % c for c in ['C', 'CXX'] ]) if compiler_launcher: command.extend([ '-DCMAKE_%s_COMPILER_LAUNCHER=%s' % (c, compiler_launcher) for c in ['C', 'CXX'] ]) proc.check_call(command, cwd=LLVM_OUT_DIR) proc.check_call(['ninja', '-v'] + jobs, cwd=LLVM_OUT_DIR) proc.check_call(['ninja', 'check-all'], cwd=LLVM_OUT_DIR) proc.check_call(['ninja', 'install'] + jobs, cwd=LLVM_OUT_DIR) # The following isn't useful for now, and takes up space. Remove(os.path.join(INSTALL_BIN, 'clang-check')) # The following are useful, LLVM_INSTALL_TOOLCHAIN_ONLY did away with them. extra_bins = [ 'FileCheck', 'lli', 'llc', 'llvm-as', 'llvm-dis', 'llvm-link', 'llvm-nm', 'opt' ] extra_libs = ['libLLVM*.so'] for p in [ glob.glob(os.path.join(LLVM_OUT_DIR, 'bin', b)) for b in extra_bins ]: for e in p: CopyBinaryToArchive(os.path.join(LLVM_OUT_DIR, 'bin', e)) for p in [ glob.glob(os.path.join(LLVM_OUT_DIR, 'lib', l)) for l in extra_libs ]: for e in p: CopyLibraryToArchive(os.path.join(LLVM_OUT_DIR, 'lib', e))
def Sexpr(): buildbot.Step('Sexpr') Mkdir(SEXPR_OUT_DIR), proc.check_call([PREBUILT_CMAKE_BIN, '-G', 'Ninja', SEXPR_SRC_DIR, '-DCMAKE_C_COMPILER=%s' % CC, '-DCMAKE_CXX_COMPILER=%s' % CXX, '-DBUILD_TESTS=OFF'], cwd=SEXPR_OUT_DIR) proc.check_call(['ninja'], cwd=SEXPR_OUT_DIR) sexpr = os.path.join(SEXPR_OUT_DIR, 'sexpr-wasm') CopyBinaryToArchive(sexpr)
def ExecuteEmscriptenTestSuite(name, outdir): buildbot.Step('Execute emscripten testsuite (emwasm)') Mkdir(EMSCRIPTEN_TEST_OUT_DIR) try: proc.check_call( [sys.executable, os.path.join(INSTALL_BIN, 'emscripten', 'tests', 'runner.py'), 'binaryen2', '--em-config', EMSCRIPTEN_CONFIG_WASM], cwd=outdir) except proc.CalledProcessError: buildbot.Fail(True)
def HostWAVM(): buildbot.Step('HostWAVM') Mkdir(HOST_WAVM_OUT_DIR) command = [CMAKE_BIN, '-G', CMAKE_GENERATOR, WAVM_SRC_DIR, '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_EXPORT_COMPILE_COMMANDS=YES', '-DCMAKE_INSTALL_PREFIX=' + HOST_DIR, '-DLLVM_DIR=' + os.path.join(HOST_DIR, 'lib/cmake/llvm') ] proc.check_call(command, cwd=HOST_WAVM_OUT_DIR) proc.check_call([NINJA_BIN, 'install'], cwd=HOST_WAVM_OUT_DIR)
def SyncRepos(filter=None): buildbot.Step('Sync Repos') if not filter: filter = Filter() for repo in filter.Apply(ALL_SOURCES): repo.Sync() # Special cases if filter.Check('clang'): SyncLLVMClang() if filter.Check('ocaml'): SyncOCaml()
def OCaml(): buildbot.Step('OCaml') makefile = os.path.join(OCAML_DIR, 'config', 'Makefile') if not os.path.isfile(makefile): configure = os.path.join(OCAML_DIR, 'configure') proc.check_call( [configure, '-prefix', OCAML_OUT_DIR, '-cc', CC], cwd=OCAML_DIR) proc.check_call(['make', 'world.opt', '-j%s' % NPROC], cwd=OCAML_DIR) proc.check_call(['make', 'install'], cwd=OCAML_DIR) ocamlbuild = os.path.join(OCAML_BIN_DIR, 'ocamlbuild') assert os.path.isfile(ocamlbuild), 'Expected installed %s' % ocamlbuild os.environ['PATH'] = OCAML_BIN_DIR + os.pathsep + os.environ['PATH']
def V8(): buildbot.Step('V8') proc.check_call(['ninja', '-C', V8_OUT_DIR, 'd8', 'unittests'], cwd=V8_SRC_DIR) proc.check_call([ 'tools/run-tests.py', 'unittests', '--no-presubmit', '--shell-dir', V8_OUT_DIR ], cwd=V8_SRC_DIR) to_archive = ['d8', 'natives_blob.bin', 'snapshot_blob.bin'] for a in to_archive: CopyBinaryToArchive(os.path.join(V8_OUT_DIR, a))
def LinkLLVMTorture(name, linker, fails, indir, outdir, extension, opt, args=None): buildbot.Step('Link LLVM Torture (%s, %s)' % (name, opt)) assert os.path.isfile(linker), 'Cannot find linker at %s' % linker Remove(outdir) Mkdir(outdir) input_pattern = os.path.join(indir, '*.' + extension) unexpected_result_count = link_assembly_files.run( linker=linker, files=input_pattern, fails=fails, attributes=[opt], out=outdir, args=args) if 0 != unexpected_result_count: buildbot.Fail()
def LinkLLVMTorture(name, linker, fails): buildbot.Step('Link LLVM Torture with %s' % name) assert os.path.isfile(linker), 'Cannot find linker at %s' % linker assembly_files = os.path.join(TORTURE_S_OUT_DIR, '*.s') out = os.path.join(WORK_DIR, 'torture-%s' % name) Remove(out) Mkdir(out) unexpected_result_count = link_assembly_files.run( linker=linker, files=assembly_files, fails=fails, out=out) Archive('torture-%s' % name, Tar(out)) if 0 != unexpected_result_count: buildbot.Fail() return out
def Summary(repos): buildbot.Step('Summary') info = {'repositories': repos} info_file = os.path.join(HOST_DIR, 'buildinfo.json') print 'Failed steps: %s.' % buildbot.Failed() for step in buildbot.FailedList(): print ' %s' % step print 'Warned steps: %s.' % buildbot.Warned() for step in buildbot.WarnedList(): print ' %s' % step if buildbot.Failed(): buildbot.Fail()
def Fastcomp(): buildbot.Step('fastcomp') Mkdir(FASTCOMP_OUT_DIR) proc.check_call([ PREBUILT_CMAKE_BIN, '-G', 'Ninja', FASTCOMP_SRC_DIR, '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DCMAKE_C_COMPILER=' + CC, '-DCMAKE_CXX_COMPILER=' + CXX, '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_INSTALL_PREFIX=' + os.path.join(INSTALL_DIR, 'fastcomp'), '-DLLVM_INCLUDE_EXAMPLES=OFF', '-DLLVM_BUILD_LLVM_DYLIB=ON', '-DLLVM_LINK_LLVM_DYLIB=ON', '-DLLVM_TARGETS_TO_BUILD=X86;JSBackend', '-DLLVM_ENABLE_ASSERTIONS=ON' ], cwd=FASTCOMP_OUT_DIR) proc.check_call(['ninja'], cwd=FASTCOMP_OUT_DIR) proc.check_call(['ninja', 'install'], cwd=FASTCOMP_OUT_DIR)
def AssembleLLVMTorture(name, assembler, indir, fails): buildbot.Step('Assemble LLVM Torture with %s' % name) assert os.path.isfile(assembler), 'Cannot find assembler at %s' % assembler files = os.path.join(indir, '*.wast') out = os.path.join(WORK_DIR, 'torture-%s' % name) Remove(out) Mkdir(out) unexpected_result_count = assemble_files.run(assembler=assembler, files=files, fails=fails, out=out) Archive('torture-%s' % name, Tar(out)) if 0 != unexpected_result_count: buildbot.Fail() return out
def WAVM(): buildbot.Step('WAVM') Mkdir(WAVM_OUT_DIR) command = [CMAKE_BIN, '-G', CMAKE_GENERATOR, WAVM_SRC_DIR, '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_EXPORT_COMPILE_COMMANDS=YES', '-DCMAKE_INSTALL_PREFIX=' + SYSROOT_DIR, '-DCMAKE_TOOLCHAIN_FILE=' + WindowsFSEscape(os.path.join(HOST_DIR, 'wavix_toolchain.cmake')), '-DWAVM_ENABLE_RUNTIME=OFF', '-DWAVM_ENABLE_STATIC_LINKING=ON', '-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON' ] proc.check_call(command, cwd=WAVM_OUT_DIR) proc.check_call([NINJA_BIN, 'install'], cwd=WAVM_OUT_DIR)
def Emscripten(use_asm=True): buildbot.Step('emscripten') # Remove cached library builds (e.g. libc, libc++) to force them to be # rebuilt in the step below. Remove(os.path.expanduser(os.path.join('~', '.emscripten_cache'))) emscripten_dir = os.path.join(INSTALL_DIR, 'bin', 'emscripten') Remove(emscripten_dir) shutil.copytree( EMSCRIPTEN_SRC_DIR, emscripten_dir, symlinks=True, # Ignore the big git blob so it doesn't get archived. ignore=shutil.ignore_patterns('.git')) def WriteEmscriptenConfig(infile, outfile): with open(infile) as config: text = config.read().replace('{{WASM_INSTALL}}', INSTALL_DIR) with open(outfile, 'w') as config: config.write(text) WriteEmscriptenConfig(os.path.join(SCRIPT_DIR, 'emscripten_config'), EMSCRIPTEN_CONFIG_ASMJS) WriteEmscriptenConfig( os.path.join(SCRIPT_DIR, 'emscripten_config_vanilla'), EMSCRIPTEN_CONFIG_WASM) try: # Build a C++ file with each active emscripten config. This causes system # libs to be built and cached (so we don't have that happen when building # tests in parallel). Do it with full debug output. # This depends on binaryen already being built and installed into the # archive/install dir. os.environ['EMCC_DEBUG'] = '2' configs = [EMSCRIPTEN_CONFIG_WASM ] + ([EMSCRIPTEN_CONFIG_ASMJS] if use_asm else []) for config in configs: os.environ['EM_CONFIG'] = config proc.check_call([ os.path.join(emscripten_dir, 'em++'), os.path.join(EMSCRIPTEN_SRC_DIR, 'tests', 'hello_libcxx.cpp'), '-O2', '-s', 'BINARYEN=1', '-s', 'BINARYEN_METHOD="native-wasm"' ]) except proc.CalledProcessError: # Note the failure but allow the build to continue. buildbot.Fail() finally: del os.environ['EMCC_DEBUG']
def CompileLLVMTorture(): name = 'Compile LLVM Torture' buildbot.Step(name) c = os.path.join(INSTALL_BIN, 'clang') cxx = os.path.join(INSTALL_BIN, 'clang++') Remove(TORTURE_S_OUT_DIR) Mkdir(TORTURE_S_OUT_DIR) unexpected_result_count = compile_torture_tests.run( c=c, cxx=cxx, testsuite=GCC_TEST_DIR, sysroot_dir=INSTALL_SYSROOT, fails=LLVM_KNOWN_TORTURE_FAILURES, out=TORTURE_S_OUT_DIR) Archive('torture-c', Tar(GCC_TEST_DIR)) Archive('torture-s', Tar(TORTURE_S_OUT_DIR)) if 0 != unexpected_result_count: buildbot.Fail()
def CompileLLVMTorture(outdir, opt): name = 'Compile LLVM Torture (%s)' % (opt) buildbot.Step(name) c = Executable(os.path.join(HOST_BIN, 'clang')) cxx = Executable(os.path.join(HOST_BIN, 'clang++')) Remove(outdir) Mkdir(outdir) unexpected_result_count = compile_torture_tests.run( c=c, cxx=cxx, testsuite=GCC_TEST_DIR, sysroot_dir=SYSROOT_DIR, fails=LLVM_KNOWN_TORTURE_FAILURES, out=outdir, config='wasm-o', opt=opt) if 0 != unexpected_result_count: buildbot.Fail()
def CoreUtils(): buildbot.Step('coreutils') Mkdir(COREUTILS_OUT_DIR) # Build bash proc.check_call([ 'bash', WAVIX_SRC_DIR.replace('\\', '/').replace('C:','/mnt/c') + '/coreutils/build-wavix-coreutils.sh', WAVIX_SRC_DIR.replace('\\', '/').replace('C:','/mnt/c'), BUILD_DIR.replace('\\', '/'), BUILD_DIR.replace('\\', '/').replace('C:','/mnt/c'), BUILD_DIR.replace('\\', '/').replace('C:','/mnt/c') + Executable('/host/bin/clang'), BUILD_DIR.replace('\\', '/').replace('C:','/mnt/c') + Executable('/host/bin/llvm-ar'), BUILD_DIR.replace('\\', '/').replace('C:','/mnt/c') + Executable('/host/bin/llvm-ranlib'), BUILD_DIR.replace('\\', '/').replace('C:','/mnt/c') + Executable('/host/bin/clang-cpp') ], cwd=COREUTILS_OUT_DIR)
def Bash(): buildbot.Step('bash') Mkdir(BASH_OUT_DIR) # Build bash proc.check_call([ 'bash', WAVIX_SRC_DIR.replace('\\', '/').replace('C:','/mnt/c') + '/bash/build-wavix-bash.sh', WAVIX_SRC_DIR.replace('\\', '/').replace('C:','/mnt/c'), BUILD_DIR.replace('\\', '/'), BUILD_DIR.replace('\\', '/').replace('C:','/mnt/c'), BUILD_DIR.replace('\\', '/').replace('C:','/mnt/c') + Executable('/host/bin/clang'), BUILD_DIR.replace('\\', '/').replace('C:','/mnt/c') + Executable('/host/bin/llvm-ar'), BUILD_DIR.replace('\\', '/').replace('C:','/mnt/c') + Executable('/host/bin/llvm-ranlib'), BUILD_DIR.replace('\\', '/').replace('C:','/mnt/c') + Executable('/host/bin/clang-cpp') ], cwd=BASH_OUT_DIR)
def LibCXX(): buildbot.Step('libcxx') # TODO(sbc): Remove this. # The compiler-rt doesn't currently rebuild libraries when a new -DCMAKE_AR # value is specified. if os.path.isdir(LIBCXX_OUT_DIR): Remove(LIBCXX_OUT_DIR) Mkdir(LIBCXX_OUT_DIR) command = [ CMAKE_BIN, '-G', CMAKE_GENERATOR, LIBCXX_SRC_DIR, '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_TOOLCHAIN_FILE=' + WindowsFSEscape(os.path.join(HOST_DIR, 'wavix_toolchain.cmake')), '-DCMAKE_EXPORT_COMPILE_COMMANDS=YES', # Make HandleLLVMOptions.cmake (it can't check for c++11 support # because no C++ programs can be linked until libc++abi is # installed, so chicken and egg. '-DCXX_SUPPORTS_CXX11=ON', '-DCXX_SUPPORTS_CXX14=ON', '-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF', # HandleLLVMOptions.cmake include CheckCompilerVersion.cmake. # This checks for working <atomic> header, which in turn errors # out on systems with threads disabled '-DLLVM_COMPILER_CHECKED=ON', '-DCMAKE_C_COMPILER_WORKS=YES', '-DCMAKE_CXX_COMPILER_WORKS=YES', '-DLIBCXX_CXX_ABI=libcxxabi', '-DLIBCXX_CXX_ABI_INCLUDE_PATHS=' + WindowsFSEscape(os.path.join(LIBCXXABI_SRC_DIR, 'include')), '-DLIBCXX_CXX_ABI_LIBRARY_PATH=' + WindowsFSEscape(os.path.join(SYSROOT_DIR, 'lib')), '-DLLVM_PATH=' + LLVM_SRC_DIR, '-DLIBCXX_ENABLE_STATIC=ON', '-DLIBCXX_ENABLE_SHARED=OFF', '-DLIBCXX_HAS_MUSL_LIBC=ON', '-DLIBCXX_ENABLE_THREADS=ON', '-DLIBCXX_INCLUDE_BENCHMARKS=OFF', '-DCMAKE_INSTALL_PREFIX=' + WindowsFSEscape(SYSROOT_DIR) ] proc.check_call(command, cwd=LIBCXX_OUT_DIR) proc.check_call([NINJA_BIN, 'install'], cwd=LIBCXX_OUT_DIR)
def CompileLLVMTortureBinaryen(name, em_config, outdir, fails): buildbot.Step(name) os.environ['EM_CONFIG'] = em_config c = os.path.join(INSTALL_DIR, 'bin', 'emscripten', 'emcc') cxx = os.path.join(INSTALL_DIR, 'bin', 'emscripten', 'em++') Remove(outdir) Mkdir(outdir) unexpected_result_count = compile_torture_tests.run( c=c, cxx=cxx, testsuite=GCC_TEST_DIR, sysroot_dir=INSTALL_SYSROOT, fails=fails, out=outdir, config='binaryen-interpret') Archive('torture-' + em_config, Tar(outdir)) if 0 != unexpected_result_count: buildbot.Fail() return outdir
def Summary(repos): buildbot.Step('Summary') info = {'repositories': repos} info['build'] = BUILDBOT_BUILDNUMBER info['scheduler'] = SCHEDULER info_json = json.dumps(info) print info print 'Failed steps: %s.' % buildbot.Failed() with open('latest', 'w+') as f: f.write(info_json) buildbot.Link('latest', cloud.Upload('latest', 'git/latest')) if buildbot.Failed(): buildbot.Fail() else: with open('lkgr', 'w+') as f: f.write(info_json) buildbot.Link('lkgr', cloud.Upload('lkgr', 'git/lkgr'))
def HelloWorld(): buildbot.Step('HelloWorld') # TODO(sbc): Remove this. # The compiler-rt doesn't currently rebuild libraries when a new -DCMAKE_AR # value is specified. if os.path.isdir(HELLOWORLD_OUT_DIR): Remove(HELLOWORLD_OUT_DIR) Mkdir(HELLOWORLD_OUT_DIR) command = [ CMAKE_BIN, '-G', CMAKE_GENERATOR, HELLOWORLD_SRC_DIR, '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_TOOLCHAIN_FILE=' + WindowsFSEscape(os.path.join(HOST_DIR, 'wavix_toolchain.cmake')), '-DCMAKE_EXPORT_COMPILE_COMMANDS=YES', '-DCMAKE_INSTALL_PREFIX=' + WindowsFSEscape(SYSROOT_DIR) ] proc.check_call(command, cwd=HELLOWORLD_OUT_DIR) proc.check_call([NINJA_BIN, 'install'], cwd=HELLOWORLD_OUT_DIR)