Skip to content

Commit

Permalink
Backed out changeset e34634758f51 (bug 1671424) for bustages on confi…
Browse files Browse the repository at this point in the history
…gure.py . CLOSED TREE
  • Loading branch information
nbeleuzu committed Oct 19, 2020
1 parent 3d8577a commit 235f540
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 33 deletions.
39 changes: 38 additions & 1 deletion client.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ endif

MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)

# 'configure' scripts generated by autoconf.
CONFIGURES := $(TOPSRCDIR)/configure
CONFIGURES += $(TOPSRCDIR)/js/src/configure

#######################################################################
# Rules

Expand All @@ -82,6 +86,38 @@ 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

Expand All @@ -99,4 +135,5 @@ endif
.NOTPARALLEL:

.PHONY: \
build
build \
configure
1 change: 1 addition & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
SRCDIR=$(dirname $0)
TOPSRCDIR="$SRCDIR"
PYTHON3="${PYTHON3:-python3}"
export OLD_CONFIGURE="$SRCDIR"/old-configure

exec "$PYTHON3" "$TOPSRCDIR/configure.py" "$@"
3 changes: 0 additions & 3 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
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'
Expand Down
2 changes: 2 additions & 0 deletions moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,8 @@ 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'),
Expand Down
4 changes: 2 additions & 2 deletions python/mozbuild/mozbuild/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ def _run_make(self, directory=None, filename=None, target=None, log=True,
"""
self._ensure_objdir_exists()

args = [self._make_path()]
args = self._make_path()

if directory:
args.extend(['-C', directory.replace(os.sep, '/')])
Expand Down Expand Up @@ -795,7 +795,7 @@ def validate_make(make):
continue
result, xcode_lisense_error_tmp = validate_make(make)
if result:
return make
return [make]
if xcode_lisense_error_tmp:
xcode_lisense_error = True

Expand Down
41 changes: 14 additions & 27 deletions python/mozbuild/mozbuild/controller/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
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
Expand All @@ -54,6 +53,9 @@
WarningsCollector,
WarningsDatabase,
)
from ..shellutil import (
quote as shell_quote,
)
from ..util import (
FileAvoidWrite,
mkdir,
Expand Down Expand Up @@ -1405,34 +1407,19 @@ def on_line(line):

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['MAKE'] = self._make_path()
append_env['CONFIGURE_ARGS'] = options

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:
# 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)

if not status:
print('Configure complete!')
print('Be sure to run |mach build| to pick up any changes')

Expand Down

0 comments on commit 235f540

Please sign in to comment.