Bug 814333 - make gyp provide a PYTHON default variable initialized to sys.executable and reuse it in .gyp files instead of hardcording python r=ted
authorLandry Breuil <landry@openbsd.org>
Wed, 20 Feb 2013 21:54:51 +0100
changeset 122491 e27e1c6fe079dfcb92e2011f6c10ce2933842281
parent 122490 ce4f4d4d69d916af09861b3df8bbad3ab48cb46b
child 122492 9bee7d808f97a08de30044dee9d4abbf0dab6a1a
push id24342
push userryanvm@gmail.com
push dateThu, 21 Feb 2013 13:05:06 +0000
treeherdermozilla-central@702d2814efbf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs814333
milestone22.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 814333 - make gyp provide a PYTHON default variable initialized to sys.executable and reuse it in .gyp files instead of hardcording python r=ted
media/webrtc/trunk/build/common.gypi
media/webrtc/trunk/tools/gyp/pylib/gyp/__init__.py
--- a/media/webrtc/trunk/build/common.gypi
+++ b/media/webrtc/trunk/build/common.gypi
@@ -903,53 +903,53 @@
     # we can build a debug version with acceptable size and performance.
     'android_full_debug%': 0,
 
     # Sets the default version name and code for Android app, by default we
     # do a developer build.
     'android_app_version_name%': 'Developer Build',
     'android_app_version_code%': 0,
 
-    'sas_dll_exists': '<!(python <(DEPTH)/build/dir_exists.py <(sas_dll_path))',
-    'wix_exists': '<!(python <(DEPTH)/build/dir_exists.py <(wix_path))',
+    'sas_dll_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(sas_dll_path))',
+    'wix_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(wix_path))',
 
     'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
     'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
 
     'conditions': [
-      ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', {
+      ['OS=="win" and "<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', {
         'windows_sdk_path%': '<(windows_sdk_default_path)',
       }, {
         'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
       }],
-      ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(directx_sdk_default_path))"=="True"', {
+      ['OS=="win" and "<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(directx_sdk_default_path))"=="True"', {
         'directx_sdk_path%': '<(directx_sdk_default_path)',
       }, {
         'directx_sdk_path%': '$(DXSDK_DIR)',
       }],
       # If use_official_google_api_keys is already set (to 0 or 1), we
       # do none of the implicit checking.  If it is set to 1 and the
       # internal keys file is missing, the build will fail at compile
       # time.  If it is set to 0 and keys are not provided by other
       # means, a warning will be printed at compile time.
       ['use_official_google_api_keys==2', {
         'use_official_google_api_keys%':
-            '<!(python <(DEPTH)/google_apis/build/check_internal.py <(DEPTH)/google_apis/internal/google_chrome_api_keys.h)',
+            '<!(<(PYTHON) <(DEPTH)/google_apis/build/check_internal.py <(DEPTH)/google_apis/internal/google_chrome_api_keys.h)',
       }],
       ['os_posix==1 and OS!="mac" and OS!="ios"', {
         # Figure out the python architecture to decide if we build pyauto.
 	# disabled for mozilla because windows != mac and this runs a shell script
 	#        'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/<(system_libdir)/libpython<(python_ver).so.1.0)',
         'conditions': [
           # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
           # that it takes effect here.
           # disabled for Mozilla since it doesn't use this, and 'msys' messes $(CXX) up
           ['build_with_mozilla==0 and clang==0 and asan==0 and tsan==0', {
             # This will set gcc_version to XY if you are running gcc X.Y.*.
-            'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
+            'gcc_version%': '<!(<(PYTHON) <(DEPTH)/build/compiler_version.py)',
           }, {
             'gcc_version%': 0,
           }],
           ['branding=="Chrome"', {
             'linux_breakpad%': 1,
           }],
           # All Chrome builds have breakpad symbols, but only process the
           # symbols from official builds.
@@ -964,17 +964,17 @@
         'icu_use_data_file_flag%': 1,
         'use_system_bzip2%': 1,
         'use_system_libxml%': 1,
         'use_system_sqlite%': 1,
 
         # The Mac SDK is set for iOS builds and passed through to Mac
         # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
         # overridden from the command line the same way it is for a Mac build.
-        'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)',
+        'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py 10.6)',
 
         # iOS SDK and deployment target support.  The iOS 5.0 SDK is actually
         # what is required, but the value is left blank so when it is set in
         # the project files it will be the "current" iOS SDK.  Forcing 5.0
         # even though it is "current" causes Xcode to spit out a warning for
         # every single project file for not using the "current" SDK.
         'ios_sdk%': '',
         'ios_sdk_path%': '',
@@ -1150,25 +1150,25 @@
           # these names into the build system.
           ['branding=="Chrome"', {
             'mac_product_name%': 'Google Chrome',
           }, { # else: branding!="Chrome"
             'mac_product_name%': 'Chromium',
           }],
 
           ['branding=="Chrome" and buildtype=="Official"', {
-            'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
+            'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
             # Enable uploading crash dumps.
             'mac_breakpad_uploads%': 1,
             # Enable dumping symbols at build time for use by Mac Breakpad.
             'mac_breakpad%': 1,
             # Enable Keystone auto-update support.
             'mac_keystone%': 1,
           }, { # else: branding!="Chrome" or buildtype!="Official"
-            'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
+            'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
             'mac_breakpad_uploads%': 0,
             'mac_breakpad%': 0,
             'mac_keystone%': 0,
           }],
         ],
       }],  # OS=="mac"
 
       ['OS=="win"', {
--- a/media/webrtc/trunk/tools/gyp/pylib/gyp/__init__.py
+++ b/media/webrtc/trunk/tools/gyp/pylib/gyp/__init__.py
@@ -63,16 +63,19 @@ def Load(build_files, format, default_va
 
   default_variables = copy.copy(default_variables)
 
   # Default variables provided by this program and its modules should be
   # named WITH_CAPITAL_LETTERS to provide a distinct "best practice" namespace,
   # avoiding collisions with user and automatic variables.
   default_variables['GENERATOR'] = format
 
+  # Provide a PYTHON value to run sub-commands with the same python
+  default_variables['PYTHON'] = sys.executable
+
   # Format can be a custom python file, or by default the name of a module
   # within gyp.generator.
   if format.endswith('.py'):
     generator_name = os.path.splitext(format)[0]
     path, generator_name = os.path.split(generator_name)
 
     # Make sure the path to the custom generator is in sys.path
     # Don't worry about removing it once we are done.  Keeping the path