mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1448349 - Warn about autoconf $PATH problems on win32 r=firefox-build-system-reviewers,chmanchester
Detect if Unix utilities on win32 are being picked up from a foreign installation of MinGW, such as the tools packaged with Git for Windows. If autoconf dies during `./mach configure` and foreign tools are found in $PATH then warn the user that their $PATH may need to change to fix the problem. Differential Revision: https://phabricator.services.mozilla.com/D52960 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
fc569af3a9
commit
3d8ceef7af
@ -69,13 +69,14 @@ def prepare_mozconfig(mozconfig):
|
||||
return items
|
||||
|
||||
|
||||
@depends('OLD_CONFIGURE', prepare_mozconfig, autoconf, check_build_environment,
|
||||
@depends('OLD_CONFIGURE', 'MOZILLABUILD', prepare_mozconfig, autoconf, check_build_environment,
|
||||
shell, old_configure_assignments, build_project)
|
||||
@imports(_from='__builtin__', _import='open')
|
||||
@imports(_from='__builtin__', _import='print')
|
||||
@imports(_from='__builtin__', _import='sorted')
|
||||
@imports('glob')
|
||||
@imports('itertools')
|
||||
@imports('os')
|
||||
@imports('subprocess')
|
||||
# Import getmtime without overwriting the sandbox os.path.
|
||||
@imports(_from='os.path', _import='getmtime')
|
||||
@ -84,8 +85,9 @@ def prepare_mozconfig(mozconfig):
|
||||
@imports(_from='tempfile', _import='NamedTemporaryFile')
|
||||
@imports(_from='os', _import='remove')
|
||||
@imports(_from='os', _import='rename')
|
||||
@imports(_from='subprocess', _import='CalledProcessError')
|
||||
@imports(_from='__builtin__', _import='OSError')
|
||||
def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
|
||||
def prepare_configure(old_configure, mozillabuild, mozconfig, autoconf, build_env, shell,
|
||||
old_configure_assignments, build_project):
|
||||
# os.path.abspath in the sandbox will ensure forward slashes on Windows,
|
||||
# which is actually necessary because this path actually ends up literally
|
||||
@ -115,10 +117,25 @@ def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
|
||||
|
||||
if refresh:
|
||||
log.info('Refreshing %s with %s', old_configure, autoconf)
|
||||
script = subprocess.check_output([
|
||||
shell, autoconf,
|
||||
'--localdir=%s' % os.path.dirname(old_configure),
|
||||
old_configure + '.in'])
|
||||
|
||||
try:
|
||||
script = subprocess.check_output([
|
||||
shell, autoconf,
|
||||
'--localdir=%s' % os.path.dirname(old_configure),
|
||||
old_configure + '.in'])
|
||||
except CalledProcessError as exc:
|
||||
# Autoconf on win32 may break due to a bad $PATH. Let the user know
|
||||
# their $PATH is suspect.
|
||||
if mozillabuild:
|
||||
mozillabuild_path = normsep(mozillabuild[0])
|
||||
sh_path = normsep(find_program('sh'))
|
||||
if mozillabuild_path not in sh_path:
|
||||
log.warning("The '{}msys/bin' directory is not first in $PATH. "
|
||||
"This may cause autoconf to fail. ($PATH is currently "
|
||||
"set to: {})".format(mozillabuild_path, os.environ[
|
||||
'PATH']))
|
||||
die('autoconf exited with return code {}'.format(exc.returncode))
|
||||
|
||||
if not script:
|
||||
die('Generated old-configure is empty! Check that your autoconf 2.13 program works!')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user