Skip to content

Commit ede57dd

Browse files
committedMay 21, 2018
Bug 1461836 - Write out complete configure dependencies from configure for consumption by make and non-make backends. r=mshal
MozReview-Commit-ID: 792seCZ2rs1
1 parent cc4c1ab commit ede57dd

File tree

4 files changed

+40
-50
lines changed

4 files changed

+40
-50
lines changed
 

‎Makefile.in

-9
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,6 @@ CLOBBER: $(topsrcdir)/CLOBBER
7070
@exit 1
7171
endif
7272

73-
$(topsrcdir)/configure: $(topsrcdir)/configure.in $(topsrcdir)/old-configure.in
74-
$(topsrcdir)/js/src/configure: $(topsrcdir)/js/src/configure.in $(topsrcdir)/js/src/old-configure.in
75-
$(topsrcdir)/configure $(topsrcdir)/js/src/configure:
76-
@echo 'STOP! $? has changed, and your configure is out of date.'
77-
@echo 'Please rerun autoconf and re-configure your build directory.'
78-
@echo 'To ignore this message, touch "$@",'
79-
@echo 'but your build might not succeed.'
80-
@exit 1
81-
8273
config.status: $(configure_dir)/configure $(configure_dir)/old-configure
8374
js/src/config.status: $(topsrcdir)/js/src/configure $(topsrcdir)/js/src/old-configure
8475
config.status js/src/config.status:

‎client.mk

+3-25
Original file line numberDiff line numberDiff line change
@@ -91,36 +91,14 @@ endif
9191
MAKEFILE = $(wildcard $(OBJDIR)/Makefile)
9292
CONFIG_STATUS = $(wildcard $(OBJDIR)/config.status)
9393

94-
EXTRA_CONFIG_DEPS := \
95-
$(TOPSRCDIR)/aclocal.m4 \
96-
$(TOPSRCDIR)/old-configure.in \
97-
$(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \
98-
$(TOPSRCDIR)/js/src/aclocal.m4 \
99-
$(TOPSRCDIR)/js/src/old-configure.in \
100-
$(NULL)
94+
# Include deps for configure written by configure itself.
95+
CONFIG_STATUS_DEPS := $(if $(wildcard $(OBJDIR)/config_status_deps.in),$(shell cat $(OBJDIR)/config_status_deps.in),)
10196

102-
$(CONFIGURES): %: %.in $(EXTRA_CONFIG_DEPS)
97+
$(CONFIGURES): %: %.in
10398
@echo Generating $@
10499
cp -f $< $@
105100
chmod +x $@
106101

107-
CONFIG_STATUS_DEPS := \
108-
$(wildcard $(TOPSRCDIR)/*/confvars.sh) \
109-
$(CONFIGURES) \
110-
$(TOPSRCDIR)/nsprpub/configure \
111-
$(TOPSRCDIR)/config/milestone.txt \
112-
$(TOPSRCDIR)/browser/config/version.txt \
113-
$(TOPSRCDIR)/browser/config/version_display.txt \
114-
$(TOPSRCDIR)/build/virtualenv_packages.txt \
115-
$(TOPSRCDIR)/python/mozbuild/mozbuild/virtualenv.py \
116-
$(TOPSRCDIR)/testing/mozbase/packages.txt \
117-
$(OBJDIR)/.mozconfig.json \
118-
$(NULL)
119-
120-
# Include a dep file emitted by configure to track Python files that
121-
# may influence the result of configure.
122-
-include $(OBJDIR)/configure.d
123-
124102
CONFIGURE_ENV_ARGS += \
125103
MAKE='$(MAKE)' \
126104
$(NULL)

‎configure.py

+9-12
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
base_dir = os.path.abspath(os.path.dirname(__file__))
1515
sys.path.insert(0, os.path.join(base_dir, 'python', 'mozbuild'))
1616
from mozbuild.configure import ConfigureSandbox
17-
from mozbuild.makeutil import Makefile
1817
from mozbuild.pythonutil import iter_modules_in_path
1918
from mozbuild.backend.configenvironment import PartialConfigEnvironment
2019
from mozbuild.util import (
2120
indented_repr,
2221
encode,
2322
)
23+
import mozpack.path as mozpath
2424

2525

2626
def main(argv):
@@ -50,7 +50,7 @@ def sanitized_bools(v):
5050
sanitized_config['substs'] = {
5151
k: sanitized_bools(v) for k, v in config.iteritems()
5252
if k not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR',
53-
'ALL_CONFIGURE_PATHS')
53+
'CONFIG_STATUS_DEPS')
5454
}
5555
sanitized_config['defines'] = {
5656
k: sanitized_bools(v) for k, v in config['DEFINES'].iteritems()
@@ -93,16 +93,13 @@ def sanitized_bools(v):
9393
partial_config = PartialConfigEnvironment(config['TOPOBJDIR'])
9494
partial_config.write_vars(sanitized_config)
9595

96-
# Write out a depfile so Make knows to re-run configure when relevant Python
97-
# changes.
98-
mk = Makefile()
99-
rule = mk.create_rule()
100-
rule.add_targets(["%s/config.status" % config['TOPOBJDIR']])
101-
rule.add_dependencies(itertools.chain(config['ALL_CONFIGURE_PATHS'],
102-
iter_modules_in_path(config['TOPOBJDIR'],
103-
config['TOPSRCDIR'])))
104-
with open('configure.d', 'w') as fh:
105-
mk.dump(fh)
96+
# Write out a file so the build backend knows to re-run configure when
97+
# relevant Python changes.
98+
with open('config_status_deps.in', 'w') as fh:
99+
for f in itertools.chain(config['CONFIG_STATUS_DEPS'],
100+
iter_modules_in_path(config['TOPOBJDIR'],
101+
config['TOPSRCDIR'])):
102+
fh.write('%s\n' % mozpath.normpath(f))
106103

107104
# Other things than us are going to run this file, so we need to give it
108105
# executable permissions.

‎moz.configure

+28-4
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,33 @@ check_prog('7Z', ('7z', '7za'), allow_missing=True, when=target_is_windows)
565565
# Fallthrough to autoconf-based configure
566566
include('build/moz.configure/old.configure')
567567

568+
@depends(check_build_environment, build_project)
568569
@imports('__sandbox__')
569-
def all_paths():
570-
return __sandbox__._all_paths
570+
@imports('glob')
571+
def config_status_deps(build_env, build_project):
571572

572-
set_config('ALL_CONFIGURE_PATHS', all_paths())
573-
# Please do not add anything after setting ALL_CONFIGURE_PATHS.
573+
topsrcdir = build_env.topsrcdir
574+
topobjdir = build_env.topobjdir
575+
576+
return list(__sandbox__._all_paths) + [
577+
os.path.join(topsrcdir, build_project, 'confvars.sh'),
578+
os.path.join(topsrcdir, 'configure'),
579+
os.path.join(topsrcdir, 'js', 'src', 'configure'),
580+
os.path.join(topsrcdir, 'configure.in'),
581+
os.path.join(topsrcdir, 'js', 'src', 'configure.in'),
582+
os.path.join(topsrcdir, 'nsprpub', 'configure'),
583+
os.path.join(topsrcdir, 'config', 'milestone.txt'),
584+
os.path.join(topsrcdir, 'browser', 'config', 'version.txt'),
585+
os.path.join(topsrcdir, 'browser', 'config', 'version_display.txt'),
586+
os.path.join(topsrcdir, 'build', 'virtualenv_packages.txt'),
587+
os.path.join(topsrcdir, 'python', 'mozbuild', 'mozbuild', 'virtualenv.py'),
588+
os.path.join(topsrcdir, 'testing', 'mozbase', 'packages.txt'),
589+
os.path.join(topobjdir, '.mozconfig.json'),
590+
os.path.join(topsrcdir, 'aclocal.m4'),
591+
os.path.join(topsrcdir, 'old-configure.in'),
592+
os.path.join(topsrcdir, 'js', 'src', 'aclocal.m4'),
593+
os.path.join(topsrcdir, 'js', 'src', 'old-configure.in'),
594+
] + glob.glob(os.path.join(topsrcdir, 'build', 'autoconf', '*.m4'))
595+
596+
set_config('CONFIG_STATUS_DEPS', config_status_deps)
597+
# Please do not add anything after setting config_dep_paths.

0 commit comments

Comments
 (0)
Failed to load comments.