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

Side by Side Diff: SConstruct

Issue 9824001: Change built_elsewhere flag to work with pexe mode (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: add AS, line len Created 8 years, 9 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 | buildbot/buildbot_pnacl.sh » ('j') | site_scons/site_tools/naclsdk.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
1981 env.Precious(pexe)
jvoung - send to chromium... 2012/03/21 23:15:04 Could you add a comment explaining the need for en
(google.com) Derek Schuff 2012/03/22 00:02:02 Done.
1981 node = env.Command(target=nexe_name, source=[pexe_name], 1982 node = env.Command(target=nexe_name, source=[pexe_name],
1982 action=[Action('${TRANSLATECOM}', '${TRANSLATECOMSTR}')]) 1983 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 1984 return node
1989 1985
1990 pre_base_env.AddMethod(GetTranslatedNexe) 1986 pre_base_env.AddMethod(GetTranslatedNexe)
1991 1987
1992 def CommandSelLdrTestNacl(env, name, nexe, 1988 def CommandSelLdrTestNacl(env, name, nexe,
1993 args = None, 1989 args = None,
1994 log_verbosity=2, 1990 log_verbosity=2,
1995 sel_ldr_flags=None, 1991 sel_ldr_flags=None,
1996 loader=None, 1992 loader=None,
1997 size='medium', 1993 size='medium',
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
2305 # of sync with the indexes in "command". 2301 # of sync with the indexes in "command".
2306 # See http://code.google.com/p/nativeclient/issues/detail?id=1086 2302 # See http://code.google.com/p/nativeclient/issues/detail?id=1086
2307 raise AssertionError('Argument to AutoDepsCommand() actually contains ' 2303 raise AssertionError('Argument to AutoDepsCommand() actually contains '
2308 'multiple (or zero) arguments: %r' % arg) 2304 'multiple (or zero) arguments: %r' % arg)
2309 if posix_path: 2305 if posix_path:
2310 command[index] = '${SOURCES[%d].posix}' % len(deps) 2306 command[index] = '${SOURCES[%d].posix}' % len(deps)
2311 else: 2307 else:
2312 command[index] = '${SOURCES[%d].abspath}' % len(deps) 2308 command[index] = '${SOURCES[%d].abspath}' % len(deps)
2313 deps.append(arg) 2309 deps.append(arg)
2314 2310
2315 # If we are testing build output captured from elsewhere, 2311 # If built_elsewhere, build commands are replaced by no-ops, so make sure
2316 # ignore build dependencies, (except pexe translation, which we always 2312 # the targets don't get removed first
2317 # want to do in pnacl_generate_pexe mode) 2313 if env.Bit('built_elsewhere'):
2318 if env.Bit('built_elsewhere') and not env.Bit('pnacl_generate_pexe'): 2314 env.Precious(deps)
jvoung - send to chromium... 2012/03/21 23:15:04 Should extra_deps be precious as well?
(google.com) Derek Schuff 2012/03/22 00:02:02 The only thing that really needs to be precious is
2319 env.Ignore(name, deps) 2315 env.Depends(name, extra_deps)
2320 else:
2321 env.Depends(name, extra_deps)
2322 2316
2323 if disabled: 2317 if disabled:
2324 return env.DisabledCommand(name, deps) 2318 return env.DisabledCommand(name, deps)
2325 else: 2319 else:
2326 return env.Command(name, deps, ' '.join(command)) 2320 return env.Command(name, deps, ' '.join(command))
2327 2321
2328 2322
2329 pre_base_env.AddMethod(AutoDepsCommand) 2323 pre_base_env.AddMethod(AutoDepsCommand)
2330 2324
2331 # ---------------------------------------------------------- 2325 # ----------------------------------------------------------
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
2878 CCFLAGS = ['-m32', ], 2872 CCFLAGS = ['-m32', ],
2879 LINKFLAGS = ['-m32', '-L/usr/lib32', ], 2873 LINKFLAGS = ['-m32', '-L/usr/lib32', ],
2880 ) 2874 )
2881 elif linux_env.Bit('build_x86_64'): 2875 elif linux_env.Bit('build_x86_64'):
2882 linux_env.Prepend( 2876 linux_env.Prepend(
2883 CCFLAGS = ['-m64', ], 2877 CCFLAGS = ['-m64', ],
2884 LINKFLAGS = ['-m64', '-L/usr/lib64', ], 2878 LINKFLAGS = ['-m64', '-L/usr/lib64', ],
2885 ) 2879 )
2886 elif linux_env.Bit('build_arm'): 2880 elif linux_env.Bit('build_arm'):
2887 if linux_env.Bit('built_elsewhere'): 2881 if linux_env.Bit('built_elsewhere'):
2888 # force an unusable environment here 2882 def FakeInstall(dest, source, env):
2889 linux_env.Replace(CC='NO-ARM-CC-INVOCATION-ALLOWED', 2883 print 'Not installing', dest
2890 CXX='NO-ARM-CXX-INVOCATION-ALLOWED', 2884 # Replace build commands with no-ops
jvoung - send to chromium... 2012/03/21 23:15:04 I wonder if 'true' would work on Windows, but... b
(google.com) Derek Schuff 2012/03/22 00:02:02 well I guess it's conceivable if we want to have a
2891 LD='NO-ARM-LD-INVOCATION-ALLOWD', 2885 linux_env.Replace(CC='true', CXX='true', LD='true',
2892 ) 2886 AR='true', RANLIB='true', INSTALL=FakeInstall)
2887 # Allow emulation for testing built_elsewhere flag
jvoung - send to chromium... 2012/03/21 23:15:04 Should this emulation setting be removed before co
(google.com) Derek Schuff 2012/03/22 00:02:02 the platform.machine() test makes sure it's only e
jvoung - send to chromium... 2012/03/22 00:17:45 Ah of course.
2888 if not platform.machine().startswith('arm'):
2889 jail = '${SCONSTRUCT_DIR}/toolchain/linux_arm-trusted'
2890 linux_env.Replace(EMULATOR=jail + '/run_under_qemu_arm')
2891
2893 ############################################################### 2892 ###############################################################
2894 # EXPERIMENTAL 2893 # EXPERIMENTAL
2895 # This is needed to switch to a different trusted cross 2894 # This is needed to switch to a different trusted cross
2896 # toolchain when compiling within the cros_chroot 2895 # toolchain when compiling within the cros_chroot
2897 # BUG=http://code.google.com/p/chromium/issues/detail?id=61695 2896 # BUG=http://code.google.com/p/chromium/issues/detail?id=61695
2898 # BUG=http://code.google.com/p/chromium/issues/detail?id=38909 2897 # BUG=http://code.google.com/p/chromium/issues/detail?id=38909
2899 # BUG=http://code.google.com/p/nativeclient/issues/detail?id=135 2898 # BUG=http://code.google.com/p/nativeclient/issues/detail?id=135
2900 # 2899 #
2901 elif linux_env.Bit('cros_chroot'): 2900 elif linux_env.Bit('cros_chroot'):
2902 # TODO(mseaborn): It would be clearer just to inline 2901 # TODO(mseaborn): It would be clearer just to inline
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
3896 nacl_env.ValidateSdk() 3895 nacl_env.ValidateSdk()
3897 3896
3898 if BROKEN_TEST_COUNT > 0: 3897 if BROKEN_TEST_COUNT > 0:
3899 msg = "There are %d broken tests." % BROKEN_TEST_COUNT 3898 msg = "There are %d broken tests." % BROKEN_TEST_COUNT
3900 if GetOption('brief_comstr'): 3899 if GetOption('brief_comstr'):
3901 msg += " Add --verbose to the command line for more information." 3900 msg += " Add --verbose to the command line for more information."
3902 print msg 3901 print msg
3903 3902
3904 # separate warnings from actual build output 3903 # separate warnings from actual build output
3905 Banner('B U I L D - O U T P U T:') 3904 Banner('B U I L D - O U T P U T:')
OLDNEW
« no previous file with comments | « no previous file | buildbot/buildbot_pnacl.sh » ('j') | site_scons/site_tools/naclsdk.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698