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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 buildbot_common.ErrorExit('Unknown architecture %s.' % arch) | 163 buildbot_common.ErrorExit('Unknown architecture %s.' % arch) |
164 return os.path.join(tcpath, 'translator', arch, 'lib') | 164 return os.path.join(tcpath, 'translator', arch, 'lib') |
165 | 165 |
166 | 166 |
167 def BuildStepDownloadToolchains(toolchains): | 167 def BuildStepDownloadToolchains(toolchains): |
168 buildbot_common.BuildStep('Running package_version.py') | 168 buildbot_common.BuildStep('Running package_version.py') |
169 args = [sys.executable, PKGVER, '--mode', 'nacl_core_sdk'] | 169 args = [sys.executable, PKGVER, '--mode', 'nacl_core_sdk'] |
170 if 'bionic' in toolchains: | 170 if 'bionic' in toolchains: |
171 build_platform = '%s_x86' % getos.GetPlatform() | 171 build_platform = '%s_x86' % getos.GetPlatform() |
172 args.extend(['--append', os.path.join(build_platform, 'nacl_arm_bionic')]) | 172 args.extend(['--append', os.path.join(build_platform, 'nacl_arm_bionic')]) |
173 args.append('sync') | 173 args.extend(['sync', '--extract']) |
174 buildbot_common.Run(args, cwd=NACL_DIR) | 174 buildbot_common.Run(args, cwd=NACL_DIR) |
175 | 175 |
176 | 176 |
177 def BuildStepCleanPepperDirs(pepperdir, pepperdir_old): | 177 def BuildStepCleanPepperDirs(pepperdir, pepperdir_old): |
178 buildbot_common.BuildStep('Clean Pepper Dirs') | 178 buildbot_common.BuildStep('Clean Pepper Dirs') |
179 buildbot_common.RemoveDir(pepperdir_old) | 179 buildbot_common.RemoveDir(pepperdir_old) |
180 buildbot_common.RemoveDir(pepperdir) | 180 buildbot_common.RemoveDir(pepperdir) |
181 buildbot_common.MakeDir(pepperdir) | 181 buildbot_common.MakeDir(pepperdir) |
182 | 182 |
183 | 183 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 # ones | 336 # ones |
337 tc_name = 'newlib' | 337 tc_name = 'newlib' |
338 | 338 |
339 InstallFiles(SRC_DIR, tc_dst_inc, NACL_HEADER_MAP[tc_name]) | 339 InstallFiles(SRC_DIR, tc_dst_inc, NACL_HEADER_MAP[tc_name]) |
340 | 340 |
341 | 341 |
342 def MakeNinjaRelPath(path): | 342 def MakeNinjaRelPath(path): |
343 return os.path.join(os.path.relpath(OUT_DIR, SRC_DIR), path) | 343 return os.path.join(os.path.relpath(OUT_DIR, SRC_DIR), path) |
344 | 344 |
345 | 345 |
| 346 # TODO(ncbray): stop building and copying libraries into the SDK that are |
| 347 # already provided by the toolchain. |
346 TOOLCHAIN_LIBS = { | 348 TOOLCHAIN_LIBS = { |
347 'bionic' : [ | 349 'bionic' : [ |
348 'libminidump_generator.a', | 350 'libminidump_generator.a', |
349 'libnacl_dyncode.a', | 351 'libnacl_dyncode.a', |
350 'libnacl_exception.a', | 352 'libnacl_exception.a', |
351 'libnacl_list_mappings.a', | 353 'libnacl_list_mappings.a', |
352 'libppapi.a', | 354 'libppapi.a', |
353 ], | 355 ], |
354 'newlib' : [ | 356 'newlib' : [ |
355 'crti.o', | |
356 'crtn.o', | |
357 'libminidump_generator.a', | 357 'libminidump_generator.a', |
358 'libnacl.a', | 358 'libnacl.a', |
359 'libnacl_dyncode.a', | 359 'libnacl_dyncode.a', |
360 'libnacl_exception.a', | 360 'libnacl_exception.a', |
361 'libnacl_list_mappings.a', | 361 'libnacl_list_mappings.a', |
362 'libnosys.a', | 362 'libnosys.a', |
363 'libppapi.a', | 363 'libppapi.a', |
364 'libppapi_stub.a', | 364 'libppapi_stub.a', |
365 'libpthread.a', | 365 'libpthread.a', |
366 ], | 366 ], |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 for xarch in xarches: | 457 for xarch in xarches: |
458 src_dir = GetGypBuiltLib(tc, xarch) | 458 src_dir = GetGypBuiltLib(tc, xarch) |
459 dst_dir = GetOutputToolchainLib(pepperdir, tc, xarch) | 459 dst_dir = GetOutputToolchainLib(pepperdir, tc, xarch) |
460 InstallFiles(src_dir, dst_dir, TOOLCHAIN_LIBS[tc]) | 460 InstallFiles(src_dir, dst_dir, TOOLCHAIN_LIBS[tc]) |
461 | 461 |
462 # Copy ARM newlib components to bionic | 462 # Copy ARM newlib components to bionic |
463 if tc == 'newlib' and xarch == 'arm' and 'bionic' in toolchains: | 463 if tc == 'newlib' and xarch == 'arm' and 'bionic' in toolchains: |
464 bionic_dir = GetOutputToolchainLib(pepperdir, 'bionic', xarch) | 464 bionic_dir = GetOutputToolchainLib(pepperdir, 'bionic', xarch) |
465 InstallFiles(src_dir, bionic_dir, TOOLCHAIN_LIBS['bionic']) | 465 InstallFiles(src_dir, bionic_dir, TOOLCHAIN_LIBS['bionic']) |
466 | 466 |
467 if tc != 'pnacl': | |
468 src_dir = GetGypToolchainLib(tc, xarch) | |
469 InstallFiles(src_dir, dst_dir, ['crt1.o']) | |
470 | |
471 | 467 |
472 def GypNinjaBuild_NaCl(rel_out_dir): | 468 def GypNinjaBuild_NaCl(rel_out_dir): |
473 # TODO(binji): gyp_nacl doesn't build properly on Windows anymore; it only | 469 # TODO(binji): gyp_nacl doesn't build properly on Windows anymore; it only |
474 # can use VS2010, not VS2013 which is now required by the Chromium repo. NaCl | 470 # can use VS2010, not VS2013 which is now required by the Chromium repo. NaCl |
475 # needs to be updated to perform the same logic as Chromium in detecting VS, | 471 # needs to be updated to perform the same logic as Chromium in detecting VS, |
476 # which can now exist in the depot_tools directory. | 472 # which can now exist in the depot_tools directory. |
477 # See https://code.google.com/p/nativeclient/issues/detail?id=4022 | 473 # See https://code.google.com/p/nativeclient/issues/detail?id=4022 |
478 # | 474 # |
479 # For now, let's use gyp_chromium to build these components. | 475 # For now, let's use gyp_chromium to build these components. |
480 # gyp_py = os.path.join(NACL_DIR, 'build', 'gyp_nacl') | 476 # gyp_py = os.path.join(NACL_DIR, 'build', 'gyp_nacl') |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 BuildStepArchiveSDKTools() | 1099 BuildStepArchiveSDKTools() |
1104 | 1100 |
1105 return 0 | 1101 return 0 |
1106 | 1102 |
1107 | 1103 |
1108 if __name__ == '__main__': | 1104 if __name__ == '__main__': |
1109 try: | 1105 try: |
1110 sys.exit(main(sys.argv[1:])) | 1106 sys.exit(main(sys.argv[1:])) |
1111 except KeyboardInterrupt: | 1107 except KeyboardInterrupt: |
1112 buildbot_common.ErrorExit('build_sdk: interrupted') | 1108 buildbot_common.ErrorExit('build_sdk: interrupted') |
OLD | NEW |