diff options
author | elijahtaylor@google.com <elijahtaylor@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-16 20:54:20 +0000 |
---|---|---|
committer | elijahtaylor@google.com <elijahtaylor@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-16 20:54:20 +0000 |
commit | a5c4c067b9086807c68141326db1feb9cd6abb94 (patch) | |
tree | 6dce03272f63dc5fe02900cdbd1247545be12afd /native_client_sdk | |
parent | 4d391dff54de91519d4f70951a8ab50f7a4b8bbf (diff) | |
download | chromium_src-a5c4c067b9086807c68141326db1feb9cd6abb94.zip chromium_src-a5c4c067b9086807c68141326db1feb9cd6abb94.tar.gz chromium_src-a5c4c067b9086807c68141326db1feb9cd6abb94.tar.bz2 |
Mono builder cleanup:
- restructure build scripts to allow 2 builds + 1 archive per checkin
- build 32- and 64-bit on one bot so a full package is built
- fix paths in tarball to be relative (lib/, lib32/, include/, etc)
BUG=115363
TEST=bots,manual
Review URL: https://chromiumcodereview.appspot.com/9689021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127228 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
5 files changed, 109 insertions, 32 deletions
diff --git a/native_client_sdk/src/build_tools/buildbot_run.py b/native_client_sdk/src/build_tools/buildbot_run.py index e8b03f9..933d968 100755 --- a/native_client_sdk/src/build_tools/buildbot_run.py +++ b/native_client_sdk/src/build_tools/buildbot_run.py @@ -22,9 +22,9 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) SDK_BUILDER_MAP = { 'linux-sdk-mono32': - [sys.executable, 'nacl-mono-builder.py', '--arch', 'x86-32'], + [sys.executable, 'nacl-mono-buildbot.py'], 'linux-sdk-mono64': - [sys.executable, 'nacl-mono-builder.py', '--arch', 'x86-64'], + ['/bin/true'], 'DEFAULT': [sys.executable, 'build_sdk.py'], } diff --git a/native_client_sdk/src/build_tools/nacl-mono-archive.py b/native_client_sdk/src/build_tools/nacl-mono-archive.py new file mode 100644 index 0000000..b2b06a6b --- /dev/null +++ b/native_client_sdk/src/build_tools/nacl-mono-archive.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import optparse +import os +import sys +import tarfile + +import buildbot_common + + +def main(args): + parser = optparse.OptionParser() + parser.add_option('--install-dir', + help='Install Directory', + dest='install_dir', + default='naclmono') + parser.add_option('--tar-path', + help='Tarfile path', + dest='tar_path', + default='naclmono.bz2') + parser.add_option('--sdk-revision', + help='SDK Revision', + dest='sdk_revision', + default='X') + parser.add_option('--skip-upload', + help='Skips upload step', + action="store_true", + dest='skip_upload') + (options, args) = parser.parse_args(args[1:]) + + if options.sdk_revision == 'X': + buildbot_common.ErrorExit('--sdk-revision is required') + + install_folders = ['bin', 'etc', 'include', 'lib', 'lib32', 'share'] + + buildbot_common.BuildStep('Archive Build') + tar_file = None + buildbot_common.RemoveFile(options.tar_path) + try: + tar_file = tarfile.open(options.tar_path, mode='w:bz2') + for subfolder in install_folders: + tar_file.add(os.path.join(options.install_dir, subfolder), + arcname=subfolder) + finally: + if tar_file: + tar_file.close() + + if not options.skip_upload: + buildbot_common.Archive(os.path.basename(options.tar_path), + 'nativeclient-mirror/nacl/nacl_sdk/%s' % options.sdk_revision, + cwd=os.path.dirname(options.tar_path)) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/native_client_sdk/src/build_tools/nacl-mono-buildbot.py b/native_client_sdk/src/build_tools/nacl-mono-buildbot.py new file mode 100644 index 0000000..40266cd --- /dev/null +++ b/native_client_sdk/src/build_tools/nacl-mono-buildbot.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os +import sys + +import buildbot_common + + +def main(args): + args = args[1:] + + buildbot_revision = os.environ.get('BUILDBOT_REVISION', '') + assert buildbot_revision + sdk_revision = buildbot_revision.split(':')[0] + + install_dir = 'naclmono' + buildbot_common.RemoveDir(install_dir) + + buildbot_common.Run([sys.executable, 'nacl-mono-builder.py', + '--arch', 'x86-32', '--install-dir', install_dir] + args) + buildbot_common.Run([sys.executable, 'nacl-mono-builder.py', + '--arch', 'x86-64', '--install-dir', install_dir] + args) + buildbot_common.Run([sys.executable, 'nacl-mono-archive.py', + '--sdk-revision', sdk_revision, + '--install-dir', install_dir] + args) + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/native_client_sdk/src/build_tools/nacl-mono-builder.py b/native_client_sdk/src/build_tools/nacl-mono-builder.py index f7774e5c..0a6b6ba 100644 --- a/native_client_sdk/src/build_tools/nacl-mono-builder.py +++ b/native_client_sdk/src/build_tools/nacl-mono-builder.py @@ -25,17 +25,23 @@ def main(args): ' (default=buildbot revision)', dest='sdk_version', default='') + parser.add_option('--install-dir', + help='Install Directory', + dest='install_dir', + default='naclmono') (options, args) = parser.parse_args(args[1:]) assert sys.platform.find('linux') != -1 buildbot_revision = os.environ.get('BUILDBOT_REVISION', '') - buildbot_common.BuildStep('Clean Old SDK') + build_prefix = options.arch + ' ' + + buildbot_common.BuildStep(build_prefix + 'Clean Old SDK') buildbot_common.MakeDir(MONO_BUILD_DIR) buildbot_common.RemoveDir(os.path.join(MONO_BUILD_DIR, 'pepper_*')) - buildbot_common.BuildStep('Setup New SDK') + buildbot_common.BuildStep(build_prefix + 'Setup New SDK') sdk_dir = None sdk_revision = None if options.sdk_version == '': @@ -60,7 +66,7 @@ def main(args): assert sdk_dir assert sdk_revision - buildbot_common.BuildStep('Checkout Mono') + buildbot_common.BuildStep(build_prefix + 'Checkout Mono') # TODO(elijahtaylor): Get git URL from master/trigger to make this # more flexible for building from upstream and release branches. git_url = 'git://github.com/elijahtaylor/mono.git' @@ -79,45 +85,26 @@ def main(args): 'x86-64': '64'} arch_to_output_folder = {'x86-32': 'runtime-build', 'x86-64': 'runtime64-build'} - arch_to_install_folder = {'x86-32': 'naclmono-i686', - 'x86-64': 'naclmono-x86_64'} - buildbot_common.BuildStep('Configure Mono') + buildbot_common.BuildStep(build_prefix + 'Configure Mono') os.environ['NACL_SDK_ROOT'] = sdk_dir os.environ['TARGET_BITSIZE'] = arch_to_bitsize[options.arch] buildbot_common.Run(['./autogen.sh'], cwd=MONO_DIR) buildbot_common.Run(['make', 'distclean'], cwd=MONO_DIR) - buildbot_common.BuildStep('Build and Install Mono') - buildbot_common.RemoveDir(arch_to_install_folder[options.arch]) + buildbot_common.BuildStep(build_prefix + 'Build and Install Mono') nacl_interp_script = os.path.join(SDK_BUILD_DIR, 'nacl_interp_loader_mono.sh') os.environ['NACL_INTERP_LOADER'] = nacl_interp_script buildbot_common.Run(['./nacl-mono-runtime.sh', MONO_DIR, # Mono directory with 'configure' arch_to_output_folder[options.arch], # Build dir - arch_to_install_folder[options.arch]], + options.install_dir], cwd=SDK_BUILD_DIR) - buildbot_common.BuildStep('Test Mono') + buildbot_common.BuildStep(build_prefix + 'Test Mono') buildbot_common.Run(['make', 'check', '-j8'], cwd=os.path.join(SDK_BUILD_DIR, arch_to_output_folder[options.arch])) - buildbot_common.BuildStep('Archive Build') - tar_file = None - tar_path = os.path.join(SDK_BUILD_DIR, - arch_to_install_folder[options.arch] + '.bz2') - buildbot_common.RemoveFile(tar_path) - try: - tar_file = tarfile.open(tar_path, mode='w:bz2') - tar_file.add(os.path.join(SDK_BUILD_DIR, - arch_to_install_folder[options.arch])) - finally: - if tar_file: - tar_file.close() - - buildbot_common.Archive(tar_path, - 'nativeclient-mirror/nacl/nacl_sdk/%s' % sdk_revision) - return 0 if __name__ == '__main__': diff --git a/native_client_sdk/src/build_tools/nacl-mono-runtime.sh b/native_client_sdk/src/build_tools/nacl-mono-runtime.sh index 7e156795..7354a86 100755 --- a/native_client_sdk/src/build_tools/nacl-mono-runtime.sh +++ b/native_client_sdk/src/build_tools/nacl-mono-runtime.sh @@ -29,12 +29,14 @@ if [ $TARGET_BITSIZE == "32" ]; then readonly CONFIG_OPTS="--host=i686-pc-linux-gnu \ --build=i686-pc-linux-gnu \ --target=i686-pc-linux-gnu" + readonly LIBDIR=lib32 else readonly NACL_CROSS_PREFIX_DASH=x86_64-nacl- readonly CONFIG_OPTS="--host=x86_64-pc-linux-gnu \ --build=x86_64-pc-linux-gnu \ --target=x86_64-pc-linux-gnu" - fi + readonly LIBDIR=lib +fi # UGLY hack to allow dynamic linking sed -i -e s/elf_i386/elf_nacl/ -e s/elf_x86_64/elf64_nacl/ \ @@ -48,7 +50,6 @@ rm -rf ${BUILD_DIR} mkdir -p ${BUILD_DIR} cd ${BUILD_DIR} -rm -rf ${INSTALL_DIR} mkdir -p ${INSTALL_DIR} readonly NACL_BIN_PATH=${NACL_SDK_ROOT}/toolchain/linux_x86_glibc/bin @@ -65,9 +66,9 @@ LIBS="-lnacl_dyncode -lc -lg -lnosys -lnacl" \ CFLAGS="-g -O2 -D_POSIX_PATH_MAX=256 -DPATH_MAX=256" \ ${MONO_DIR}/configure ${CONFIG_OPTS} \ --exec-prefix=${INSTALL_DIR} \ - --libdir=${INSTALL_DIR}/lib \ + --libdir=${INSTALL_DIR}/${LIBDIR} \ --prefix=${INSTALL_DIR} \ - --program-prefix="" \ + --program-prefix=${NACL_CROSS_PREFIX_DASH} \ --oldincludedir=${INSTALL_DIR}/include \ --with-glib=embedded \ --with-tls=pthread \ |