Bug 1129394 - produce a useful error message for |mach build-backend| without having run configure; r=ted.mielczarek
Checking for config.status ourselves avoids the unpleasant situation of the subprocess module checking for us and producing a cryptic error message.
This commit is contained in:
@@ -586,6 +586,12 @@ class Build(MachCommandBase):
|
|||||||
python = self.virtualenv_manager.python_path
|
python = self.virtualenv_manager.python_path
|
||||||
config_status = os.path.join(self.topobjdir, 'config.status')
|
config_status = os.path.join(self.topobjdir, 'config.status')
|
||||||
|
|
||||||
|
if not os.path.exists(config_status):
|
||||||
|
print('config.status not found. Please run |mach configure| '
|
||||||
|
'or |mach build| prior to building the %s build backend.'
|
||||||
|
% backend)
|
||||||
|
return 1
|
||||||
|
|
||||||
args = [python, config_status, '--backend=%s' % backend]
|
args = [python, config_status, '--backend=%s' % backend]
|
||||||
if diff:
|
if diff:
|
||||||
args.append('--diff')
|
args.append('--diff')
|
||||||
|
|||||||
Reference in New Issue
Block a user