Bug 919735: For VS2013, put the 32-bit PGO files first on the PATH. r=ted
authorDavid Major <dmajor@mozilla.com>
Fri, 14 Mar 2014 12:48:59 -0700
changeset 173720 b6bf2687d93f
parent 173719 0a1597e03bde
child 173721 0e768e11d2c6
push id26415
push userkwierso@gmail.com
push date2014-03-15 05:20 +0000
treeherdermozilla-central@82c90c17fc95 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs919735
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 919735: For VS2013, put the 32-bit PGO files first on the PATH. r=ted
build/pgo/profileserver.py
toolkit/mozapps/installer/packager.py
--- a/build/pgo/profileserver.py
+++ b/build/pgo/profileserver.py
@@ -12,16 +12,17 @@ import json
 import socket
 import threading
 import os
 import sys
 import shutil
 import tempfile
 from datetime import datetime
 from mozbuild.base import MozbuildObject
+from buildconfig import substs
 
 PORT = 8888
 
 if __name__ == '__main__':
   cli = CLI()
   debug_args, interactive = cli.debugger_arguments()
 
   build = MozbuildObject.from_environment()
@@ -49,16 +50,24 @@ if __name__ == '__main__':
     profile = FirefoxProfile(profile=profilePath,
                              preferences=prefs,
                              addons=[os.path.join(build.distdir, 'xpi-stage', 'quitter')],
                              locations=locations)
 
     env = os.environ.copy()
     env["MOZ_CRASHREPORTER_NO_REPORT"] = "1"
     env["XPCOM_DEBUG_BREAK"] = "warn"
+
+    # For VC12, make sure we can find the right bitness of pgort120.dll
+    if "VS120COMNTOOLS" in env and not substs["HAVE_64BIT_OS"]:
+      vc12dir = os.path.abspath(os.path.join(env["VS120COMNTOOLS"],
+                                             "../../VC/bin"))
+      if os.path.exists(vc12dir):
+        env["PATH"] = vc12dir + ";" + env["PATH"]
+
     jarlog = os.getenv("JARLOG_FILE")
     if jarlog:
       env["MOZ_JAR_LOG_FILE"] = os.path.abspath(jarlog)
       print "jarlog: %s" % env["MOZ_JAR_LOG_FILE"]
 
     cmdargs = ["http://localhost:%d/index.html" % PORT]
     runner = FirefoxRunner(profile=profile,
                            binary=build.get_binary_path(where="staged-package"),
--- a/toolkit/mozapps/installer/packager.py
+++ b/toolkit/mozapps/installer/packager.py
@@ -132,24 +132,34 @@ def precompile_cache(formatter, source_p
     else:
         resource = 'gre'
     app_path = os.path.join(source_path, app_path)
     gre_path = os.path.join(source_path, gre_path)
 
     fd, cache = mkstemp('.zip')
     os.close(fd)
     os.remove(cache)
+
+    # For VC12, make sure we can find the right bitness of pgort120.dll
+    env = os.environ.copy()
+    if 'VS120COMNTOOLS' in env and not buildconfig.substs['HAVE_64BIT_OS']:
+      vc12dir = os.path.abspath(os.path.join(env['VS120COMNTOOLS'],
+                                             '../../VC/bin'))
+      if os.path.exists(vc12dir):
+        env['PATH'] = vc12dir + ';' + env['PATH']
+
     try:
         if launcher.launch(['xpcshell', '-g', gre_path, '-a', app_path,
                             '-f', os.path.join(os.path.dirname(__file__),
                             'precompile_cache.js'),
                             '-e', 'precompile_startupcache("resource://%s/");'
                                   % resource],
                            extra_linker_path=gre_path,
-                           extra_env={'MOZ_STARTUP_CACHE': cache}):
+                           extra_env={'MOZ_STARTUP_CACHE': cache,
+                                      'PATH': env['PATH']}):
             errors.fatal('Error while running startup cache precompilation')
             return
         from mozpack.mozjar import JarReader
         jar = JarReader(cache)
         resource = '/resource/%s/' % resource
         for f in jar:
             if resource in f.filename:
                 path = f.filename[f.filename.index(resource) + len(resource):]