| Index: build/build_nexe.py
|
| ===================================================================
|
| --- build/build_nexe.py (revision 12389)
|
| +++ build/build_nexe.py (working copy)
|
| @@ -98,34 +98,18 @@
|
| return out_ts <= src_ts
|
|
|
|
|
| -def GetGomaConfig(gomadir, osname, arch, toolname):
|
| +def GetGomaPath(osname, arch, toolname):
|
| """Returns full-path of gomacc if goma is available or None."""
|
| # Start goma support from os/arch/toolname that have been tested.
|
| # Set NO_NACL_GOMA=true to force to avoid using goma.
|
| if (osname != 'linux' or arch not in ['x86-32', 'x86-64']
|
| or toolname not in ['newlib', 'glibc']
|
| - or os.environ.get('NO_NACL_GOMA')):
|
| - return {}
|
| + or os.environ.get('NO_NACL_GOMA', None)):
|
| + return None
|
|
|
| - goma_config = {}
|
| try:
|
| gomacc_base = 'gomacc.exe' if os.name == 'nt' else 'gomacc'
|
| - # Search order of gomacc:
|
| - # --gomadir command argument -> GOMA_DIR env. -> PATH env.
|
| - search_path = []
|
| - # 1. --gomadir in the command argument.
|
| - if gomadir:
|
| - search_path.append(gomadir)
|
| - # 2. Use GOMA_DIR environmental variable if exist.
|
| - goma_dir_env = os.environ.get('GOMA_DIR')
|
| - if goma_dir_env:
|
| - search_path.append(gomadir_env)
|
| - # 3. Append PATH env.
|
| - path_env = os.environ.get('PATH')
|
| - if path_env:
|
| - search_path.extend(path_env.split(os.path.pathsep))
|
| -
|
| - for directory in search_path:
|
| + for directory in os.environ.get('PATH', '').split(os.path.pathsep):
|
| gomacc = os.path.join(directory, gomacc_base)
|
| if os.path.isfile(gomacc):
|
| port = subprocess.Popen(
|
| @@ -134,19 +118,13 @@
|
| status = urllib2.urlopen(
|
| 'http://127.0.0.1:%s/healthz' % port).read().strip()
|
| if status == 'ok':
|
| - goma_config['gomacc'] = gomacc
|
| - break
|
| + return gomacc
|
| except Exception:
|
| # Anyway, fallbacks to non-goma mode.
|
| pass
|
| + return None
|
|
|
| - if goma_config:
|
| - goma_config['burst'] = False
|
| - if osname == 'linux' and not os.environ.get('NO_NACL_GOMA_BURST', None):
|
| - goma_config['burst'] = True
|
| - return goma_config
|
|
|
| -
|
| class Builder(object):
|
| """Builder object maintains options and generates build command-lines.
|
|
|
| @@ -245,9 +223,7 @@
|
| self.strip_all = options.strip_all
|
| self.strip_debug = options.strip_debug
|
| self.finalize_pexe = options.finalize_pexe and arch == 'pnacl'
|
| - goma_config = GetGomaConfig(options.gomadir, self.osname, arch, toolname)
|
| - self.gomacc = goma_config.get('gomacc', '')
|
| - self.goma_burst = goma_config.get('burst', False)
|
| + self.gomacc = GetGomaPath(self.osname, arch, toolname)
|
|
|
| # Use unoptimized native objects for debug IRT builds for faster compiles.
|
| if (self.is_pnacl_toolchain
|
| @@ -721,8 +697,6 @@
|
| help='Set the path for of the toolchains.')
|
| parser.add_option('--config-name', dest='build_config',
|
| help='GYP build configuration name (Release/Debug)')
|
| - parser.add_option('--gomadir', dest='gomadir',
|
| - help='Path of the goma directory.')
|
| options, files = parser.parse_args(argv[1:])
|
|
|
| if not argv:
|
| @@ -757,7 +731,7 @@
|
| build.Translate(list(files)[0])
|
| return 0
|
|
|
| - if build.gomacc and build.goma_burst: # execute gomacc as many as possible.
|
| + if build.gomacc: # use goma build.
|
| returns = Queue.Queue()
|
| def CompileThread(filename, queue):
|
| try:
|
|
|