Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: native_client_sdk/src/build_tools/build_sdk.py

Issue 10829027: [NaCl SDK] Add nacl_mounts to NaCl SDK build. Experimental for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync again Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/generate_make.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 'multithreaded_input_events', 421 'multithreaded_input_events',
422 'pi_generator', 422 'pi_generator',
423 'pong', 423 'pong',
424 'sine_synth', 424 'sine_synth',
425 'tumbler', 425 'tumbler',
426 'websocket', 426 'websocket',
427 'dlopen', 427 'dlopen',
428 ] 428 ]
429 429
430 LIBRARY_LIST = [ 430 LIBRARY_LIST = [
431 'pthread', 431 'nacl_mounts',
432 'ppapi', 432 'ppapi',
433 'ppapi_cpp', 433 'ppapi_cpp',
434 'ppapi_gles2', 434 'ppapi_gles2',
435 'pthread',
435 ] 436 ]
436 437
437 LIB_DICT = { 438 LIB_DICT = {
438 'linux': [], 439 'linux': [],
439 'mac': [], 440 'mac': [],
440 'win': ['x86_32'] 441 'win': ['x86_32']
441 } 442 }
442 443
443 def BuildStepCopyExamples(pepperdir, toolchains): 444 def BuildStepCopyExamples(pepperdir, toolchains, build_experimental):
444 buildbot_common.BuildStep('Copy examples') 445 buildbot_common.BuildStep('Copy examples')
445 446
446 if not os.path.exists(os.path.join(pepperdir, 'tools')): 447 if not os.path.exists(os.path.join(pepperdir, 'tools')):
447 buildbot_common.ErrorExit('Examples depend on missing tools.') 448 buildbot_common.ErrorExit('Examples depend on missing tools.')
448 if not os.path.exists(os.path.join(pepperdir, 'toolchain')): 449 if not os.path.exists(os.path.join(pepperdir, 'toolchain')):
449 buildbot_common.ErrorExit('Examples depend on missing toolchains.') 450 buildbot_common.ErrorExit('Examples depend on missing toolchains.')
450 451
451 exampledir = os.path.join(pepperdir, 'examples') 452 exampledir = os.path.join(pepperdir, 'examples')
452 buildbot_common.RemoveDir(exampledir) 453 buildbot_common.RemoveDir(exampledir)
453 buildbot_common.MakeDir(exampledir) 454 buildbot_common.MakeDir(exampledir)
(...skipping 21 matching lines...) Expand all
475 args.append('--' + toolchain) 476 args.append('--' + toolchain)
476 477
477 for example in EXAMPLE_LIST: 478 for example in EXAMPLE_LIST:
478 dsc = os.path.join(SDK_EXAMPLE_DIR, example, 'example.dsc') 479 dsc = os.path.join(SDK_EXAMPLE_DIR, example, 'example.dsc')
479 args.append(dsc) 480 args.append(dsc)
480 481
481 for library in LIBRARY_LIST: 482 for library in LIBRARY_LIST:
482 dsc = os.path.join(SDK_LIBRARY_DIR, library, 'library.dsc') 483 dsc = os.path.join(SDK_LIBRARY_DIR, library, 'library.dsc')
483 args.append(dsc) 484 args.append(dsc)
484 485
486 if build_experimental:
487 args.append('--experimental')
488
485 if generate_make.main(args): 489 if generate_make.main(args):
486 buildbot_common.ErrorExit('Failed to build examples.') 490 buildbot_common.ErrorExit('Failed to build examples.')
487 491
488 492
489 def GetWindowsEnvironment(): 493 def GetWindowsEnvironment():
490 sys.path.append(os.path.join(NACL_DIR, 'buildbot')) 494 sys.path.append(os.path.join(NACL_DIR, 'buildbot'))
491 import buildbot_standard 495 import buildbot_standard
492 496
493 # buildbot_standard.SetupWindowsEnvironment expects a "context" object. We'll 497 # buildbot_standard.SetupWindowsEnvironment expects a "context" object. We'll
494 # fake enough of that here to work. 498 # fake enough of that here to work.
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 action='store_true', dest='only_updater', default=False) 701 action='store_true', dest='only_updater', default=False)
698 parser.add_option('--test-examples', 702 parser.add_option('--test-examples',
699 help='Run the pyauto tests for examples.', action='store_true', 703 help='Run the pyauto tests for examples.', action='store_true',
700 dest='test_examples', default=False) 704 dest='test_examples', default=False)
701 parser.add_option('--skip-tar', help='Skip generating a tarball.', 705 parser.add_option('--skip-tar', help='Skip generating a tarball.',
702 action='store_true', dest='skip_tar', default=False) 706 action='store_true', dest='skip_tar', default=False)
703 parser.add_option('--archive', help='Force the archive step.', 707 parser.add_option('--archive', help='Force the archive step.',
704 action='store_true', dest='archive', default=False) 708 action='store_true', dest='archive', default=False)
705 parser.add_option('--release', help='PPAPI release version.', 709 parser.add_option('--release', help='PPAPI release version.',
706 dest='release', default=None) 710 dest='release', default=None)
711 parser.add_option('--experimental',
712 help='build experimental examples and libraries', action='store_true',
713 dest='build_experimental', default=False)
707 714
708 options, args = parser.parse_args(args[1:]) 715 options, args = parser.parse_args(args[1:])
709 platform = getos.GetPlatform() 716 platform = getos.GetPlatform()
710 arch = 'x86' 717 arch = 'x86'
711 718
712 builder_name = os.getenv('BUILDBOT_BUILDERNAME','') 719 builder_name = os.getenv('BUILDBOT_BUILDERNAME','')
713 if builder_name.find('pnacl') >= 0 and builder_name.find('sdk') >= 0: 720 if builder_name.find('pnacl') >= 0 and builder_name.find('sdk') >= 0:
714 options.pnacl = True 721 options.pnacl = True
715 722
716 # TODO(binji) There is currently a hack in download_nacl_toolchains.py that 723 # TODO(binji) There is currently a hack in download_nacl_toolchains.py that
(...skipping 24 matching lines...) Expand all
741 tarname = 'naclsdk_' + platform + '.tar.bz2' 748 tarname = 'naclsdk_' + platform + '.tar.bz2'
742 if 'pnacl' in toolchains: 749 if 'pnacl' in toolchains:
743 tarname = 'p' + tarname 750 tarname = 'p' + tarname
744 tarfile = os.path.join(SERVER_DIR, tarname) 751 tarfile = os.path.join(SERVER_DIR, tarname)
745 752
746 if options.release: 753 if options.release:
747 pepper_ver = options.release 754 pepper_ver = options.release
748 print 'Building PEPPER %s at %s' % (pepper_ver, clnumber) 755 print 'Building PEPPER %s at %s' % (pepper_ver, clnumber)
749 756
750 if options.only_examples: 757 if options.only_examples:
751 BuildStepCopyExamples(pepperdir, toolchains) 758 BuildStepCopyExamples(pepperdir, toolchains, options.build_experimental)
752 BuildStepBuildLibraries(pepperdir, platform) 759 BuildStepBuildLibraries(pepperdir, platform)
753 BuildStepBuildExamples(pepperdir, platform) 760 BuildStepBuildExamples(pepperdir, platform)
754 if options.test_examples: 761 if options.test_examples:
755 BuildStepTestExamples(pepperdir, platform, pepper_ver) 762 BuildStepTestExamples(pepperdir, platform, pepper_ver)
756 elif options.only_updater: 763 elif options.only_updater:
757 build_updater.BuildUpdater(OUT_DIR) 764 build_updater.BuildUpdater(OUT_DIR)
758 else: # Build everything. 765 else: # Build everything.
759 BuildStepBuildToolsTests() 766 BuildStepBuildToolsTests()
760 767
761 BuildStepDownloadToolchains(platform) 768 BuildStepDownloadToolchains(platform)
762 BuildStepCleanPepperDirs(pepperdir, pepperdir_old) 769 BuildStepCleanPepperDirs(pepperdir, pepperdir_old)
763 BuildStepMakePepperDirs(pepperdir, ['include', 'toolchain', 'tools']) 770 BuildStepMakePepperDirs(pepperdir, ['include', 'toolchain', 'tools'])
764 BuildStepCopyTextFiles(pepperdir, pepper_ver, clnumber) 771 BuildStepCopyTextFiles(pepperdir, pepper_ver, clnumber)
765 BuildStepUntarToolchains(pepperdir, platform, arch, toolchains) 772 BuildStepUntarToolchains(pepperdir, platform, arch, toolchains)
766 BuildStepBuildToolchains(pepperdir, platform, arch, pepper_ver, toolchains) 773 BuildStepBuildToolchains(pepperdir, platform, arch, pepper_ver, toolchains)
767 InstallHeaders(os.path.join(pepperdir, 'include'), None, 'libs') 774 InstallHeaders(os.path.join(pepperdir, 'include'), None, 'libs')
768 BuildStepCopyBuildHelpers(pepperdir, platform) 775 BuildStepCopyBuildHelpers(pepperdir, platform)
769 BuildStepCopyExamples(pepperdir, toolchains) 776 BuildStepCopyExamples(pepperdir, toolchains, options.build_experimental)
770 777
771 # Ship with libraries prebuilt, so run that first. 778 # Ship with libraries prebuilt, so run that first.
772 BuildStepBuildLibraries(pepperdir, platform) 779 BuildStepBuildLibraries(pepperdir, platform)
773 780
774 if not options.skip_tar: 781 if not options.skip_tar:
775 BuildStepTarBundle(pepper_ver, tarfile) 782 BuildStepTarBundle(pepper_ver, tarfile)
776 build_updater.BuildUpdater(OUT_DIR) 783 build_updater.BuildUpdater(OUT_DIR)
777 784
778 # BuildStepTestUpdater downloads the bundle to its own directory. Build 785 # BuildStepTestUpdater downloads the bundle to its own directory. Build
779 # the examples and test from this directory instead of the original. 786 # the examples and test from this directory instead of the original.
780 pepperdir = BuildStepTestUpdater(platform, pepper_ver, clnumber, tarfile) 787 pepperdir = BuildStepTestUpdater(platform, pepper_ver, clnumber, tarfile)
781 BuildStepBuildExamples(pepperdir, platform) 788 BuildStepBuildExamples(pepperdir, platform)
782 if options.test_examples: 789 if options.test_examples:
783 BuildStepTestExamples(pepperdir, platform, pepper_ver) 790 BuildStepTestExamples(pepperdir, platform, pepper_ver)
784 791
785 # Archive on non-trybots. 792 # Archive on non-trybots.
786 if options.archive or buildbot_common.IsSDKBuilder(): 793 if options.archive or buildbot_common.IsSDKBuilder():
787 BuildStepArchiveBundle(pepper_ver, clnumber, tarfile) 794 BuildStepArchiveBundle(pepper_ver, clnumber, tarfile)
788 BuildStepArchiveSDKTools() 795 BuildStepArchiveSDKTools()
789 796
790 return 0 797 return 0
791 798
792 799
793 if __name__ == '__main__': 800 if __name__ == '__main__':
794 sys.exit(main(sys.argv)) 801 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/generate_make.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698