2013-07-15 10:27:12 -07:00
|
|
|
#!/usr/bin/python
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2013-07-31 11:27:13 -07:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2013-07-15 10:27:12 -07:00
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
from os import path
|
|
|
|
from buildconfig import substs
|
|
|
|
|
2013-07-31 11:27:13 -07:00
|
|
|
import logging
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
2013-07-15 10:27:12 -07:00
|
|
|
def determine_platform():
|
|
|
|
platform_mapping = {'WINNT': {'x86_64': 'win64',
|
2013-07-31 11:27:13 -07:00
|
|
|
'i686': 'win32'},
|
2013-07-15 10:27:12 -07:00
|
|
|
'Darwin': {'x86_64': 'macosx-universal',
|
|
|
|
'i386':'macosx-universal'},
|
|
|
|
'Linux': {'x86_64': 'linux64',
|
2013-07-31 11:27:13 -07:00
|
|
|
'i686': 'linux32'}}
|
2013-07-15 10:27:12 -07:00
|
|
|
|
|
|
|
os_type = substs['OS_TARGET']
|
|
|
|
cpu_type = substs['TARGET_CPU']
|
|
|
|
return platform_mapping.get(os_type, {}).get(cpu_type, None)
|
|
|
|
|
|
|
|
def main():
|
|
|
|
""" A wrapper script that calls compare-mozconfig.py
|
|
|
|
based on the platform that the machine is building for"""
|
|
|
|
platform = determine_platform()
|
|
|
|
|
|
|
|
if platform is not None:
|
|
|
|
python_exe = substs['PYTHON']
|
|
|
|
topsrcdir = substs['top_srcdir']
|
|
|
|
|
|
|
|
# construct paths and args for compare-mozconfig
|
|
|
|
browser_dir = path.join(topsrcdir, 'browser')
|
|
|
|
script_path = path.join(topsrcdir, 'build/compare-mozconfig/compare-mozconfigs.py')
|
|
|
|
whitelist_path = path.join(browser_dir, 'config/mozconfigs/whitelist')
|
|
|
|
beta_mozconfig_path = path.join(browser_dir, 'config/mozconfigs', platform, 'beta')
|
|
|
|
release_mozconfig_path = path.join(browser_dir, 'config/mozconfigs', platform, 'release')
|
|
|
|
nightly_mozconfig_path = path.join(browser_dir, 'config/mozconfigs', platform, 'nightly')
|
|
|
|
|
2013-07-31 11:27:13 -07:00
|
|
|
log.info("Comparing beta against nightly mozconfigs")
|
2013-07-15 10:27:12 -07:00
|
|
|
ret_code = subprocess.call([python_exe, script_path, '--whitelist',
|
|
|
|
whitelist_path, '--no-download',
|
|
|
|
platform + ',' + beta_mozconfig_path +
|
|
|
|
',' + nightly_mozconfig_path])
|
|
|
|
|
|
|
|
if ret_code > 0:
|
2013-07-31 11:27:13 -07:00
|
|
|
return ret_code
|
2013-07-15 10:27:12 -07:00
|
|
|
|
2013-07-31 11:27:13 -07:00
|
|
|
log.info("Comparing release against nightly mozconfigs")
|
2013-07-15 10:27:12 -07:00
|
|
|
ret_code = subprocess.call([python_exe, script_path, '--whitelist',
|
|
|
|
whitelist_path, '--no-download',
|
|
|
|
platform + ',' + release_mozconfig_path +
|
|
|
|
',' + nightly_mozconfig_path])
|
2013-07-31 11:27:13 -07:00
|
|
|
|
|
|
|
return ret_code
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main())
|