OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Entry point for both build and try bots. | 6 """Entry point for both build and try bots. |
7 | 7 |
8 This script is invoked from XXX, usually without arguments | 8 This script is invoked from XXX, usually without arguments |
9 to package an SDK. It automatically determines whether | 9 to package an SDK. It automatically determines whether |
10 this SDK is for mac, win, linux. | 10 this SDK is for mac, win, linux. |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 tc_name = 'newlib' | 361 tc_name = 'newlib' |
362 | 362 |
363 InstallFiles(SRC_DIR, tc_dst_inc, NACL_HEADER_MAP[tc_name]) | 363 InstallFiles(SRC_DIR, tc_dst_inc, NACL_HEADER_MAP[tc_name]) |
364 | 364 |
365 | 365 |
366 def MakeNinjaRelPath(path): | 366 def MakeNinjaRelPath(path): |
367 return os.path.join(os.path.relpath(OUT_DIR, SRC_DIR), path) | 367 return os.path.join(os.path.relpath(OUT_DIR, SRC_DIR), path) |
368 | 368 |
369 | 369 |
370 TOOLCHAIN_LIBS = { | 370 TOOLCHAIN_LIBS = { |
371 'bionic' : [ | |
372 'libminidump_generator.a', | |
373 'libnacl.a', | |
374 'libnacl_dyncode.a', | |
375 'libnacl_exception.a', | |
376 'libnacl_list_mappings.a', | |
377 'libppapi.a', | |
378 'libppapi_stub.a', | |
379 ], | |
371 'newlib' : [ | 380 'newlib' : [ |
372 'crti.o', | 381 'crti.o', |
373 'crtn.o', | 382 'crtn.o', |
374 'libminidump_generator.a', | 383 'libminidump_generator.a', |
375 'libnacl.a', | 384 'libnacl.a', |
376 'libnacl_dyncode.a', | 385 'libnacl_dyncode.a', |
377 'libnacl_exception.a', | 386 'libnacl_exception.a', |
378 'libnacl_list_mappings.a', | 387 'libnacl_list_mappings.a', |
379 'libnosys.a', | 388 'libnosys.a', |
380 'libppapi.a', | 389 'libppapi.a', |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
441 buildbot_common.MakeDir(os.path.join(pepperdir, 'tools')) | 450 buildbot_common.MakeDir(os.path.join(pepperdir, 'tools')) |
442 | 451 |
443 # Add .exe extensions to all windows tools | 452 # Add .exe extensions to all windows tools |
444 for pair in tools_files: | 453 for pair in tools_files: |
445 if platform == 'win' and not pair[0].endswith('.nexe'): | 454 if platform == 'win' and not pair[0].endswith('.nexe'): |
446 pair[0] += '.exe' | 455 pair[0] += '.exe' |
447 pair[1] += '.exe' | 456 pair[1] += '.exe' |
448 | 457 |
449 InstallFiles(ninja_out_dir, os.path.join(pepperdir, 'tools'), tools_files) | 458 InstallFiles(ninja_out_dir, os.path.join(pepperdir, 'tools'), tools_files) |
450 | 459 |
460 # Add ARM binaries | |
461 tools_files = [ | |
462 ['irt_core_newlib_arm.nexe', 'irt_core_arm.nexe'], | |
463 ['irt_core_newlib_arm.nexe', 'irt_core_arm.nexe'] | |
464 ] | |
465 if platform == 'linux': | |
466 tools_files.append(['sel_ldr', 'sel_ldr_arm']) | |
467 tools_files.append(['nacl_helper_bootstrap', | |
468 'nacl_helper_bootstrap_arm']) | |
469 ninja_out_dir = os.path.join(OUT_DIR, build_dir + '-arm', 'Release') | |
470 InstallFiles(ninja_out_dir, os.path.join(pepperdir, 'tools'), tools_files) | |
471 | |
451 for tc in set(toolchains) & set(['newlib', 'glibc', 'pnacl']): | 472 for tc in set(toolchains) & set(['newlib', 'glibc', 'pnacl']): |
452 if tc == 'pnacl': | 473 if tc == 'pnacl': |
453 xarches = (None,) | 474 xarches = (None,) |
454 else: | 475 else: |
455 xarches = ('arm', '32', '64') | 476 xarches = ('arm', '32', '64') |
456 | 477 |
457 for xarch in xarches: | 478 for xarch in xarches: |
458 if tc == 'glibc' and xarch == 'arm': | 479 if tc == 'glibc' and xarch == 'arm': |
459 continue | 480 continue |
460 | 481 |
461 src_dir = GetGypBuiltLib(tc, xarch) | 482 src_dir = GetGypBuiltLib(tc, xarch) |
462 dst_dir = GetOutputToolchainLib(pepperdir, tc, xarch) | 483 dst_dir = GetOutputToolchainLib(pepperdir, tc, xarch) |
463 InstallFiles(src_dir, dst_dir, TOOLCHAIN_LIBS[tc]) | 484 InstallFiles(src_dir, dst_dir, TOOLCHAIN_LIBS[tc]) |
464 | 485 |
486 # Copy ARM newlib components to bionic | |
487 if tc == 'newlib' and xarch == 'arm' and 'bionic' in toolchains: | |
488 bionic_dir = GetOutputToolchainLib(pepperdir, 'bionic', xarch) | |
489 InstallFiles(src_dir, bionic_dir, TOOLCHAIN_LIBS['bionic']) | |
490 | |
465 if tc != 'pnacl': | 491 if tc != 'pnacl': |
466 src_dir = GetGypToolchainLib(tc, xarch) | 492 src_dir = GetGypToolchainLib(tc, xarch) |
467 InstallFiles(src_dir, dst_dir, ['crt1.o']) | 493 InstallFiles(src_dir, dst_dir, ['crt1.o']) |
468 | 494 |
469 | 495 |
470 def GypNinjaBuild_NaCl(rel_out_dir): | 496 def GypNinjaBuild_NaCl(rel_out_dir): |
471 gyp_py = os.path.join(NACL_DIR, 'build', 'gyp_nacl') | 497 gyp_py = os.path.join(NACL_DIR, 'build', 'gyp_nacl') |
472 nacl_core_sdk_gyp = os.path.join(NACL_DIR, 'build', 'nacl_core_sdk.gyp') | 498 nacl_core_sdk_gyp = os.path.join(NACL_DIR, 'build', 'nacl_core_sdk.gyp') |
473 all_gyp = os.path.join(NACL_DIR, 'build', 'all.gyp') | 499 all_gyp = os.path.join(NACL_DIR, 'build', 'all.gyp') |
474 | 500 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
883 buildbot_common.BuildStep('Build GoNaCl AppEngine Projects') | 909 buildbot_common.BuildStep('Build GoNaCl AppEngine Projects') |
884 cmd = ['make', 'upload', 'REVISION=%s' % chrome_revision] | 910 cmd = ['make', 'upload', 'REVISION=%s' % chrome_revision] |
885 env = dict(os.environ) | 911 env = dict(os.environ) |
886 env['NACL_SDK_ROOT'] = pepperdir | 912 env['NACL_SDK_ROOT'] = pepperdir |
887 env['NACLPORTS_NO_ANNOTATE'] = "1" | 913 env['NACLPORTS_NO_ANNOTATE'] = "1" |
888 buildbot_common.Run(cmd, env=env, cwd=GONACL_APPENGINE_SRC_DIR) | 914 buildbot_common.Run(cmd, env=env, cwd=GONACL_APPENGINE_SRC_DIR) |
889 | 915 |
890 | 916 |
891 def main(args): | 917 def main(args): |
892 parser = optparse.OptionParser(description=__doc__) | 918 parser = optparse.OptionParser(description=__doc__) |
919 parser.add_option('--qemu', help='Add qemu for ARM.', | |
920 action='store_true') | |
893 parser.add_option('--bionic', help='Add bionic build.', | 921 parser.add_option('--bionic', help='Add bionic build.', |
894 action='store_true') | 922 action='store_true') |
895 parser.add_option('--tar', help='Force the tar step.', | 923 parser.add_option('--tar', help='Force the tar step.', |
896 action='store_true') | 924 action='store_true') |
897 parser.add_option('--archive', help='Force the archive step.', | 925 parser.add_option('--archive', help='Force the archive step.', |
898 action='store_true') | 926 action='store_true') |
899 parser.add_option('--gyp', | 927 parser.add_option('--gyp', |
900 help='Use gyp to build examples/libraries/Makefiles.', | 928 help='Use gyp to build examples/libraries/Makefiles.', |
901 action='store_true') | 929 action='store_true') |
902 parser.add_option('--release', help='PPAPI release version.', | 930 parser.add_option('--release', help='PPAPI release version.', |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
988 if options.build_ports and getos.GetPlatform() == 'linux': | 1016 if options.build_ports and getos.GetPlatform() == 'linux': |
989 ports_tarfile = os.path.join(OUT_DIR, 'naclports.tar.bz2') | 1017 ports_tarfile = os.path.join(OUT_DIR, 'naclports.tar.bz2') |
990 BuildStepSyncNaClPorts() | 1018 BuildStepSyncNaClPorts() |
991 BuildStepBuildNaClPorts(pepper_ver, pepperdir) | 1019 BuildStepBuildNaClPorts(pepper_ver, pepperdir) |
992 if options.tar: | 1020 if options.tar: |
993 BuildStepTarNaClPorts(pepper_ver, ports_tarfile) | 1021 BuildStepTarNaClPorts(pepper_ver, ports_tarfile) |
994 | 1022 |
995 if options.build_app_engine and getos.GetPlatform() == 'linux': | 1023 if options.build_app_engine and getos.GetPlatform() == 'linux': |
996 BuildStepBuildAppEngine(pepperdir, chrome_revision) | 1024 BuildStepBuildAppEngine(pepperdir, chrome_revision) |
997 | 1025 |
1026 if options.qemu: | |
1027 qemudir = os.path.join(NACL_DIR, 'toolchain', 'linux_arm-trusted') | |
1028 oshelpers.Copy(['-r', qemudir, pepperdir]) | |
1029 | |
Sam Clegg
2014/03/27 00:10:02
I don't think you need to full folder here, just a
noelallen1
2014/03/27 18:13:48
True, I will re-examine if/when we ship it.
| |
998 # Archive on non-trybots. | 1030 # Archive on non-trybots. |
999 if options.archive: | 1031 if options.archive: |
1000 BuildStepArchiveBundle('build', pepper_ver, chrome_revision, nacl_revision, | 1032 BuildStepArchiveBundle('build', pepper_ver, chrome_revision, nacl_revision, |
1001 tarfile) | 1033 tarfile) |
1002 if options.build_ports and getos.GetPlatform() == 'linux': | 1034 if options.build_ports and getos.GetPlatform() == 'linux': |
1003 BuildStepArchiveBundle('naclports', pepper_ver, chrome_revision, | 1035 BuildStepArchiveBundle('naclports', pepper_ver, chrome_revision, |
1004 nacl_revision, ports_tarfile) | 1036 nacl_revision, ports_tarfile) |
1005 BuildStepArchiveSDKTools() | 1037 BuildStepArchiveSDKTools() |
1006 | 1038 |
1007 return 0 | 1039 return 0 |
1008 | 1040 |
1009 | 1041 |
1010 if __name__ == '__main__': | 1042 if __name__ == '__main__': |
1011 try: | 1043 try: |
1012 sys.exit(main(sys.argv)) | 1044 sys.exit(main(sys.argv)) |
1013 except KeyboardInterrupt: | 1045 except KeyboardInterrupt: |
1014 buildbot_common.ErrorExit('build_sdk: interrupted') | 1046 buildbot_common.ErrorExit('build_sdk: interrupted') |
1047 | |
OLD | NEW |