| OLD | NEW |
| 1 #! -*- python -*- | 1 #! -*- python -*- |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client 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 import atexit | 6 import atexit |
| 7 import glob | 7 import glob |
| 8 import os | 8 import os |
| 9 import platform | 9 import platform |
| 10 import shutil | 10 import shutil |
| (...skipping 1959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1970 return ('process_output_single' in extra or | 1970 return ('process_output_single' in extra or |
| 1971 'log_golden' in extra) | 1971 'log_golden' in extra) |
| 1972 | 1972 |
| 1973 # ---------------------------------------------------------- | 1973 # ---------------------------------------------------------- |
| 1974 DeclareBit('tests_use_irt', 'Non-browser tests also load the IRT image', False) | 1974 DeclareBit('tests_use_irt', 'Non-browser tests also load the IRT image', False) |
| 1975 | 1975 |
| 1976 # Translate the given pexe. | 1976 # Translate the given pexe. |
| 1977 def GetTranslatedNexe(env, pexe): | 1977 def GetTranslatedNexe(env, pexe): |
| 1978 pexe_name = pexe.abspath | 1978 pexe_name = pexe.abspath |
| 1979 nexe_name = pexe_name[:pexe_name.index('.pexe')] + '.nexe' | 1979 nexe_name = pexe_name[:pexe_name.index('.pexe')] + '.nexe' |
| 1980 | 1980 # Make sure the pexe doesn't get removed by the fake builders when |
| 1981 # built_elsewhere=1 |
| 1982 env.Precious(pexe) |
| 1981 node = env.Command(target=nexe_name, source=[pexe_name], | 1983 node = env.Command(target=nexe_name, source=[pexe_name], |
| 1982 action=[Action('${TRANSLATECOM}', '${TRANSLATECOMSTR}')]) | 1984 action=[Action('${TRANSLATECOM}', '${TRANSLATECOMSTR}')]) |
| 1983 # Ignore nexe dependency on pexe and assume it's already there. This replaces | |
| 1984 # ignoring the test dependency on the nexe, which is what built_elsewhere | |
| 1985 # does when not in pnacl_generate_pexe mode | |
| 1986 if env.Bit('built_elsewhere'): | |
| 1987 env.Ignore(nexe_name, pexe_name) | |
| 1988 return node | 1985 return node |
| 1989 | 1986 |
| 1990 pre_base_env.AddMethod(GetTranslatedNexe) | 1987 pre_base_env.AddMethod(GetTranslatedNexe) |
| 1991 | 1988 |
| 1992 def CommandSelLdrTestNacl(env, name, nexe, | 1989 def CommandSelLdrTestNacl(env, name, nexe, |
| 1993 args = None, | 1990 args = None, |
| 1994 log_verbosity=2, | 1991 log_verbosity=2, |
| 1995 sel_ldr_flags=None, | 1992 sel_ldr_flags=None, |
| 1996 loader=None, | 1993 loader=None, |
| 1997 size='medium', | 1994 size='medium', |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2305 # of sync with the indexes in "command". | 2302 # of sync with the indexes in "command". |
| 2306 # See http://code.google.com/p/nativeclient/issues/detail?id=1086 | 2303 # See http://code.google.com/p/nativeclient/issues/detail?id=1086 |
| 2307 raise AssertionError('Argument to AutoDepsCommand() actually contains ' | 2304 raise AssertionError('Argument to AutoDepsCommand() actually contains ' |
| 2308 'multiple (or zero) arguments: %r' % arg) | 2305 'multiple (or zero) arguments: %r' % arg) |
| 2309 if posix_path: | 2306 if posix_path: |
| 2310 command[index] = '${SOURCES[%d].posix}' % len(deps) | 2307 command[index] = '${SOURCES[%d].posix}' % len(deps) |
| 2311 else: | 2308 else: |
| 2312 command[index] = '${SOURCES[%d].abspath}' % len(deps) | 2309 command[index] = '${SOURCES[%d].abspath}' % len(deps) |
| 2313 deps.append(arg) | 2310 deps.append(arg) |
| 2314 | 2311 |
| 2315 # If we are testing build output captured from elsewhere, | 2312 # If built_elsewhere, build commands are replaced by no-ops, so make sure |
| 2316 # ignore build dependencies, (except pexe translation, which we always | 2313 # the targets don't get removed first |
| 2317 # want to do in pnacl_generate_pexe mode) | 2314 if env.Bit('built_elsewhere'): |
| 2318 if env.Bit('built_elsewhere') and not env.Bit('pnacl_generate_pexe'): | 2315 env.Precious(deps) |
| 2319 env.Ignore(name, deps) | 2316 env.Depends(name, extra_deps) |
| 2320 else: | |
| 2321 env.Depends(name, extra_deps) | |
| 2322 | 2317 |
| 2323 if disabled: | 2318 if disabled: |
| 2324 return env.DisabledCommand(name, deps) | 2319 return env.DisabledCommand(name, deps) |
| 2325 else: | 2320 else: |
| 2326 return env.Command(name, deps, ' '.join(command)) | 2321 return env.Command(name, deps, ' '.join(command)) |
| 2327 | 2322 |
| 2328 | 2323 |
| 2329 pre_base_env.AddMethod(AutoDepsCommand) | 2324 pre_base_env.AddMethod(AutoDepsCommand) |
| 2330 | 2325 |
| 2331 # ---------------------------------------------------------- | 2326 # ---------------------------------------------------------- |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2878 CCFLAGS = ['-m32', ], | 2873 CCFLAGS = ['-m32', ], |
| 2879 LINKFLAGS = ['-m32', '-L/usr/lib32', ], | 2874 LINKFLAGS = ['-m32', '-L/usr/lib32', ], |
| 2880 ) | 2875 ) |
| 2881 elif linux_env.Bit('build_x86_64'): | 2876 elif linux_env.Bit('build_x86_64'): |
| 2882 linux_env.Prepend( | 2877 linux_env.Prepend( |
| 2883 CCFLAGS = ['-m64', ], | 2878 CCFLAGS = ['-m64', ], |
| 2884 LINKFLAGS = ['-m64', '-L/usr/lib64', ], | 2879 LINKFLAGS = ['-m64', '-L/usr/lib64', ], |
| 2885 ) | 2880 ) |
| 2886 elif linux_env.Bit('build_arm'): | 2881 elif linux_env.Bit('build_arm'): |
| 2887 if linux_env.Bit('built_elsewhere'): | 2882 if linux_env.Bit('built_elsewhere'): |
| 2888 # force an unusable environment here | 2883 def FakeInstall(dest, source, env): |
| 2889 linux_env.Replace(CC='NO-ARM-CC-INVOCATION-ALLOWED', | 2884 print 'Not installing', dest |
| 2890 CXX='NO-ARM-CXX-INVOCATION-ALLOWED', | 2885 # Replace build commands with no-ops |
| 2891 LD='NO-ARM-LD-INVOCATION-ALLOWD', | 2886 linux_env.Replace(CC='true', CXX='true', LD='true', |
| 2892 ) | 2887 AR='true', RANLIB='true', INSTALL=FakeInstall) |
| 2888 # Allow emulation on x86 hosts for testing built_elsewhere flag |
| 2889 if not platform.machine().startswith('arm'): |
| 2890 jail = '${SCONSTRUCT_DIR}/toolchain/linux_arm-trusted' |
| 2891 linux_env.Replace(EMULATOR=jail + '/run_under_qemu_arm') |
| 2892 |
| 2893 ############################################################### | 2893 ############################################################### |
| 2894 # EXPERIMENTAL | 2894 # EXPERIMENTAL |
| 2895 # This is needed to switch to a different trusted cross | 2895 # This is needed to switch to a different trusted cross |
| 2896 # toolchain when compiling within the cros_chroot | 2896 # toolchain when compiling within the cros_chroot |
| 2897 # BUG=http://code.google.com/p/chromium/issues/detail?id=61695 | 2897 # BUG=http://code.google.com/p/chromium/issues/detail?id=61695 |
| 2898 # BUG=http://code.google.com/p/chromium/issues/detail?id=38909 | 2898 # BUG=http://code.google.com/p/chromium/issues/detail?id=38909 |
| 2899 # BUG=http://code.google.com/p/nativeclient/issues/detail?id=135 | 2899 # BUG=http://code.google.com/p/nativeclient/issues/detail?id=135 |
| 2900 # | 2900 # |
| 2901 elif linux_env.Bit('cros_chroot'): | 2901 elif linux_env.Bit('cros_chroot'): |
| 2902 # TODO(mseaborn): It would be clearer just to inline | 2902 # TODO(mseaborn): It would be clearer just to inline |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3896 nacl_env.ValidateSdk() | 3896 nacl_env.ValidateSdk() |
| 3897 | 3897 |
| 3898 if BROKEN_TEST_COUNT > 0: | 3898 if BROKEN_TEST_COUNT > 0: |
| 3899 msg = "There are %d broken tests." % BROKEN_TEST_COUNT | 3899 msg = "There are %d broken tests." % BROKEN_TEST_COUNT |
| 3900 if GetOption('brief_comstr'): | 3900 if GetOption('brief_comstr'): |
| 3901 msg += " Add --verbose to the command line for more information." | 3901 msg += " Add --verbose to the command line for more information." |
| 3902 print msg | 3902 print msg |
| 3903 | 3903 |
| 3904 # separate warnings from actual build output | 3904 # separate warnings from actual build output |
| 3905 Banner('B U I L D - O U T P U T:') | 3905 Banner('B U I L D - O U T P U T:') |
| OLD | NEW |