# HG changeset patch # User Chris Manchester # Date 1535134400 0 # Node ID 3b000def0382fee7a4cd9bd7def3a13d8a3cc67b # Parent 9a9256844c3d545e70ed5e89004a093ace3894d4 Bug 1485174 - Prevent using an objdir to build with tup that was previously used to build with make. r=firefox-build-system-reviewers,froydnj Differential Revision: https://phabricator.services.mozilla.com/D4154 diff --git a/python/mozbuild/mozbuild/controller/building.py b/python/mozbuild/mozbuild/controller/building.py --- a/python/mozbuild/mozbuild/controller/building.py +++ b/python/mozbuild/mozbuild/controller/building.py @@ -1,16 +1,17 @@ # 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/. from __future__ import absolute_import, unicode_literals import errno import getpass +import glob import io import json import logging import os import subprocess import sys import time import which @@ -1044,16 +1045,26 @@ class BuildDriver(MozbuildObject): if config_rc != 0: return config_rc config = self.config_environment status = None active_backend = config.substs.get('BUILD_BACKENDS', [None])[0] if active_backend and 'Make' not in active_backend: + for backend_file in glob.iglob(mozpath.join(self.topobjdir, + 'backend.*Backend')): + if 'Make' in backend_file: + self.log(logging.ERROR, 'backend', + {'objdir': self.topobjdir}, + "The active objdir, {objdir}, was previously " + "used to build with a Make-based backend. " + "Change objdirs (by setting MOZ_OBJDIR in " + "your mozconfig) to continue.\n") + return 1 # Record whether a clobber was requested so we can print # a special message later if the build fails. clobber_requested = False # Write out any changes to the current mozconfig in case # they should invalidate configure. self._write_mozconfig_json() # Even if we have a config object, it may be out of date # if something that influences its result has changed.