зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1671424 - Move configure execution from client.mk to `mach configure`. r=firefox-build-system-reviewers,rstewart
`mach configure` currently runs the equivalent to `make -f client.mk`. This is history, and essentially does the following: - Create `configure` and `js/src/configure` from `configure.in` and `js/src/configure.in` respectively. - Create the objdir. - Run `configure` from the objdir. The `configure` script is, nowadays, only really used as a means to set OLD_CONFIGURE (and also for people who want to run `configure`, literally, as in the `configure; make` workflow). `mach configure` actually doesn't need it. Neither does recursing into `js/src` require `js/src/configure`, since bug 1520340 (and now as of bug 1669633, we don't even recurse). Because configure.py can actually derive OLD_CONFIGURE on its own (except for `js/src/configure`, but `mach configure` doesn't run that), we don't really need `configure` for `mach configure`. So all in all, we're at a point in history where it's straightforward to just initiate configure.py from mach configure, so we just do that. And in the hypothetical case where the `mach configure` code is somehow running in python2, we get the mach virtualenv python3 and use it to execute `configure.py`. Differential Revision: https://phabricator.services.mozilla.com/D93741
This commit is contained in:
Родитель
335531c4bf
Коммит
54f6141287
39
client.mk
39
client.mk
|
@ -58,10 +58,6 @@ endif
|
|||
|
||||
MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
|
||||
|
||||
# 'configure' scripts generated by autoconf.
|
||||
CONFIGURES := $(TOPSRCDIR)/configure
|
||||
CONFIGURES += $(TOPSRCDIR)/js/src/configure
|
||||
|
||||
#######################################################################
|
||||
# Rules
|
||||
|
||||
|
@ -86,38 +82,6 @@ build::
|
|||
$(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=$(UPLOAD_PATH)/sccache.log $(MOZBUILD_MANAGE_SCCACHE_DAEMON) --start-server
|
||||
endif
|
||||
|
||||
####################################
|
||||
# Configure
|
||||
|
||||
$(CONFIGURES): %: %.in
|
||||
@echo Generating $@
|
||||
cp -f $< $@
|
||||
chmod +x $@
|
||||
|
||||
CONFIGURE_ENV_ARGS += \
|
||||
MAKE='$(MAKE)' \
|
||||
$(NULL)
|
||||
|
||||
# configure uses the program name to determine @srcdir@. Calling it without
|
||||
# $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
|
||||
# path of $(TOPSRCDIR).
|
||||
ifeq ($(TOPSRCDIR),$(OBJDIR))
|
||||
CONFIGURE = ./configure
|
||||
else
|
||||
CONFIGURE = $(TOPSRCDIR)/configure
|
||||
endif
|
||||
|
||||
configure:: $(CONFIGURES)
|
||||
$(call BUILDSTATUS,TIERS configure)
|
||||
$(call BUILDSTATUS,TIER_START configure)
|
||||
@echo cd $(OBJDIR);
|
||||
@echo $(CONFIGURE) $(CONFIGURE_ARGS)
|
||||
@cd $(OBJDIR) && $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
|
||||
|| ( echo '*** Fix above errors and then restart with\
|
||||
"./mach build"' && exit 1 )
|
||||
@touch $(OBJDIR)/Makefile
|
||||
$(call BUILDSTATUS,TIER_FINISH configure)
|
||||
|
||||
####################################
|
||||
# Build it
|
||||
|
||||
|
@ -135,5 +99,4 @@ endif
|
|||
.NOTPARALLEL:
|
||||
|
||||
.PHONY: \
|
||||
build \
|
||||
configure
|
||||
build
|
||||
|
|
|
@ -15,6 +15,5 @@
|
|||
SRCDIR=$(dirname $0)
|
||||
TOPSRCDIR="$SRCDIR"
|
||||
PYTHON3="${PYTHON3:-python3}"
|
||||
export OLD_CONFIGURE="$SRCDIR"/old-configure
|
||||
|
||||
exec "$PYTHON3" "$TOPSRCDIR/configure.py" "$@"
|
||||
|
|
|
@ -40,6 +40,9 @@ import six
|
|||
def main(argv):
|
||||
config = {}
|
||||
|
||||
if 'OLD_CONFIGURE' not in os.environ:
|
||||
os.environ['OLD_CONFIGURE'] = os.path.join(base_dir, 'old-configure')
|
||||
|
||||
sandbox = ConfigureSandbox(config, os.environ, argv)
|
||||
|
||||
clobber_file = 'CLOBBER'
|
||||
|
|
|
@ -756,8 +756,6 @@ def config_status_deps(build_env, build_project):
|
|||
|
||||
return list(__sandbox__._all_paths) + extra_deps + [
|
||||
os.path.join(topsrcdir, 'CLOBBER'),
|
||||
os.path.join(topsrcdir, 'configure'),
|
||||
os.path.join(topsrcdir, 'js', 'src', 'configure'),
|
||||
os.path.join(topsrcdir, 'configure.in'),
|
||||
os.path.join(topsrcdir, 'js', 'src', 'configure.in'),
|
||||
os.path.join(topsrcdir, 'nsprpub', 'configure'),
|
||||
|
|
|
@ -671,7 +671,7 @@ class MozbuildObject(ProcessExecutionMixin):
|
|||
"""
|
||||
self._ensure_objdir_exists()
|
||||
|
||||
args = self._make_path()
|
||||
args = [self._make_path()]
|
||||
|
||||
if directory:
|
||||
args.extend(['-C', directory.replace(os.sep, '/')])
|
||||
|
@ -795,7 +795,7 @@ class MozbuildObject(ProcessExecutionMixin):
|
|||
continue
|
||||
result, xcode_lisense_error_tmp = validate_make(make)
|
||||
if result:
|
||||
return [make]
|
||||
return make
|
||||
if xcode_lisense_error_tmp:
|
||||
xcode_lisense_error = True
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ except Exception:
|
|||
psutil = None
|
||||
|
||||
from mach.mixin.logging import LoggingMixin
|
||||
from mozboot.util import get_mach_virtualenv_binary
|
||||
import mozfile
|
||||
from mozsystemmonitor.resourcemonitor import SystemResourceMonitor
|
||||
from mozterm.widgets import Footer
|
||||
|
@ -53,9 +54,6 @@ from ..compilation.warnings import (
|
|||
WarningsCollector,
|
||||
WarningsDatabase,
|
||||
)
|
||||
from ..shellutil import (
|
||||
quote as shell_quote,
|
||||
)
|
||||
from ..util import (
|
||||
FileAvoidWrite,
|
||||
mkdir,
|
||||
|
@ -1407,19 +1405,43 @@ class BuildDriver(MozbuildObject):
|
|||
|
||||
line_handler = line_handler or on_line
|
||||
|
||||
options = ' '.join(shell_quote(o) for o in options or ())
|
||||
append_env = dict(append_env or {})
|
||||
append_env['CONFIGURE_ARGS'] = options
|
||||
append_env['MAKE'] = self._make_path()
|
||||
|
||||
# Only print build status messages when we have an active
|
||||
# monitor.
|
||||
if not buildstatus_messages:
|
||||
append_env['NO_BUILDSTATUS_MESSAGES'] = '1'
|
||||
status = self._run_client_mk(target='configure',
|
||||
line_handler=line_handler,
|
||||
append_env=append_env)
|
||||
# Back when client.mk was used, `mk_add_options "export ..."` lines
|
||||
# from the mozconfig would spill into the configure environment, so
|
||||
# add that for backwards compatibility.
|
||||
for line in self.mozconfig['make_extra'] or []:
|
||||
if line.startswith('export '):
|
||||
k, eq, v = line[len('export '):].partition('=')
|
||||
if eq == '=':
|
||||
append_env[k] = v
|
||||
|
||||
if not status:
|
||||
if six.PY3:
|
||||
python = sys.executable
|
||||
else:
|
||||
# Try to get the mach virtualenv Python if we can.
|
||||
python = get_mach_virtualenv_binary()
|
||||
if not os.path.exists(python):
|
||||
python = 'python3'
|
||||
|
||||
command = [python, os.path.join(self.topsrcdir, 'configure.py')]
|
||||
if options:
|
||||
command.extend(options)
|
||||
|
||||
if buildstatus_messages:
|
||||
line_handler('BUILDSTATUS TIERS configure')
|
||||
line_handler('BUILDSTATUS TIER_START configure')
|
||||
status = self._run_command_in_objdir(
|
||||
args=command,
|
||||
line_handler=line_handler,
|
||||
append_env=append_env,
|
||||
)
|
||||
if buildstatus_messages:
|
||||
line_handler('BUILDSTATUS TIER_FINISH configure')
|
||||
if status:
|
||||
print('*** Fix above errors and then restart with "./mach build"')
|
||||
else:
|
||||
print('Configure complete!')
|
||||
print('Be sure to run |mach build| to pick up any changes')
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче