Chromium Code Reviews| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 267 'glibc': { | 267 'glibc': { |
| 268 'nacl/dynamic_annotations.h': | 268 'nacl/dynamic_annotations.h': |
| 269 'src/untrusted/valgrind/dynamic_annotations.h', | 269 'src/untrusted/valgrind/dynamic_annotations.h', |
| 270 'nacl/nacl_dyncode.h': 'src/untrusted/nacl/nacl_dyncode.h', | 270 'nacl/nacl_dyncode.h': 'src/untrusted/nacl/nacl_dyncode.h', |
| 271 'nacl/nacl_startup.h': 'src/untrusted/nacl/nacl_startup.h', | 271 'nacl/nacl_startup.h': 'src/untrusted/nacl/nacl_startup.h', |
| 272 'nacl/nacl_thread.h': 'src/untrusted/nacl/nacl_thread.h', | 272 'nacl/nacl_thread.h': 'src/untrusted/nacl/nacl_thread.h', |
| 273 'pnacl.h': 'src/untrusted/nacl/pnacl.h', | 273 'pnacl.h': 'src/untrusted/nacl/pnacl.h', |
| 274 'irt.h': 'src/untrusted/irt/irt.h', | 274 'irt.h': 'src/untrusted/irt/irt.h', |
| 275 'irt_ppapi.h': 'src/untrusted/irt/irt_ppapi.h', | 275 'irt_ppapi.h': 'src/untrusted/irt/irt_ppapi.h', |
| 276 }, | 276 }, |
| 277 'libs': { | 277 'host': { |
| 278 }, | 278 }, |
| 279 } | 279 } |
| 280 | 280 |
| 281 | 281 def InstallCommonHeaders(inc_path): |
| 282 def InstallHeaders(tc_dst_inc, pepper_ver, tc_name): | |
| 283 """Copies NaCl headers to expected locations in the toolchain.""" | |
| 284 if tc_name == 'arm': | |
| 285 # arm toolchain header should be the same as the x86 newlib | |
| 286 # ones | |
| 287 tc_name = 'newlib' | |
| 288 tc_map = HEADER_MAP[tc_name] | |
| 289 for filename in tc_map: | |
| 290 src = os.path.join(NACL_DIR, tc_map[filename]) | |
| 291 dst = os.path.join(tc_dst_inc, filename) | |
| 292 buildbot_common.MakeDir(os.path.dirname(dst)) | |
| 293 buildbot_common.CopyFile(src, dst) | |
| 294 | |
| 295 # Clean out per toolchain ppapi directory | 282 # Clean out per toolchain ppapi directory |
| 296 ppapi = os.path.join(tc_dst_inc, 'ppapi') | 283 ppapi = os.path.join(inc_path, 'ppapi') |
| 297 buildbot_common.RemoveDir(ppapi) | 284 buildbot_common.RemoveDir(ppapi) |
| 298 | 285 |
| 299 # Copy in c and c/dev headers | 286 # Copy in c and c/dev headers |
| 300 buildbot_common.MakeDir(os.path.join(ppapi, 'c', 'dev')) | 287 buildbot_common.MakeDir(os.path.join(ppapi, 'c', 'dev')) |
| 301 buildbot_common.CopyDir(os.path.join(PPAPI_DIR, 'c', '*.h'), | 288 buildbot_common.CopyDir(os.path.join(PPAPI_DIR, 'c', '*.h'), |
| 302 os.path.join(ppapi, 'c')) | 289 os.path.join(ppapi, 'c')) |
| 303 buildbot_common.CopyDir(os.path.join(PPAPI_DIR, 'c', 'dev', '*.h'), | 290 buildbot_common.CopyDir(os.path.join(PPAPI_DIR, 'c', 'dev', '*.h'), |
| 304 os.path.join(ppapi, 'c', 'dev')) | 291 os.path.join(ppapi, 'c', 'dev')) |
| 305 | 292 |
| 306 # Run the generator to overwrite IDL files | |
|
binji
2013/01/08 21:51:25
not needed/desired anymore?
noelallen1
2013/01/08 23:28:22
We never use the single version forms of the heade
| |
| 307 generator_args = [sys.executable, 'generator.py', '--wnone', '--cgen', | |
| 308 '--verbose', '--dstroot=%s/c' % ppapi] | |
| 309 if pepper_ver: | |
| 310 generator_args.append('--release=M' + pepper_ver) | |
| 311 buildbot_common.Run(generator_args, | |
| 312 cwd=os.path.join(PPAPI_DIR, 'generators')) | |
| 313 | |
| 314 # Remove private and trusted interfaces | 293 # Remove private and trusted interfaces |
| 315 buildbot_common.RemoveDir(os.path.join(ppapi, 'c', 'private')) | 294 buildbot_common.RemoveDir(os.path.join(ppapi, 'c', 'private')) |
| 316 buildbot_common.RemoveDir(os.path.join(ppapi, 'c', 'trusted')) | 295 buildbot_common.RemoveDir(os.path.join(ppapi, 'c', 'trusted')) |
| 317 | 296 |
| 318 # Copy in the C++ headers | 297 # Copy in the C++ headers |
| 319 buildbot_common.MakeDir(os.path.join(ppapi, 'cpp', 'dev')) | 298 buildbot_common.MakeDir(os.path.join(ppapi, 'cpp', 'dev')) |
| 320 buildbot_common.CopyDir(os.path.join(PPAPI_DIR, 'cpp', '*.h'), | 299 buildbot_common.CopyDir(os.path.join(PPAPI_DIR, 'cpp', '*.h'), |
| 321 os.path.join(ppapi, 'cpp')) | 300 os.path.join(ppapi, 'cpp')) |
| 322 buildbot_common.CopyDir(os.path.join(PPAPI_DIR, 'cpp', 'dev', '*.h'), | 301 buildbot_common.CopyDir(os.path.join(PPAPI_DIR, 'cpp', 'dev', '*.h'), |
| 323 os.path.join(ppapi, 'cpp', 'dev')) | 302 os.path.join(ppapi, 'cpp', 'dev')) |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 334 buildbot_common.CopyDir( | 313 buildbot_common.CopyDir( |
| 335 os.path.join(PPAPI_DIR, 'utility', 'websocket', '*.h'), | 314 os.path.join(PPAPI_DIR, 'utility', 'websocket', '*.h'), |
| 336 os.path.join(ppapi, 'utility', 'websocket')) | 315 os.path.join(ppapi, 'utility', 'websocket')) |
| 337 | 316 |
| 338 # Copy in the gles2 headers | 317 # Copy in the gles2 headers |
| 339 buildbot_common.MakeDir(os.path.join(ppapi, 'gles2')) | 318 buildbot_common.MakeDir(os.path.join(ppapi, 'gles2')) |
| 340 buildbot_common.CopyDir(os.path.join(PPAPI_DIR, 'lib', 'gl', 'gles2', '*.h'), | 319 buildbot_common.CopyDir(os.path.join(PPAPI_DIR, 'lib', 'gl', 'gles2', '*.h'), |
| 341 os.path.join(ppapi, 'gles2')) | 320 os.path.join(ppapi, 'gles2')) |
| 342 | 321 |
| 343 # Copy the EGL headers | 322 # Copy the EGL headers |
| 344 buildbot_common.MakeDir(os.path.join(tc_dst_inc, 'EGL')) | 323 buildbot_common.MakeDir(os.path.join(inc_path, 'EGL')) |
| 345 buildbot_common.CopyDir( | 324 buildbot_common.CopyDir( |
| 346 os.path.join(PPAPI_DIR, 'lib', 'gl', 'include', 'EGL', '*.h'), | 325 os.path.join(PPAPI_DIR, 'lib', 'gl', 'include', 'EGL', '*.h'), |
| 347 os.path.join(tc_dst_inc, 'EGL')) | 326 os.path.join(inc_path, 'EGL')) |
| 348 | 327 |
| 349 # Copy the GLES2 headers | 328 # Copy the GLES2 headers |
| 350 buildbot_common.MakeDir(os.path.join(tc_dst_inc, 'GLES2')) | 329 buildbot_common.MakeDir(os.path.join(inc_path, 'GLES2')) |
| 351 buildbot_common.CopyDir( | 330 buildbot_common.CopyDir( |
| 352 os.path.join(PPAPI_DIR, 'lib', 'gl', 'include', 'GLES2', '*.h'), | 331 os.path.join(PPAPI_DIR, 'lib', 'gl', 'include', 'GLES2', '*.h'), |
| 353 os.path.join(tc_dst_inc, 'GLES2')) | 332 os.path.join(inc_path, 'GLES2')) |
| 354 | 333 |
| 355 # Copy the KHR headers | 334 # Copy the KHR headers |
| 356 buildbot_common.MakeDir(os.path.join(tc_dst_inc, 'KHR')) | 335 buildbot_common.MakeDir(os.path.join(inc_path, 'KHR')) |
| 357 buildbot_common.CopyDir( | 336 buildbot_common.CopyDir( |
| 358 os.path.join(PPAPI_DIR, 'lib', 'gl', 'include', 'KHR', '*.h'), | 337 os.path.join(PPAPI_DIR, 'lib', 'gl', 'include', 'KHR', '*.h'), |
| 359 os.path.join(tc_dst_inc, 'KHR')) | 338 os.path.join(inc_path, 'KHR')) |
| 360 | 339 |
| 361 # Copy the lib files | 340 # Copy the lib files |
| 362 buildbot_common.CopyDir(os.path.join(PPAPI_DIR, 'lib'), | 341 buildbot_common.CopyDir(os.path.join(PPAPI_DIR, 'lib'), |
| 363 os.path.join(tc_dst_inc, 'ppapi')) | 342 os.path.join(inc_path, 'ppapi')) |
| 343 | |
| 344 | |
| 345 def InstallNaClHeaders(tc_dst_inc, pepper_ver, tc_name): | |
| 346 """Copies NaCl headers to expected locations in the toolchain.""" | |
| 347 if tc_name == 'arm': | |
| 348 # arm toolchain header should be the same as the x86 newlib | |
| 349 # ones | |
| 350 tc_name = 'newlib' | |
| 351 tc_map = HEADER_MAP[tc_name] | |
| 352 | |
| 353 for filename in tc_map: | |
| 354 src = os.path.join(NACL_DIR, tc_map[filename]) | |
| 355 dst = os.path.join(tc_dst_inc, filename) | |
| 356 buildbot_common.MakeDir(os.path.dirname(dst)) | |
| 357 buildbot_common.CopyFile(src, dst) | |
| 364 | 358 |
| 365 | 359 |
| 366 def MakeNinjaRelPath(path): | 360 def MakeNinjaRelPath(path): |
| 367 return os.path.join(os.path.relpath(OUT_DIR, SRC_DIR), path) | 361 return os.path.join(os.path.relpath(OUT_DIR, SRC_DIR), path) |
| 368 | 362 |
| 369 | 363 |
| 370 def GypNinjaInstall(pepperdir, platform, toolchains): | 364 def GypNinjaInstall(pepperdir, platform, toolchains): |
| 371 build_dir = 'gypbuild' | 365 build_dir = 'gypbuild' |
| 372 ninja_out_dir = os.path.join(OUT_DIR, build_dir, 'Release') | 366 ninja_out_dir = os.path.join(OUT_DIR, build_dir, 'Release') |
| 373 # src_file, dst_file, is_host_exe? | 367 # src_file, dst_file, is_host_exe? |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 539 # Run scons TC build steps | 533 # Run scons TC build steps |
| 540 if set(toolchains) & set(['glibc', 'newlib']): | 534 if set(toolchains) & set(['glibc', 'newlib']): |
| 541 GypNinjaBuild_Chrome('ia32', 'gypbuild') | 535 GypNinjaBuild_Chrome('ia32', 'gypbuild') |
| 542 | 536 |
| 543 if 'arm' in toolchains: | 537 if 'arm' in toolchains: |
| 544 GypNinjaBuild_Chrome('arm', 'gypbuild-arm') | 538 GypNinjaBuild_Chrome('arm', 'gypbuild-arm') |
| 545 | 539 |
| 546 GypNinjaInstall(pepperdir, platform, toolchains) | 540 GypNinjaInstall(pepperdir, platform, toolchains) |
| 547 | 541 |
| 548 if 'newlib' in toolchains: | 542 if 'newlib' in toolchains: |
| 549 InstallHeaders(GetToolchainNaClInclude('newlib', newlibdir, 'x86'), | 543 InstallNaClHeaders(GetToolchainNaClInclude('newlib', newlibdir, 'x86'), |
| 550 pepper_ver, | 544 pepper_ver, |
| 551 'newlib') | 545 'newlib') |
| 552 | 546 |
| 553 if 'glibc' in toolchains: | 547 if 'glibc' in toolchains: |
| 554 InstallHeaders(GetToolchainNaClInclude('glibc', glibcdir, 'x86'), | 548 InstallNaClHeaders(GetToolchainNaClInclude('glibc', glibcdir, 'x86'), |
| 555 pepper_ver, | 549 pepper_ver, |
| 556 'glibc') | 550 'glibc') |
| 557 | 551 |
| 558 if 'arm' in toolchains: | 552 if 'arm' in toolchains: |
| 559 tcname = platform + '_arm_newlib' | 553 tcname = platform + '_arm_newlib' |
| 560 armdir = os.path.join(pepperdir, 'toolchain', tcname) | 554 armdir = os.path.join(pepperdir, 'toolchain', tcname) |
| 561 InstallHeaders(GetToolchainNaClInclude('newlib', armdir, 'arm'), | 555 InstallNaClHeaders(GetToolchainNaClInclude('newlib', armdir, 'arm'), |
| 562 pepper_ver, 'arm') | 556 pepper_ver, 'arm') |
| 563 | 557 |
| 564 if 'pnacl' in toolchains: | 558 if 'pnacl' in toolchains: |
| 565 shell = platform == 'win' | 559 shell = platform == 'win' |
| 566 buildbot_common.Run( | 560 buildbot_common.Run( |
| 567 GetBuildArgs('pnacl', pnacldir, pepperdir, 'x86', '32'), | 561 GetBuildArgs('pnacl', pnacldir, pepperdir, 'x86', '32'), |
| 568 cwd=NACL_DIR, shell=shell) | 562 cwd=NACL_DIR, shell=shell) |
| 569 buildbot_common.Run( | 563 buildbot_common.Run( |
| 570 GetBuildArgs('pnacl', pnacldir, pepperdir, 'x86', '64'), | 564 GetBuildArgs('pnacl', pnacldir, pepperdir, 'x86', '64'), |
| 571 cwd=NACL_DIR, shell=shell) | 565 cwd=NACL_DIR, shell=shell) |
| 572 | 566 |
| 573 for arch in ('ia32', 'arm'): | 567 for arch in ('ia32', 'arm'): |
| 574 # Fill in the latest native pnacl shim library from the chrome build. | 568 # Fill in the latest native pnacl shim library from the chrome build. |
| 575 build_dir = 'gypbuild-pnacl-' + arch | 569 build_dir = 'gypbuild-pnacl-' + arch |
| 576 GypNinjaBuild_Pnacl(build_dir, arch) | 570 GypNinjaBuild_Pnacl(build_dir, arch) |
| 577 pnacl_libdir_map = { 'ia32': 'x86-64', 'arm': 'arm' } | 571 pnacl_libdir_map = { 'ia32': 'x86-64', 'arm': 'arm' } |
| 578 release_build_dir = os.path.join(OUT_DIR, build_dir, 'Release', | 572 release_build_dir = os.path.join(OUT_DIR, build_dir, 'Release', |
| 579 'gen', 'tc_pnacl_translate', | 573 'gen', 'tc_pnacl_translate', |
| 580 'lib-' + pnacl_libdir_map[arch]) | 574 'lib-' + pnacl_libdir_map[arch]) |
| 581 | 575 |
| 582 buildbot_common.CopyFile( | 576 buildbot_common.CopyFile( |
| 583 os.path.join(release_build_dir, 'libpnacl_irt_shim.a'), | 577 os.path.join(release_build_dir, 'libpnacl_irt_shim.a'), |
| 584 GetPNaClNativeLib(pnacldir, pnacl_libdir_map[arch])) | 578 GetPNaClNativeLib(pnacldir, pnacl_libdir_map[arch])) |
| 585 | 579 |
| 586 InstallHeaders(GetToolchainNaClInclude('pnacl', pnacldir, 'x86'), | 580 InstallNaClHeaders(GetToolchainNaClInclude('pnacl', pnacldir, 'x86'), |
| 587 pepper_ver, | 581 pepper_ver, |
| 588 'newlib') | 582 'newlib') |
| 589 | 583 |
| 590 | 584 |
| 591 def BuildStepCopyBuildHelpers(pepperdir, platform): | 585 def BuildStepCopyBuildHelpers(pepperdir, platform): |
| 592 buildbot_common.BuildStep('Copy build helpers') | 586 buildbot_common.BuildStep('Copy build helpers') |
| 593 buildbot_common.CopyDir(os.path.join(SDK_SRC_DIR, 'tools', '*.py'), | 587 buildbot_common.CopyDir(os.path.join(SDK_SRC_DIR, 'tools', '*.py'), |
| 594 os.path.join(pepperdir, 'tools')) | 588 os.path.join(pepperdir, 'tools')) |
| 595 if platform == 'win': | 589 if platform == 'win': |
| 596 buildbot_common.BuildStep('Add MAKE') | 590 buildbot_common.BuildStep('Add MAKE') |
| 597 http_download.HttpDownload(GSTORE + MAKE, | 591 http_download.HttpDownload(GSTORE + MAKE, |
| 598 os.path.join(pepperdir, 'tools', 'make.exe')) | 592 os.path.join(pepperdir, 'tools', 'make.exe')) |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 921 | 915 |
| 922 BuildStepCleanPepperDirs(pepperdir, pepperdir_old) | 916 BuildStepCleanPepperDirs(pepperdir, pepperdir_old) |
| 923 BuildStepMakePepperDirs(pepperdir, ['include', 'toolchain', 'tools']) | 917 BuildStepMakePepperDirs(pepperdir, ['include', 'toolchain', 'tools']) |
| 924 | 918 |
| 925 if not options.skip_toolchain: | 919 if not options.skip_toolchain: |
| 926 BuildStepDownloadToolchains(platform) | 920 BuildStepDownloadToolchains(platform) |
| 927 BuildStepUntarToolchains(pepperdir, platform, arch, toolchains) | 921 BuildStepUntarToolchains(pepperdir, platform, arch, toolchains) |
| 928 | 922 |
| 929 BuildStepCopyTextFiles(pepperdir, pepper_ver, clnumber) | 923 BuildStepCopyTextFiles(pepperdir, pepper_ver, clnumber) |
| 930 BuildStepBuildToolchains(pepperdir, platform, pepper_ver, toolchains) | 924 BuildStepBuildToolchains(pepperdir, platform, pepper_ver, toolchains) |
| 931 InstallHeaders(os.path.join(pepperdir, 'include'), None, 'libs') | 925 InstallCommonHeaders(os.path.join(pepperdir, 'include')) |
| 932 BuildStepCopyBuildHelpers(pepperdir, platform) | 926 BuildStepCopyBuildHelpers(pepperdir, platform) |
| 933 BuildStepCopyExamples(pepperdir, toolchains, options.build_experimental, True) | 927 BuildStepCopyExamples(pepperdir, toolchains, options.build_experimental, True) |
| 934 | 928 |
| 935 # Ship with libraries prebuilt, so run that first. | 929 # Ship with libraries prebuilt, so run that first. |
| 936 BuildStepBuildLibraries(pepperdir, platform, 'src') | 930 BuildStepBuildLibraries(pepperdir, platform, 'src') |
| 937 BuildStepGenerateNotice(pepperdir) | 931 BuildStepGenerateNotice(pepperdir) |
| 938 | 932 |
| 939 if not options.skip_tar: | 933 if not options.skip_tar: |
| 940 BuildStepTarBundle(pepper_ver, tarfile) | 934 BuildStepTarBundle(pepper_ver, tarfile) |
| 941 | 935 |
| 942 if options.run_tests: | 936 if options.run_tests: |
| 943 BuildStepRunTests() | 937 BuildStepRunTests() |
| 944 | 938 |
| 945 # Archive on non-trybots. | 939 # Archive on non-trybots. |
| 946 if options.archive: | 940 if options.archive: |
| 947 BuildStepArchiveBundle(pepper_ver, clnumber, tarfile) | 941 BuildStepArchiveBundle(pepper_ver, clnumber, tarfile) |
| 948 BuildStepArchiveSDKTools() | 942 BuildStepArchiveSDKTools() |
| 949 | 943 |
| 950 return 0 | 944 return 0 |
| 951 | 945 |
| 952 | 946 |
| 953 if __name__ == '__main__': | 947 if __name__ == '__main__': |
| 954 sys.exit(main(sys.argv)) | 948 sys.exit(main(sys.argv)) |
| OLD | NEW |