Bug 965789 - Check if a clobber is needed before invoking make install-tests, r=gps

This commit is contained in:
Andrew Halberstadt 2014-02-13 14:36:55 -06:00
parent f83a4c3cb1
commit 7613605596
2 changed files with 31 additions and 0 deletions

View File

@ -19,6 +19,7 @@ from mach.mixin.process import ProcessExecutionMixin
from mozfile.mozfile import rmtree
from .backend.configenvironment import ConfigEnvironment
from .controller.clobber import Clobberer
from .mozconfig import (
MozconfigFindException,
MozconfigLoadException,
@ -281,6 +282,11 @@ class MozbuildObject(ProcessExecutionMixin):
def statedir(self):
return os.path.join(self.topobjdir, '.mozbuild')
def is_clobber_needed(self):
if not os.path.exists(self.topobjdir):
return False
return Clobberer(self.topsrcdir, self.topobjdir).clobber_needed()
def remove_objdir(self):
"""Remove the entire object directory."""

View File

@ -30,6 +30,26 @@ from ..compilation.warnings import (
WarningsDatabase,
)
from textwrap import TextWrapper
INSTALL_TESTS_CLOBBER = ''.join([TextWrapper().fill(line) + '\n' for line in
'''
The build system was unable to install tests because the CLOBBER file has \
been updated. This means if you edited any test files, your changes may not \
be picked up until a full/clobber build is performed.
The easiest and fastest way to perform a clobber build is to run:
$ mach clobber
$ mach build
If you did not modify any test files, it is safe to ignore this message \
and proceed with running tests. To do this run:
$ touch {clobber_file}
'''.splitlines()])
BuildOutputResult = namedtuple('BuildOutputResult',
('warning', 'state_changed', 'for_display'))
@ -575,6 +595,11 @@ class BuildDriver(MozbuildObject):
def install_tests(self, remove=True):
"""Install test files (through manifest)."""
if self.is_clobber_needed():
print(INSTALL_TESTS_CLOBBER.format(
clobber_file=os.path.join(self.topobjdir, 'CLOBBER')))
sys.exit(1)
env = {}
if not remove:
env[b'NO_REMOVE'] = b'1'