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
4 # found in the LICENSE file.
6 """Entry point for both build and try bots.
8 This script is invoked from XXX, usually without arguments
9 to package an SDK. It automatically determines whether
10 this SDK is for mac, win, linux.
12 The script inspects the following environment variables:
14 BUILDBOT_BUILDERNAME to determine whether the script is run locally
15 and whether it should upload an SDK to file storage (GSTORE)
18 # pylint: disable=W0621
28 if sys
.version_info
< (2, 7, 0):
29 sys
.stderr
.write("python 2.7 or later is required run this script\n")
33 import buildbot_common
37 import generate_notice
40 import verify_filelist
42 from build_paths
import SCRIPT_DIR
, SDK_SRC_DIR
, SRC_DIR
, NACL_DIR
, OUT_DIR
43 from build_paths
import NACLPORTS_DIR
, GSTORE
, GONACL_APPENGINE_SRC_DIR
45 # Add SDK make tools scripts to the python path.
46 sys
.path
.append(os
.path
.join(SDK_SRC_DIR
, 'tools'))
47 sys
.path
.append(os
.path
.join(NACL_DIR
, 'build'))
52 BUILD_DIR
= os
.path
.join(NACL_DIR
, 'build')
53 NACL_TOOLCHAIN_DIR
= os
.path
.join(NACL_DIR
, 'toolchain')
54 NACL_TOOLCHAINTARS_DIR
= os
.path
.join(NACL_TOOLCHAIN_DIR
, '.tars')
56 CYGTAR
= os
.path
.join(BUILD_DIR
, 'cygtar.py')
57 PKGVER
= os
.path
.join(BUILD_DIR
, 'package_version', 'package_version.py')
59 NACLPORTS_URL
= 'https://chromium.googlesource.com/external/naclports.git'
60 NACLPORTS_REV
= 'e53078c33d99b0b3cbadbbbbb92cccf7a48d5dc1'
62 GYPBUILD_DIR
= 'gypbuild'
66 # Map of: ToolchainName: (PackageName, SDKDir).
67 TOOLCHAIN_PACKAGE_MAP
= {
68 'newlib': ('nacl_x86_newlib', '%(platform)s_x86_newlib'),
69 'bionic': ('nacl_arm_bionic', '%(platform)s_arm_bionic'),
70 'arm': ('nacl_arm_newlib', '%(platform)s_arm_newlib'),
71 'glibc': ('nacl_x86_glibc', '%(platform)s_x86_glibc'),
72 'pnacl': ('pnacl_newlib', '%(platform)s_pnacl')
76 def GetToolchainNaClInclude(tcname
, tcpath
, arch
):
78 return os
.path
.join(tcpath
, 'x86_64-nacl', 'include')
80 return os
.path
.join(tcpath
, 'le32-nacl', 'include')
82 return os
.path
.join(tcpath
, 'arm-nacl', 'include')
84 buildbot_common
.ErrorExit('Unknown architecture: %s' % arch
)
87 def GetConfigDir(arch
):
88 if arch
.endswith('x64') and getos
.GetPlatform() == 'win':
94 def GetNinjaOutDir(arch
):
95 return os
.path
.join(OUT_DIR
, GYPBUILD_DIR
+ '-' + arch
, GetConfigDir(arch
))
98 def GetGypBuiltLib(tcname
, arch
):
108 if tcname
== 'pnacl':
112 tcname
= 'pnacl_newlib'
114 arch
= 'clang-' + arch
117 return os
.path
.join(GetNinjaOutDir(arch
),
123 def GetToolchainNaClLib(tcname
, tcpath
, arch
):
125 return os
.path
.join(tcpath
, 'x86_64-nacl', 'lib32')
127 return os
.path
.join(tcpath
, 'x86_64-nacl', 'lib')
129 return os
.path
.join(tcpath
, 'arm-nacl', 'lib')
130 elif tcname
== 'pnacl':
131 return os
.path
.join(tcpath
, 'le32-nacl', 'lib')
134 def GetToolchainDirName(tcname
, arch
):
135 if tcname
== 'pnacl':
136 return '%s_%s' % (getos
.GetPlatform(), tcname
)
138 return '%s_arm_%s' % (getos
.GetPlatform(), tcname
)
140 return '%s_x86_%s' % (getos
.GetPlatform(), tcname
)
143 def GetGypToolchainLib(tcname
, arch
):
149 tcpath
= os
.path
.join(GetNinjaOutDir(arch
), 'gen', 'sdk',
150 '%s_x86' % getos
.GetPlatform(),
151 TOOLCHAIN_PACKAGE_MAP
[toolchain
][0])
152 return GetToolchainNaClLib(tcname
, tcpath
, arch
)
155 def GetOutputToolchainLib(pepperdir
, tcname
, arch
):
156 tcpath
= os
.path
.join(pepperdir
, 'toolchain',
157 GetToolchainDirName(tcname
, arch
))
158 return GetToolchainNaClLib(tcname
, tcpath
, arch
)
161 def GetPNaClTranslatorLib(tcpath
, arch
):
162 if arch
not in ['arm', 'x86-32', 'x86-64']:
163 buildbot_common
.ErrorExit('Unknown architecture %s.' % arch
)
164 return os
.path
.join(tcpath
, 'translator', arch
, 'lib')
167 def BuildStepDownloadToolchains(toolchains
):
168 buildbot_common
.BuildStep('Running package_version.py')
169 args
= [sys
.executable
, PKGVER
, '--mode', 'nacl_core_sdk']
170 if 'bionic' in toolchains
:
171 build_platform
= '%s_x86' % getos
.GetPlatform()
172 args
.extend(['--append', os
.path
.join(build_platform
, 'nacl_arm_bionic')])
173 if getos
.GetPlatform() == 'linux':
174 # TODO(sbc): remove this once this change makes it into chrome
175 # https://codereview.chromium.org/1080513003/
176 args
.extend(['--append', 'arm_trusted'])
177 args
.extend(['sync', '--extract'])
178 buildbot_common
.Run(args
, cwd
=NACL_DIR
)
181 def BuildStepCleanPepperDirs(pepperdir
, pepperdir_old
):
182 buildbot_common
.BuildStep('Clean Pepper Dirs')
186 os
.path
.join(OUT_DIR
, 'arm_trusted')
188 for dirname
in dirs_to_remove
:
189 if os
.path
.exists(dirname
):
190 buildbot_common
.RemoveDir(dirname
)
191 buildbot_common
.MakeDir(pepperdir
)
194 def BuildStepMakePepperDirs(pepperdir
, subdirs
):
195 for subdir
in subdirs
:
196 buildbot_common
.MakeDir(os
.path
.join(pepperdir
, subdir
))
203 'getting_started/README',
206 def BuildStepCopyTextFiles(pepperdir
, pepper_ver
, chrome_revision
,
208 buildbot_common
.BuildStep('Add Text Files')
209 InstallFiles(SDK_SRC_DIR
, pepperdir
, TEXT_FILES
)
211 # Replace a few placeholders in README
212 readme_text
= open(os
.path
.join(SDK_SRC_DIR
, 'README')).read()
213 readme_text
= readme_text
.replace('${VERSION}', pepper_ver
)
214 readme_text
= readme_text
.replace('${CHROME_REVISION}', chrome_revision
)
215 readme_text
= readme_text
.replace('${CHROME_COMMIT_POSITION}',
216 build_version
.ChromeCommitPosition())
217 readme_text
= readme_text
.replace('${NACL_REVISION}', nacl_revision
)
219 # Year/Month/Day Hour:Minute:Second
220 time_format
= '%Y/%m/%d %H:%M:%S'
221 readme_text
= readme_text
.replace('${DATE}',
222 datetime
.datetime
.now().strftime(time_format
))
224 open(os
.path
.join(pepperdir
, 'README'), 'w').write(readme_text
)
227 def BuildStepUntarToolchains(pepperdir
, toolchains
):
228 buildbot_common
.BuildStep('Untar Toolchains')
229 platform
= getos
.GetPlatform()
230 build_platform
= '%s_x86' % platform
231 tmpdir
= os
.path
.join(OUT_DIR
, 'tc_temp')
232 buildbot_common
.RemoveDir(tmpdir
)
233 buildbot_common
.MakeDir(tmpdir
)
235 # Create a list of extract packages tuples, the first part should be
236 # "$PACKAGE_TARGET/$PACKAGE". The second part should be the destination
237 # directory relative to pepperdir/toolchain.
238 extract_packages
= []
239 for toolchain
in toolchains
:
240 toolchain_map
= TOOLCHAIN_PACKAGE_MAP
.get(toolchain
, None)
242 package_name
, tcname
= toolchain_map
243 package_tuple
= (os
.path
.join(build_platform
, package_name
),
244 tcname
% {'platform': platform
})
245 extract_packages
.append(package_tuple
)
248 # On linux we also want to extract the arm_trusted package which contains
249 # the ARM libraries we ship in support of sel_ldr_arm.
250 if platform
== 'linux':
251 extract_packages
.append((os
.path
.join(build_platform
, 'arm_trusted'),
254 # Extract all of the packages into the temp directory.
255 package_names
= [package_tuple
[0] for package_tuple
in extract_packages
]
256 buildbot_common
.Run([sys
.executable
, PKGVER
,
257 '--packages', ','.join(package_names
),
258 '--tar-dir', NACL_TOOLCHAINTARS_DIR
,
259 '--dest-dir', tmpdir
,
262 # Move all the packages we extracted to the correct destination.
263 for package_name
, dest_dir
in extract_packages
:
264 full_src_dir
= os
.path
.join(tmpdir
, package_name
)
265 full_dst_dir
= os
.path
.join(pepperdir
, 'toolchain', dest_dir
)
266 buildbot_common
.Move(full_src_dir
, full_dst_dir
)
268 # Cleanup the temporary directory we are no longer using.
269 buildbot_common
.RemoveDir(tmpdir
)
272 # List of toolchain headers to install.
273 # Source is relative to top of Chromium tree, destination is relative
274 # to the toolchain header directory.
277 ('native_client/src/include/nacl/nacl_exception.h', 'nacl/'),
278 ('native_client/src/include/nacl/nacl_minidump.h', 'nacl/'),
279 ('native_client/src/untrusted/irt/irt.h', ''),
280 ('native_client/src/untrusted/irt/irt_dev.h', ''),
281 ('native_client/src/untrusted/nacl/nacl_dyncode.h', 'nacl/'),
282 ('native_client/src/untrusted/nacl/nacl_startup.h', 'nacl/'),
283 ('native_client/src/untrusted/pthread/pthread.h', ''),
284 ('native_client/src/untrusted/pthread/semaphore.h', ''),
285 ('native_client/src/untrusted/valgrind/dynamic_annotations.h', 'nacl/'),
286 ('ppapi/nacl_irt/public/irt_ppapi.h', ''),
289 ('native_client/src/include/nacl/nacl_exception.h', 'nacl/'),
290 ('native_client/src/include/nacl/nacl_minidump.h', 'nacl/'),
291 ('native_client/src/untrusted/irt/irt.h', ''),
292 ('native_client/src/untrusted/irt/irt_dev.h', ''),
293 ('native_client/src/untrusted/nacl/nacl_dyncode.h', 'nacl/'),
294 ('native_client/src/untrusted/nacl/nacl_startup.h', 'nacl/'),
295 ('native_client/src/untrusted/valgrind/dynamic_annotations.h', 'nacl/'),
296 ('ppapi/nacl_irt/public/irt_ppapi.h', ''),
299 ('ppapi/nacl_irt/public/irt_ppapi.h', ''),
304 def InstallFiles(src_root
, dest_root
, file_list
):
305 """Copy a set of files from src_root to dest_root according
306 to the given mapping. This allows files to be copied from
307 to a location in the destination tree that is different to the
308 location in the source tree.
310 If the destination mapping ends with a '/' then the destination
311 basename is inherited from the the source file.
313 Wildcards can be used in the source list but it is not recommended
314 as this can end up adding things to the SDK unintentionally.
316 for file_spec
in file_list
:
317 # The list of files to install can be a simple list of
318 # strings or a list of pairs, where each pair corresponds
319 # to a mapping from source to destination names.
320 if type(file_spec
) == str:
321 src_file
= dest_file
= file_spec
323 src_file
, dest_file
= file_spec
325 src_file
= os
.path
.join(src_root
, src_file
)
327 # Expand sources files using glob.
328 sources
= glob
.glob(src_file
)
332 if len(sources
) > 1 and not dest_file
.endswith('/'):
333 buildbot_common
.ErrorExit("Target file must end in '/' when "
334 "using globbing to install multiple files")
336 for source
in sources
:
337 if dest_file
.endswith('/'):
338 dest
= os
.path
.join(dest_file
, os
.path
.basename(source
))
341 dest
= os
.path
.join(dest_root
, dest
)
342 if not os
.path
.isdir(os
.path
.dirname(dest
)):
343 buildbot_common
.MakeDir(os
.path
.dirname(dest
))
344 buildbot_common
.CopyFile(source
, dest
)
347 def InstallNaClHeaders(tc_dst_inc
, tc_name
):
348 """Copies NaCl headers to expected locations in the toolchain."""
349 if tc_name
in ('arm', 'pnacl'):
350 # arm and pnacl toolchain headers should be the same as the newlib
354 InstallFiles(SRC_DIR
, tc_dst_inc
, NACL_HEADER_MAP
[tc_name
])
357 def MakeNinjaRelPath(path
):
358 return os
.path
.join(os
.path
.relpath(OUT_DIR
, SRC_DIR
), path
)
361 # TODO(ncbray): stop building and copying libraries into the SDK that are
362 # already provided by the toolchain.
365 'libminidump_generator.a',
367 'libnacl_exception.a',
368 'libnacl_list_mappings.a',
372 'libminidump_generator.a',
375 'libnacl_exception.a',
376 'libnacl_list_mappings.a',
383 'libminidump_generator.a',
384 'libminidump_generator.so',
387 'libnacl_dyncode.so',
388 'libnacl_exception.a',
389 'libnacl_exception.so',
390 'libnacl_list_mappings.a',
391 'libnacl_list_mappings.so',
397 'libminidump_generator.a',
400 'libnacl_exception.a',
401 'libnacl_list_mappings.a',
410 def GypNinjaInstall(pepperdir
, toolchains
):
412 ['sel_ldr', 'sel_ldr_x86_32'],
413 ['irt_core_newlib_x32.nexe', 'irt_core_x86_32.nexe'],
414 ['irt_core_newlib_x64.nexe', 'irt_core_x86_64.nexe'],
419 platform
= getos
.GetPlatform()
421 # TODO(binji): dump_syms doesn't currently build on Windows. See
422 # http://crbug.com/245456
423 if platform
!= 'win':
425 ['dump_syms', 'dump_syms'],
426 ['minidump_dump', 'minidump_dump'],
427 ['minidump_stackwalk', 'minidump_stackwalk']
430 tools_files_64
.append(['sel_ldr', 'sel_ldr_x86_64'])
431 tools_files_64
.append(['ncval_new', 'ncval'])
433 if platform
== 'linux':
434 tools_files_32
.append(['nacl_helper_bootstrap',
435 'nacl_helper_bootstrap_x86_32'])
436 tools_files_64
.append(['nacl_helper_bootstrap',
437 'nacl_helper_bootstrap_x86_64'])
438 tools_files_32
.append(['nonsfi_loader_newlib_x32_nonsfi.nexe',
439 'nonsfi_loader_x86_32'])
441 tools_dir
= os
.path
.join(pepperdir
, 'tools')
442 buildbot_common
.MakeDir(tools_dir
)
444 # Add .exe extensions to all windows tools
445 for pair
in tools_files_32
+ tools_files_64
:
446 if platform
== 'win' and not pair
[0].endswith('.nexe'):
450 InstallFiles(GetNinjaOutDir('x64'), tools_dir
, tools_files_64
)
451 InstallFiles(GetNinjaOutDir('ia32'), tools_dir
, tools_files_32
)
454 if platform
== 'linux' and not options
.no_arm_trusted
:
456 ['irt_core_newlib_arm.nexe', 'irt_core_arm.nexe'],
457 ['irt_core_newlib_arm.nexe', 'irt_core_arm.nexe'],
458 ['nacl_helper_bootstrap', 'nacl_helper_bootstrap_arm'],
459 ['nonsfi_loader_newlib_arm_nonsfi.nexe', 'nonsfi_loader_arm'],
460 ['sel_ldr', 'sel_ldr_arm']
462 InstallFiles(GetNinjaOutDir('arm'), tools_dir
, arm_files
)
464 for tc
in set(toolchains
) & set(['newlib', 'glibc', 'pnacl']):
466 xarches
= (None, 'ia32', 'x64', 'arm')
468 xarches
= ('ia32', 'x64')
470 xarches
= ('arm', 'ia32', 'x64')
472 for xarch
in xarches
:
473 src_dir
= GetGypBuiltLib(tc
, xarch
)
474 dst_dir
= GetOutputToolchainLib(pepperdir
, tc
, xarch
)
475 InstallFiles(src_dir
, dst_dir
, TOOLCHAIN_LIBS
[tc
])
477 # Copy ARM newlib components to bionic
478 if tc
== 'newlib' and xarch
== 'arm' and 'bionic' in toolchains
:
479 bionic_dir
= GetOutputToolchainLib(pepperdir
, 'bionic', xarch
)
480 InstallFiles(src_dir
, bionic_dir
, TOOLCHAIN_LIBS
['bionic'])
483 def GypNinjaBuild_NaCl(rel_out_dir
):
484 # TODO(binji): gyp_nacl doesn't build properly on Windows anymore; it only
485 # can use VS2010, not VS2013 which is now required by the Chromium repo. NaCl
486 # needs to be updated to perform the same logic as Chromium in detecting VS,
487 # which can now exist in the depot_tools directory.
488 # See https://code.google.com/p/nativeclient/issues/detail?id=4022
490 # For now, let's use gyp_chromium to build these components.
491 # gyp_py = os.path.join(NACL_DIR, 'build', 'gyp_nacl')
492 gyp_py
= os
.path
.join(SRC_DIR
, 'build', 'gyp_chromium')
493 nacl_core_sdk_gyp
= os
.path
.join(NACL_DIR
, 'build', 'nacl_core_sdk.gyp')
494 all_gyp
= os
.path
.join(NACL_DIR
, 'build', 'all.gyp')
496 out_dir_32
= MakeNinjaRelPath(rel_out_dir
+ '-ia32')
497 out_dir_64
= MakeNinjaRelPath(rel_out_dir
+ '-x64')
498 out_dir_arm
= MakeNinjaRelPath(rel_out_dir
+ '-arm')
499 out_dir_clang_32
= MakeNinjaRelPath(rel_out_dir
+ '-clang-ia32')
500 out_dir_clang_64
= MakeNinjaRelPath(rel_out_dir
+ '-clang-x64')
501 out_dir_clang_arm
= MakeNinjaRelPath(rel_out_dir
+ '-clang-arm')
503 GypNinjaBuild('ia32', gyp_py
, nacl_core_sdk_gyp
, 'nacl_core_sdk', out_dir_32
)
504 GypNinjaBuild('x64', gyp_py
, nacl_core_sdk_gyp
, 'nacl_core_sdk', out_dir_64
)
505 GypNinjaBuild('arm', gyp_py
, nacl_core_sdk_gyp
, 'nacl_core_sdk', out_dir_arm
)
506 GypNinjaBuild('ia32', gyp_py
, nacl_core_sdk_gyp
, 'nacl_core_sdk',
507 out_dir_clang_32
, gyp_defines
=['use_nacl_clang=1'])
508 GypNinjaBuild('x64', gyp_py
, nacl_core_sdk_gyp
, 'nacl_core_sdk',
509 out_dir_clang_64
, gyp_defines
=['use_nacl_clang=1'])
510 GypNinjaBuild('arm', gyp_py
, nacl_core_sdk_gyp
, 'nacl_core_sdk',
511 out_dir_clang_arm
, gyp_defines
=['use_nacl_clang=1'])
512 GypNinjaBuild('x64', gyp_py
, all_gyp
, 'ncval_new', out_dir_64
)
515 def GypNinjaBuild_Breakpad(rel_out_dir
):
516 # TODO(binji): dump_syms doesn't currently build on Windows. See
517 # http://crbug.com/245456
518 if getos
.GetPlatform() == 'win':
521 gyp_py
= os
.path
.join(SRC_DIR
, 'build', 'gyp_chromium')
522 out_dir
= MakeNinjaRelPath(rel_out_dir
)
523 gyp_file
= os
.path
.join(SRC_DIR
, 'breakpad', 'breakpad.gyp')
524 build_list
= ['dump_syms', 'minidump_dump', 'minidump_stackwalk']
525 GypNinjaBuild('x64', gyp_py
, gyp_file
, build_list
, out_dir
)
528 def GypNinjaBuild_PPAPI(arch
, rel_out_dir
, gyp_defines
=None):
529 gyp_py
= os
.path
.join(SRC_DIR
, 'build', 'gyp_chromium')
530 out_dir
= MakeNinjaRelPath(rel_out_dir
)
531 gyp_file
= os
.path
.join(SRC_DIR
, 'ppapi', 'native_client',
533 GypNinjaBuild(arch
, gyp_py
, gyp_file
, 'ppapi_lib', out_dir
,
534 gyp_defines
=gyp_defines
)
537 def GypNinjaBuild_Pnacl(rel_out_dir
, target_arch
):
538 # TODO(binji): This will build the pnacl_irt_shim twice; once as part of the
539 # Chromium build, and once here. When we move more of the SDK build process
540 # to gyp, we can remove this.
541 gyp_py
= os
.path
.join(SRC_DIR
, 'build', 'gyp_chromium')
543 out_dir
= MakeNinjaRelPath(rel_out_dir
)
544 gyp_file
= os
.path
.join(SRC_DIR
, 'ppapi', 'native_client', 'src',
545 'untrusted', 'pnacl_irt_shim', 'pnacl_irt_shim.gyp')
547 GypNinjaBuild(target_arch
, gyp_py
, gyp_file
, targets
, out_dir
)
550 def GypNinjaBuild(arch
, gyp_py_script
, gyp_file
, targets
,
551 out_dir
, force_arm_gcc
=True, gyp_defines
=None):
552 gyp_env
= dict(os
.environ
)
553 gyp_env
['GYP_GENERATORS'] = 'ninja'
554 gyp_defines
= gyp_defines
or []
555 gyp_defines
.append('nacl_allow_thin_archives=0')
557 gyp_defines
.append('mac_sdk=%s' % options
.mac_sdk
)
560 gyp_defines
.append('target_arch=%s' % arch
)
562 gyp_env
['GYP_CROSSCOMPILE'] = '1'
563 gyp_defines
.append('arm_float_abi=hard')
564 if options
.no_arm_trusted
:
565 gyp_defines
.append('disable_cross_trusted=1')
566 if getos
.GetPlatform() == 'mac':
567 gyp_defines
.append('clang=1')
569 gyp_env
['GYP_DEFINES'] = ' '.join(gyp_defines
)
570 # We can't use windows path separators in GYP_GENERATOR_FLAGS since
571 # gyp uses shlex to parse them and treats '\' as an escape char.
572 gyp_env
['GYP_GENERATOR_FLAGS'] = 'output_dir=%s' % out_dir
.replace('\\', '/')
574 # Print relevant environment variables
575 for key
, value
in gyp_env
.iteritems():
576 if key
.startswith('GYP') or key
in ('CC',):
577 print ' %s="%s"' % (key
, value
)
580 [sys
.executable
, gyp_py_script
, gyp_file
, '--depth=.'],
584 NinjaBuild(targets
, out_dir
, arch
)
587 def NinjaBuild(targets
, out_dir
, arch
):
588 if type(targets
) is not list:
590 out_config_dir
= os
.path
.join(out_dir
, GetConfigDir(arch
))
591 buildbot_common
.Run(['ninja', '-C', out_config_dir
] + targets
, cwd
=SRC_DIR
)
594 def BuildStepBuildToolchains(pepperdir
, toolchains
, build
, clean
):
595 buildbot_common
.BuildStep('SDK Items')
598 for dirname
in glob
.glob(os
.path
.join(OUT_DIR
, GYPBUILD_DIR
+ '*')):
599 buildbot_common
.RemoveDir(dirname
)
603 GypNinjaBuild_NaCl(GYPBUILD_DIR
)
604 GypNinjaBuild_Breakpad(GYPBUILD_DIR
+ '-x64')
606 if set(toolchains
) & set(['glibc', 'newlib']):
607 GypNinjaBuild_PPAPI('ia32', GYPBUILD_DIR
+ '-ia32')
608 GypNinjaBuild_PPAPI('x64', GYPBUILD_DIR
+ '-x64')
610 if 'arm' in toolchains
:
611 GypNinjaBuild_PPAPI('arm', GYPBUILD_DIR
+ '-arm')
613 if 'pnacl' in toolchains
:
614 GypNinjaBuild_PPAPI('ia32', GYPBUILD_DIR
+ '-clang-ia32',
615 ['use_nacl_clang=1'])
616 GypNinjaBuild_PPAPI('x64', GYPBUILD_DIR
+ '-clang-x64',
617 ['use_nacl_clang=1'])
618 GypNinjaBuild_PPAPI('arm', GYPBUILD_DIR
+ '-clang-arm',
619 ['use_nacl_clang=1'])
621 # NOTE: For ia32, gyp builds both x86-32 and x86-64 by default.
622 for arch
in ('ia32', 'arm'):
623 # Fill in the latest native pnacl shim library from the chrome build.
624 build_dir
= GYPBUILD_DIR
+ '-pnacl-' + arch
625 GypNinjaBuild_Pnacl(build_dir
, arch
)
627 GypNinjaInstall(pepperdir
, toolchains
)
629 platform
= getos
.GetPlatform()
630 newlibdir
= os
.path
.join(pepperdir
, 'toolchain', platform
+ '_x86_newlib')
631 glibcdir
= os
.path
.join(pepperdir
, 'toolchain', platform
+ '_x86_glibc')
632 armdir
= os
.path
.join(pepperdir
, 'toolchain', platform
+ '_arm_newlib')
633 pnacldir
= os
.path
.join(pepperdir
, 'toolchain', platform
+ '_pnacl')
634 bionicdir
= os
.path
.join(pepperdir
, 'toolchain', platform
+ '_arm_bionic')
637 if 'newlib' in toolchains
:
638 InstallNaClHeaders(GetToolchainNaClInclude('newlib', newlibdir
, 'x86'),
641 if 'glibc' in toolchains
:
642 InstallNaClHeaders(GetToolchainNaClInclude('glibc', glibcdir
, 'x86'),
645 if 'arm' in toolchains
:
646 InstallNaClHeaders(GetToolchainNaClInclude('newlib', armdir
, 'arm'),
649 if 'bionic' in toolchains
:
650 InstallNaClHeaders(GetToolchainNaClInclude('bionic', bionicdir
, 'arm'),
653 if 'pnacl' in toolchains
:
654 # NOTE: For ia32, gyp builds both x86-32 and x86-64 by default.
655 for arch
in ('ia32', 'arm'):
656 # Fill in the latest native pnacl shim library from the chrome build.
657 build_dir
= GYPBUILD_DIR
+ '-pnacl-' + arch
659 nacl_arches
= ['x86-32', 'x86-64']
661 nacl_arches
= ['arm']
663 buildbot_common
.ErrorExit('Unknown architecture: %s' % arch
)
664 for nacl_arch
in nacl_arches
:
665 release_build_dir
= os
.path
.join(OUT_DIR
, build_dir
, 'Release',
666 'gen', 'tc_pnacl_translate',
669 pnacl_translator_lib_dir
= GetPNaClTranslatorLib(pnacldir
, nacl_arch
)
670 if not os
.path
.isdir(pnacl_translator_lib_dir
):
671 buildbot_common
.ErrorExit('Expected %s directory to exist.' %
672 pnacl_translator_lib_dir
)
674 buildbot_common
.CopyFile(
675 os
.path
.join(release_build_dir
, 'libpnacl_irt_shim.a'),
676 pnacl_translator_lib_dir
)
678 InstallNaClHeaders(GetToolchainNaClInclude('pnacl', pnacldir
, 'pnacl'),
680 InstallNaClHeaders(GetToolchainNaClInclude('pnacl', pnacldir
, 'x86'),
682 InstallNaClHeaders(GetToolchainNaClInclude('pnacl', pnacldir
, 'arm'),
686 def MakeDirectoryOrClobber(pepperdir
, dirname
, clobber
):
687 dirpath
= os
.path
.join(pepperdir
, dirname
)
689 buildbot_common
.RemoveDir(dirpath
)
690 buildbot_common
.MakeDir(dirpath
)
695 def BuildStepUpdateHelpers(pepperdir
, clobber
):
696 buildbot_common
.BuildStep('Update project helpers')
697 build_projects
.UpdateHelpers(pepperdir
, clobber
=clobber
)
700 def BuildStepUpdateUserProjects(pepperdir
, toolchains
,
701 build_experimental
, clobber
):
702 buildbot_common
.BuildStep('Update examples and libraries')
705 if not build_experimental
:
706 filters
['EXPERIMENTAL'] = False
708 toolchains
= toolchains
[:]
710 # arm isn't a valid toolchain for build_projects
711 if 'arm' in toolchains
:
712 toolchains
.remove('arm')
714 if 'host' in toolchains
:
715 toolchains
.remove('host')
716 toolchains
.append(getos
.GetPlatform())
718 filters
['TOOLS'] = toolchains
720 # Update examples and libraries
729 tree
= parse_dsc
.LoadProjectTree(SDK_SRC_DIR
, include
=filters
)
730 build_projects
.UpdateProjects(pepperdir
, tree
, clobber
=clobber
,
731 toolchains
=toolchains
)
734 def BuildStepMakeAll(pepperdir
, directory
, step_name
,
735 deps
=True, clean
=False, config
='Debug', args
=None):
736 buildbot_common
.BuildStep(step_name
)
737 build_projects
.BuildProjectsBranch(pepperdir
, directory
, clean
,
741 def BuildStepBuildLibraries(pepperdir
, directory
):
742 BuildStepMakeAll(pepperdir
, directory
, 'Build Libraries Debug',
743 clean
=True, config
='Debug')
744 BuildStepMakeAll(pepperdir
, directory
, 'Build Libraries Release',
745 clean
=True, config
='Release')
747 # Cleanup .pyc file generated while building libraries. Without
748 # this we would end up shipping the pyc in the SDK tarball.
749 buildbot_common
.RemoveFile(os
.path
.join(pepperdir
, 'tools', '*.pyc'))
752 def GenerateNotice(fileroot
, output_filename
='NOTICE', extra_files
=None):
753 # Look for LICENSE files
754 license_filenames_re
= re
.compile('LICENSE|COPYING|COPYRIGHT')
757 for root
, _
, files
in os
.walk(fileroot
):
758 for filename
in files
:
759 if license_filenames_re
.match(filename
):
760 path
= os
.path
.join(root
, filename
)
761 license_files
.append(path
)
764 license_files
+= [os
.path
.join(fileroot
, f
) for f
in extra_files
]
765 print '\n'.join(license_files
)
767 if not os
.path
.isabs(output_filename
):
768 output_filename
= os
.path
.join(fileroot
, output_filename
)
769 generate_notice
.Generate(output_filename
, fileroot
, license_files
)
772 def BuildStepVerifyFilelist(pepperdir
):
773 buildbot_common
.BuildStep('Verify SDK Files')
774 file_list_path
= os
.path
.join(SCRIPT_DIR
, 'sdk_files.list')
776 print 'SDK directory: %s' % pepperdir
777 verify_filelist
.Verify(file_list_path
, pepperdir
)
779 except verify_filelist
.ParseException
, e
:
780 buildbot_common
.ErrorExit('Parsing sdk_files.list failed:\n\n%s' % e
)
781 except verify_filelist
.VerifyException
, e
:
782 file_list_rel
= os
.path
.relpath(file_list_path
)
783 verify_filelist_py
= os
.path
.splitext(verify_filelist
.__file
__)[0] + '.py'
784 verify_filelist_py
= os
.path
.relpath(verify_filelist_py
)
785 pepperdir_rel
= os
.path
.relpath(pepperdir
)
788 SDK verification failed:
791 Add/remove files from %s to fix.
795 to test.""" % (e
, file_list_rel
, verify_filelist_py
, file_list_rel
,
797 buildbot_common
.ErrorExit(msg
)
800 def BuildStepTarBundle(pepper_ver
, tarfile
):
801 buildbot_common
.BuildStep('Tar Pepper Bundle')
802 buildbot_common
.MakeDir(os
.path
.dirname(tarfile
))
803 buildbot_common
.Run([sys
.executable
, CYGTAR
, '-C', OUT_DIR
, '-cjf', tarfile
,
804 'pepper_' + pepper_ver
], cwd
=NACL_DIR
)
807 def GetManifestBundle(pepper_ver
, chrome_revision
, nacl_revision
, tarfile
,
809 with
open(tarfile
, 'rb') as tarfile_stream
:
810 archive_sha1
, archive_size
= manifest_util
.DownloadAndComputeHash(
813 archive
= manifest_util
.Archive(manifest_util
.GetHostOS())
814 archive
.url
= archive_url
815 archive
.size
= archive_size
816 archive
.checksum
= archive_sha1
818 bundle
= manifest_util
.Bundle('pepper_' + pepper_ver
)
819 bundle
.revision
= int(chrome_revision
)
820 bundle
.repath
= 'pepper_' + pepper_ver
821 bundle
.version
= int(pepper_ver
)
822 bundle
.description
= (
823 'Chrome %s bundle. Chrome revision: %s. NaCl revision: %s' % (
824 pepper_ver
, chrome_revision
, nacl_revision
))
825 bundle
.stability
= 'dev'
826 bundle
.recommended
= 'no'
827 bundle
.archives
= [archive
]
831 def Archive(filename
, from_directory
, step_link
=True):
832 if buildbot_common
.IsSDKBuilder():
833 bucket_path
= 'nativeclient-mirror/nacl/nacl_sdk/'
835 bucket_path
= 'nativeclient-mirror/nacl/nacl_sdk_test/'
836 bucket_path
+= build_version
.ChromeVersion()
837 buildbot_common
.Archive(filename
, bucket_path
, from_directory
, step_link
)
840 def BuildStepArchiveBundle(name
, pepper_ver
, chrome_revision
, nacl_revision
,
842 buildbot_common
.BuildStep('Archive %s' % name
)
843 tarname
= os
.path
.basename(tarfile
)
844 tarfile_dir
= os
.path
.dirname(tarfile
)
845 Archive(tarname
, tarfile_dir
)
847 # generate "manifest snippet" for this archive.
848 archive_url
= GSTORE
+ 'nacl_sdk/%s/%s' % (
849 build_version
.ChromeVersion(), tarname
)
850 bundle
= GetManifestBundle(pepper_ver
, chrome_revision
, nacl_revision
,
851 tarfile
, archive_url
)
853 manifest_snippet_file
= os
.path
.join(OUT_DIR
, tarname
+ '.json')
854 with
open(manifest_snippet_file
, 'wb') as manifest_snippet_stream
:
855 manifest_snippet_stream
.write(bundle
.GetDataAsString())
857 Archive(tarname
+ '.json', OUT_DIR
, step_link
=False)
860 def BuildStepBuildPNaClComponent(version
, revision
):
861 # Sadly revision can go backwords for a given version since when a version
862 # is built from master, revision will be a huge number (in the hundreds of
863 # thousands. Once the branch happens the revision will reset to zero.
864 # TODO(sbc): figure out how to compensate for this in some way such that
865 # revisions always go forward for a given version.
866 buildbot_common
.BuildStep('PNaCl Component')
867 if len(revision
) > 4:
868 rev_minor
= revision
[-4:]
869 rev_major
= revision
[:-4]
870 version
= "0.%s.%s.%s" % (version
, rev_major
, rev_minor
)
872 version
= "0.%s.0.%s" % (version
, revision
)
873 buildbot_common
.Run(['./make_pnacl_component.sh', version
], cwd
=SCRIPT_DIR
)
876 def BuildStepArchivePNaClComponent():
877 buildbot_common
.BuildStep('Archive PNaCl Component')
878 Archive('pnacl_multicrx.zip', OUT_DIR
)
881 def BuildStepArchiveSDKTools():
882 buildbot_common
.BuildStep('Build SDK Tools')
883 build_updater
.BuildUpdater(OUT_DIR
)
885 buildbot_common
.BuildStep('Archive SDK Tools')
886 Archive('sdk_tools.tgz', OUT_DIR
, step_link
=False)
887 Archive('nacl_sdk.zip', OUT_DIR
, step_link
=False)
890 def BuildStepSyncNaClPorts():
891 """Pull the pinned revision of naclports from SVN."""
892 buildbot_common
.BuildStep('Sync naclports')
894 # In case a previous svn checkout exists, remove it.
895 # TODO(sbc): remove this once all the build machines
896 # have removed the old checkout
897 if (os
.path
.exists(NACLPORTS_DIR
) and
898 not os
.path
.exists(os
.path
.join(NACLPORTS_DIR
, '.git'))):
899 buildbot_common
.RemoveDir(NACLPORTS_DIR
)
901 if not os
.path
.exists(NACLPORTS_DIR
):
902 # checkout new copy of naclports
903 cmd
= ['git', 'clone', NACLPORTS_URL
, 'naclports']
904 buildbot_common
.Run(cmd
, cwd
=os
.path
.dirname(NACLPORTS_DIR
))
906 # checkout new copy of naclports
907 buildbot_common
.Run(['git', 'fetch'], cwd
=NACLPORTS_DIR
)
909 # sync to required revision
910 cmd
= ['git', 'checkout', str(NACLPORTS_REV
)]
911 buildbot_common
.Run(cmd
, cwd
=NACLPORTS_DIR
)
914 def BuildStepBuildNaClPorts(pepper_ver
, pepperdir
):
915 """Build selected naclports in all configurations."""
916 # TODO(sbc): currently naclports doesn't know anything about
917 # Debug builds so the Debug subfolders are all empty.
919 env
= dict(os
.environ
)
920 env
['NACL_SDK_ROOT'] = pepperdir
921 env
['PEPPER_DIR'] = os
.path
.basename(pepperdir
) # pepper_NN
922 env
['NACLPORTS_NO_ANNOTATE'] = "1"
923 env
['NACLPORTS_NO_UPLOAD'] = "1"
924 env
['BUILDBOT_GOT_REVISION'] = str(NACLPORTS_REV
)
926 build_script
= 'build_tools/buildbot_sdk_bundle.sh'
927 buildbot_common
.BuildStep('Build naclports')
929 bundle_dir
= os
.path
.join(NACLPORTS_DIR
, 'out', 'sdk_bundle')
930 out_dir
= os
.path
.join(bundle_dir
, 'pepper_%s' % pepper_ver
)
932 # Remove the sdk_bundle directory to remove stale files from previous builds.
933 buildbot_common
.RemoveDir(bundle_dir
)
935 buildbot_common
.Run([build_script
], env
=env
, cwd
=NACLPORTS_DIR
)
937 # Some naclports do not include a standalone LICENSE/COPYING file
938 # so we explicitly list those here for inclusion.
939 extra_licenses
= ('tinyxml/readme.txt',
942 src_root
= os
.path
.join(NACLPORTS_DIR
, 'out', 'build')
943 output_license
= os
.path
.join(out_dir
, 'ports', 'LICENSE')
944 GenerateNotice(src_root
, output_license
, extra_licenses
)
945 readme
= os
.path
.join(out_dir
, 'ports', 'README')
946 oshelpers
.Copy(['-v', os
.path
.join(SDK_SRC_DIR
, 'README.naclports'), readme
])
949 def BuildStepTarNaClPorts(pepper_ver
, tarfile
):
950 """Create tar archive containing headers and libs from naclports build."""
951 buildbot_common
.BuildStep('Tar naclports Bundle')
952 buildbot_common
.MakeDir(os
.path
.dirname(tarfile
))
953 pepper_dir
= 'pepper_%s' % pepper_ver
954 archive_dirs
= [os
.path
.join(pepper_dir
, 'ports')]
956 ports_out
= os
.path
.join(NACLPORTS_DIR
, 'out', 'sdk_bundle')
957 cmd
= [sys
.executable
, CYGTAR
, '-C', ports_out
, '-cjf', tarfile
]
959 buildbot_common
.Run(cmd
, cwd
=NACL_DIR
)
962 def BuildStepBuildAppEngine(pepperdir
, chrome_revision
):
963 """Build the projects found in src/gonacl_appengine/src"""
964 buildbot_common
.BuildStep('Build GoNaCl AppEngine Projects')
965 cmd
= ['make', 'upload', 'REVISION=%s' % chrome_revision
]
966 env
= dict(os
.environ
)
967 env
['NACL_SDK_ROOT'] = pepperdir
968 env
['NACLPORTS_NO_ANNOTATE'] = "1"
969 buildbot_common
.Run(cmd
, env
=env
, cwd
=GONACL_APPENGINE_SRC_DIR
)
973 parser
= argparse
.ArgumentParser(description
=__doc__
)
974 parser
.add_argument('--nacl-tree-path',
975 help='Path to native client tree for bionic build.',
976 dest
='nacl_tree_path')
977 parser
.add_argument('--qemu', help='Add qemu for ARM.',
979 parser
.add_argument('--bionic', help='Add bionic build.',
981 parser
.add_argument('--tar', help='Force the tar step.',
983 parser
.add_argument('--archive', help='Force the archive step.',
985 parser
.add_argument('--release', help='PPAPI release version.',
986 dest
='release', default
=None)
987 parser
.add_argument('--build-ports',
988 help='Build naclport bundle.', action
='store_true')
989 parser
.add_argument('--build-app-engine',
990 help='Build AppEngine demos.', action
='store_true')
991 parser
.add_argument('--experimental',
992 help='build experimental examples and libraries', action
='store_true',
993 dest
='build_experimental')
994 parser
.add_argument('--skip-toolchain', help='Skip toolchain untar',
996 parser
.add_argument('--no-clean', dest
='clean', action
='store_false',
997 help="Don't clean gypbuild directories")
998 parser
.add_argument('--mac-sdk',
999 help='Set the mac-sdk (e.g. 10.6) to use when building with ninja.')
1000 parser
.add_argument('--no-arm-trusted', action
='store_true',
1001 help='Disable building of ARM trusted components (sel_ldr, etc).')
1003 # To setup bash completion for this command first install optcomplete
1004 # and then add this line to your .bashrc:
1005 # complete -F _optcomplete build_sdk.py
1008 optcomplete
.autocomplete(parser
)
1013 options
= parser
.parse_args(args
)
1015 if options
.nacl_tree_path
:
1016 options
.bionic
= True
1017 toolchain_build
= os
.path
.join(options
.nacl_tree_path
, 'toolchain_build')
1018 print 'WARNING: Building bionic toolchain from NaCl checkout.'
1019 print 'This option builds bionic from the sources currently in the'
1020 print 'provided NativeClient checkout, and the results instead of '
1021 print 'downloading a toolchain from the builder. This may result in a'
1022 print 'NaCl SDK that can not run on ToT chrome.'
1023 print 'NOTE: To clobber you will need to run toolchain_build_bionic.py'
1024 print 'directly from the NativeClient checkout.'
1026 response
= raw_input("Type 'y' and hit enter to continue.\n")
1027 if response
!= 'y' and response
!= 'Y':
1031 # Get head version of NativeClient tree
1032 buildbot_common
.BuildStep('Build bionic toolchain.')
1033 buildbot_common
.Run([sys
.executable
, 'toolchain_build_bionic.py', '-f'],
1034 cwd
=toolchain_build
)
1036 toolchain_build
= None
1038 if buildbot_common
.IsSDKBuilder():
1039 options
.archive
= True
1040 options
.build_ports
= True
1041 # TODO(binji): re-enable app_engine build when the linux builder stops
1042 # breaking when trying to git clone from github.
1043 # See http://crbug.com/412969.
1044 options
.build_app_engine
= False
1047 # NOTE: order matters here. This will be the order that is specified in the
1048 # Makefiles; the first toolchain will be the default.
1049 toolchains
= ['pnacl', 'newlib', 'glibc', 'arm', 'clang-newlib', 'host']
1051 # Changes for experimental bionic builder
1053 toolchains
.append('bionic')
1054 options
.build_ports
= False
1055 options
.build_app_engine
= False
1057 print 'Building: ' + ' '.join(toolchains
)
1058 platform
= getos
.GetPlatform()
1060 if options
.archive
and not options
.tar
:
1061 parser
.error('Incompatible arguments with archive.')
1063 chrome_version
= int(build_version
.ChromeMajorVersion())
1064 chrome_revision
= build_version
.ChromeRevision()
1065 nacl_revision
= build_version
.NaClRevision()
1066 pepper_ver
= str(chrome_version
)
1067 pepper_old
= str(chrome_version
- 1)
1068 pepperdir
= os
.path
.join(OUT_DIR
, 'pepper_' + pepper_ver
)
1069 pepperdir_old
= os
.path
.join(OUT_DIR
, 'pepper_' + pepper_old
)
1071 tarname
= 'naclsdk_bionic.tar.bz2'
1073 tarname
= 'naclsdk_%s.tar.bz2' % platform
1074 tarfile
= os
.path
.join(OUT_DIR
, tarname
)
1077 pepper_ver
= options
.release
1078 print 'Building PEPPER %s at %s' % (pepper_ver
, chrome_revision
)
1080 if 'NACL_SDK_ROOT' in os
.environ
:
1081 # We don't want the currently configured NACL_SDK_ROOT to have any effect
1083 del os
.environ
['NACL_SDK_ROOT']
1085 if not options
.skip_toolchain
:
1086 BuildStepCleanPepperDirs(pepperdir
, pepperdir_old
)
1087 BuildStepMakePepperDirs(pepperdir
, ['include', 'toolchain', 'tools'])
1088 BuildStepDownloadToolchains(toolchains
)
1089 if options
.nacl_tree_path
:
1090 # Instead of untarring, copy the raw bionic toolchain
1091 not_bionic
= [i
for i
in toolchains
if i
!= 'bionic']
1092 BuildStepUntarToolchains(pepperdir
, not_bionic
)
1093 tcname
= GetToolchainDirName('bionic', 'arm')
1094 srcdir
= os
.path
.join(toolchain_build
, 'out', tcname
)
1095 bionicdir
= os
.path
.join(pepperdir
, 'toolchain', tcname
)
1096 oshelpers
.Copy(['-r', srcdir
, bionicdir
])
1098 BuildStepUntarToolchains(pepperdir
, toolchains
)
1099 if platform
== 'linux':
1100 buildbot_common
.Move(os
.path
.join(pepperdir
, 'toolchain', 'arm_trusted'),
1101 os
.path
.join(OUT_DIR
, 'arm_trusted'))
1104 if platform
== 'linux':
1105 # Linux-only: Copy arm libraries from the arm_trusted package. These are
1106 # needed to be able to run sel_ldr_arm under qemu.
1108 'lib/arm-linux-gnueabihf/librt.so.1',
1109 'lib/arm-linux-gnueabihf/libpthread.so.0',
1110 'lib/arm-linux-gnueabihf/libgcc_s.so.1',
1111 'lib/arm-linux-gnueabihf/libc.so.6',
1112 'lib/arm-linux-gnueabihf/ld-linux-armhf.so.3',
1113 'lib/arm-linux-gnueabihf/libm.so.6',
1114 'usr/lib/arm-linux-gnueabihf/libstdc++.so.6'
1116 arm_lib_dir
= os
.path
.join(pepperdir
, 'tools', 'lib', 'arm_trusted', 'lib')
1117 buildbot_common
.MakeDir(arm_lib_dir
)
1118 for arm_lib
in arm_libs
:
1119 arm_lib
= os
.path
.join(OUT_DIR
, 'arm_trusted', arm_lib
)
1120 buildbot_common
.CopyFile(arm_lib
, arm_lib_dir
)
1121 buildbot_common
.CopyFile(os
.path
.join(OUT_DIR
, 'arm_trusted', 'qemu-arm'),
1122 os
.path
.join(pepperdir
, 'tools'))
1125 BuildStepBuildToolchains(pepperdir
, toolchains
,
1126 not options
.skip_toolchain
,
1129 BuildStepUpdateHelpers(pepperdir
, True)
1130 BuildStepUpdateUserProjects(pepperdir
, toolchains
,
1131 options
.build_experimental
, True)
1133 BuildStepCopyTextFiles(pepperdir
, pepper_ver
, chrome_revision
, nacl_revision
)
1135 # Ship with libraries prebuilt, so run that first.
1136 BuildStepBuildLibraries(pepperdir
, 'src')
1137 GenerateNotice(pepperdir
)
1139 # Verify the SDK contains what we expect.
1140 if not options
.bionic
:
1141 BuildStepVerifyFilelist(pepperdir
)
1144 BuildStepTarBundle(pepper_ver
, tarfile
)
1146 if platform
== 'linux':
1147 BuildStepBuildPNaClComponent(pepper_ver
, chrome_revision
)
1149 if options
.build_ports
:
1150 ports_tarfile
= os
.path
.join(OUT_DIR
, 'naclports.tar.bz2')
1151 BuildStepSyncNaClPorts()
1152 BuildStepBuildNaClPorts(pepper_ver
, pepperdir
)
1154 BuildStepTarNaClPorts(pepper_ver
, ports_tarfile
)
1156 if options
.build_app_engine
and platform
== 'linux':
1157 BuildStepBuildAppEngine(pepperdir
, chrome_revision
)
1160 qemudir
= os
.path
.join(NACL_DIR
, 'toolchain', 'linux_arm-trusted')
1161 oshelpers
.Copy(['-r', qemudir
, pepperdir
])
1163 # Archive the results on Google Cloud Storage.
1165 BuildStepArchiveBundle('build', pepper_ver
, chrome_revision
, nacl_revision
,
1167 # Only archive sdk_tools/naclport/pnacl_component on linux.
1168 if platform
== 'linux':
1169 if options
.build_ports
:
1170 BuildStepArchiveBundle('naclports', pepper_ver
, chrome_revision
,
1171 nacl_revision
, ports_tarfile
)
1172 BuildStepArchiveSDKTools()
1173 BuildStepArchivePNaClComponent()
1178 if __name__
== '__main__':
1180 sys
.exit(main(sys
.argv
[1:]))
1181 except KeyboardInterrupt:
1182 buildbot_common
.ErrorExit('build_sdk: interrupted')