mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Backed out changeset f9d83ec11ca9 (bug 936555) for checktest failures.
CLOSED TREE
This commit is contained in:
parent
49ea89d9a9
commit
9002364b94
2
CLOBBER
2
CLOBBER
@ -22,4 +22,4 @@
|
||||
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
|
||||
# don't change CLOBBER for WebIDL changes any more.
|
||||
|
||||
Bug 936555 - changes to mozconfig finding require clobbers, given that builds on try were green
|
||||
bug 960811 - clobber to rebuild preprocessed files when enabling synthetic APKs
|
||||
|
@ -75,7 +75,7 @@ class MozconfigLoader(ProcessExecutionMixin):
|
||||
|
||||
return os.path.join(our_dir, 'mozconfig_loader')
|
||||
|
||||
def find_mozconfig(self, env=os.environ):
|
||||
def find_mozconfig(self):
|
||||
"""Find the active mozconfig file for the current environment.
|
||||
|
||||
This emulates the logic in mozconfig-find.
|
||||
@ -91,10 +91,10 @@ class MozconfigLoader(ProcessExecutionMixin):
|
||||
"""
|
||||
# Check for legacy methods first.
|
||||
|
||||
if 'MOZ_MYCONFIG' in env:
|
||||
if 'MOZ_MYCONFIG' in os.environ:
|
||||
raise MozconfigFindException(MOZ_MYCONFIG_ERROR)
|
||||
|
||||
env_path = env.get('MOZCONFIG', None)
|
||||
env_path = os.environ.get('MOZCONFIG', None)
|
||||
if env_path is not None:
|
||||
if not os.path.exists(env_path):
|
||||
raise MozconfigFindException(
|
||||
@ -128,7 +128,7 @@ class MozconfigLoader(ProcessExecutionMixin):
|
||||
deprecated_paths = [os.path.join(self.topsrcdir, s) for s in
|
||||
self.DEPRECATED_TOPSRCDIR_PATHS]
|
||||
|
||||
home = env.get('HOME', None)
|
||||
home = os.environ.get('HOME', None)
|
||||
if home is not None:
|
||||
deprecated_paths.extend([os.path.join(home, s) for s in
|
||||
self.DEPRECATED_HOME_PATHS])
|
||||
|
@ -8,7 +8,7 @@
|
||||
import os
|
||||
import re
|
||||
import json
|
||||
import mozbuild.mozconfig as mozconfig
|
||||
|
||||
|
||||
def build_dict(config, env=os.environ):
|
||||
"""
|
||||
@ -27,9 +27,10 @@ def build_dict(config, env=os.environ):
|
||||
d = {}
|
||||
d['topsrcdir'] = config.topsrcdir
|
||||
|
||||
the_mozconfig = mozconfig.MozconfigLoader(config.topsrcdir).find_mozconfig(env)
|
||||
if the_mozconfig:
|
||||
d['mozconfig'] = the_mozconfig
|
||||
if 'MOZCONFIG' in env:
|
||||
mozconfig = env["MOZCONFIG"]
|
||||
mozconfig = os.path.join(config.topsrcdir, mozconfig)
|
||||
d['mozconfig'] = os.path.normpath(mozconfig)
|
||||
|
||||
# os
|
||||
o = substs["OS_TARGET"]
|
||||
|
@ -19,8 +19,6 @@ from mozbuild.mozinfo import (
|
||||
write_mozinfo,
|
||||
)
|
||||
|
||||
from mozfile.mozfile import NamedTemporaryFile
|
||||
|
||||
|
||||
class Base(object):
|
||||
def _config(self, substs={}):
|
||||
@ -241,18 +239,15 @@ class TestWriteMozinfo(unittest.TestCase, Base):
|
||||
MOZ_WIDGET_TOOLKIT='windows',
|
||||
))
|
||||
c.topsrcdir = '/tmp'
|
||||
with NamedTemporaryFile(dir=c.topsrcdir) as mozconfig:
|
||||
mozconfig.write('unused contents')
|
||||
mozconfig.flush()
|
||||
write_mozinfo(self.f, c, {'MOZCONFIG': mozconfig.name})
|
||||
with open(self.f) as f:
|
||||
d = json.load(f)
|
||||
self.assertEqual('win', d['os'])
|
||||
self.assertEqual('x86', d['processor'])
|
||||
self.assertEqual('windows', d['toolkit'])
|
||||
self.assertEqual('/tmp', d['topsrcdir'])
|
||||
self.assertEqual(os.path.normpath(mozconfig.name), d['mozconfig'])
|
||||
self.assertEqual(32, d['bits'])
|
||||
write_mozinfo(self.f, c, {'MOZCONFIG': 'foo'})
|
||||
with open(self.f) as f:
|
||||
d = json.load(f)
|
||||
self.assertEqual('win', d['os'])
|
||||
self.assertEqual('x86', d['processor'])
|
||||
self.assertEqual('windows', d['toolkit'])
|
||||
self.assertEqual('/tmp', d['topsrcdir'])
|
||||
self.assertEqual(os.path.normpath('/tmp/foo'), d['mozconfig'])
|
||||
self.assertEqual(32, d['bits'])
|
||||
|
||||
def test_fileobj(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user