bug 598507 - wrap test harness process execution with 'arch -arch i386' on OS X 10.5. r=catlee, a=blocking

This commit is contained in:
Ted Mielczarek
2010-09-23 12:19:31 -04:00
parent 1ad763bd8a
commit d010203f76
3 changed files with 18 additions and 1 deletions

View File

@@ -36,7 +36,7 @@
#
# ***** END LICENSE BLOCK ***** */
import glob, logging, os, shutil, subprocess, sys
import glob, logging, os, platform, shutil, subprocess, sys
import re
from urlparse import urlparse
@@ -49,6 +49,7 @@ __all__ = [
"getDebuggerInfo",
"DEBUGGER_INFO",
"replaceBackSlashes",
"wrapCommand",
]
# Map of debugging programs to information about them, like default arguments
@@ -359,3 +360,16 @@ def processLeakLog(leakLogFile, leakThreshold = 0):
def replaceBackSlashes(input):
return input.replace('\\', '/')
def wrapCommand(cmd):
"""
If running on OS X 10.5 or older, wrap |cmd| so that it will
be executed as an i386 binary, in case it's a 32-bit/64-bit universal
binary.
"""
if platform.system() == "Darwin" and \
hasattr(platform, 'mac_ver') and \
platform.mac_ver()[0][:4] < '10.6':
return ["arch", "-arch", "i386"] + cmd
# otherwise just execute the command normally
return cmd