Bug 1282256 - Remove MozbuildObject._config_guess. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 04 Aug 2016 10:07:56 +0900
changeset 308518 fbeb48318c1e6616a2d2fad4155f76af61f5daf3
parent 308517 9774cf27be69e7d289796d4b7dd12fad4c0f36c4
child 308519 58bdfaad94aa02d08220e4a218cc4bb6f695e3e4
push id31128
push usermh@glandium.org
push dateMon, 08 Aug 2016 01:21:26 +0000
treeherderautoland@61a4dd746681 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1282256
milestone51.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 1282256 - Remove MozbuildObject._config_guess. r=gps Back when it was added, it was used, but it is not anymore, outside test_base.py.
python/mozbuild/mozbuild/base.py
python/mozbuild/mozbuild/test/test_base.py
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -85,17 +85,16 @@ class MozbuildObject(ProcessExecutionMix
         self.settings = settings
 
         self.populate_logger()
         self.log_manager = log_manager
 
         self._make = None
         self._topobjdir = mozpath.normsep(topobjdir) if topobjdir else topobjdir
         self._mozconfig = mozconfig
-        self._config_guess_output = None
         self._config_environment = None
         self._virtualenv_manager = None
 
     @classmethod
     def from_environment(cls, cwd=None, detect_virtualenv_mozinfo=True):
         """Create a MozbuildObject by detecting the proper one from the env.
 
         This examines environment state like the current working directory and
@@ -438,24 +437,16 @@ class MozbuildObject(ProcessExecutionMix
                 params = FLASHWINDOW(sizeof(FLASHWINDOW),
                                     console,
                                     FLASHW_CAPTION | FLASHW_TRAY | FLASHW_TIMERNOFG, 3, 0)
                 FlashWindowEx(params)
         except Exception as e:
             self.log(logging.WARNING, 'notifier-failed', {'error':
                 e.message}, 'Notification center failed: {error}')
 
-    @property
-    def _config_guess(self):
-        if self._config_guess_output is None:
-            self._config_guess_output = MozbuildObject.resolve_config_guess(
-                self.mozconfig, self.topsrcdir)
-
-        return self._config_guess_output
-
     def _ensure_objdir_exists(self):
         if os.path.isdir(self.statedir):
             return
 
         os.makedirs(self.statedir)
 
     def _ensure_state_subdir_exists(self, subdir):
         path = os.path.join(self.statedir, subdir)
--- a/python/mozbuild/mozbuild/test/test_base.py
+++ b/python/mozbuild/mozbuild/test/test_base.py
@@ -55,17 +55,19 @@ class TestMozbuildObject(unittest.TestCa
     def test_objdir_config_guess(self):
         base = self.get_base()
 
         with NamedTemporaryFile() as mozconfig:
             os.environ[b'MOZCONFIG'] = mozconfig.name
 
             self.assertIsNotNone(base.topobjdir)
             self.assertEqual(len(base.topobjdir.split()), 1)
-            self.assertTrue(base.topobjdir.endswith(base._config_guess))
+            config_guess = MozbuildObject.resolve_config_guess(base.mozconfig,
+                                                               base.topsrcdir)
+            self.assertTrue(base.topobjdir.endswith(config_guess))
             self.assertTrue(os.path.isabs(base.topobjdir))
             self.assertTrue(base.topobjdir.startswith(base.topsrcdir))
 
     def test_objdir_trailing_slash(self):
         """Trailing slashes in topobjdir should be removed."""
         base = self.get_base()
 
         with NamedTemporaryFile() as mozconfig:
@@ -293,25 +295,16 @@ class TestMozbuildObject(unittest.TestCa
                     'Ambiguous object directory detected.'))
             finally:
                 sys.stdout = stdout
 
         finally:
             os.chdir(self._old_cwd)
             shutil.rmtree(d)
 
-    def test_config_guess(self):
-        # It's difficult to test for exact values from the output of
-        # config.guess because they vary depending on platform.
-        base = self.get_base()
-        result = base._config_guess
-
-        self.assertIsNotNone(result)
-        self.assertGreater(len(result), 0)
-
     def test_config_environment(self):
         base = self.get_base(topobjdir=topobjdir)
 
         ce = base.config_environment
         self.assertIsInstance(ce, ConfigEnvironment)
 
         self.assertEqual(base.defines, ce.defines)
         self.assertEqual(base.substs, ce.substs)