Bug 1861273 - Add some profile markers for sub-phases of configure. r=firefox-build-system-reviewers,ahochheiden

Differential Revision: https://phabricator.services.mozilla.com/D191910
This commit is contained in:
Mike Hommey 2023-10-26 00:49:31 +00:00
Родитель b4ae989be0
Коммит efeeadc85f
2 изменённых файлов: 45 добавлений и 21 удалений

Просмотреть файл

@ -34,6 +34,16 @@ from mozbuild.backend.configenvironment import PartialConfigEnvironment
from mozbuild.configure import TRACE, ConfigureSandbox
from mozbuild.pythonutil import iter_modules_in_path
if "MOZ_CONFIGURE_BUILDSTATUS" in os.environ:
def buildstatus(message):
print("BUILDSTATUS", message)
else:
def buildstatus(message):
return
def main(argv):
# Check for CRLF line endings.
@ -111,7 +121,9 @@ def main(argv):
file=sys.stderr,
)
return 1
buildstatus("START_configure activate virtualenv")
_activate_build_virtualenv()
buildstatus("END_configure activate virtualenv")
clobber_file = "CLOBBER"
if not os.path.exists(clobber_file):
@ -122,37 +134,48 @@ def main(argv):
if os.environ.get("MOZ_CONFIGURE_TRACE"):
sandbox._logger.setLevel(TRACE)
sandbox.run(os.path.join(os.path.dirname(__file__), "moz.configure"))
buildstatus("START_configure read moz.configure")
sandbox.include_file(os.path.join(os.path.dirname(__file__), "moz.configure"))
buildstatus("END_configure read moz.configure")
buildstatus("START_configure run moz.configure")
sandbox.run()
buildstatus("END_configure run moz.configure")
if sandbox._help:
return 0
buildstatus("START_configure config.status")
logging.getLogger("moz.configure").info("Creating config.status")
old_js_configure_substs = config.pop("OLD_JS_CONFIGURE_SUBSTS", None)
old_js_configure_defines = config.pop("OLD_JS_CONFIGURE_DEFINES", None)
if old_js_configure_substs or old_js_configure_defines:
js_config = config.copy()
pwd = os.getcwd()
try:
try:
if old_js_configure_substs or old_js_configure_defines:
js_config = config.copy()
pwd = os.getcwd()
try:
os.makedirs("js/src")
except OSError as e:
if e.errno != errno.EEXIST:
raise
try:
os.makedirs("js/src")
except OSError as e:
if e.errno != errno.EEXIST:
raise
os.chdir("js/src")
js_config["OLD_CONFIGURE_SUBSTS"] = old_js_configure_substs
js_config["OLD_CONFIGURE_DEFINES"] = old_js_configure_defines
# The build system frontend expects $objdir/js/src/config.status
# to have $objdir/js/src as topobjdir.
# We want forward slashes on all platforms.
js_config["TOPOBJDIR"] += "/js/src"
config_status(js_config, execute=False)
finally:
os.chdir(pwd)
os.chdir("js/src")
js_config["OLD_CONFIGURE_SUBSTS"] = old_js_configure_substs
js_config["OLD_CONFIGURE_DEFINES"] = old_js_configure_defines
# The build system frontend expects $objdir/js/src/config.status
# to have $objdir/js/src as topobjdir.
# We want forward slashes on all platforms.
js_config["TOPOBJDIR"] += "/js/src"
ret = config_status(js_config, execute=False)
if ret:
return ret
finally:
os.chdir(pwd)
return config_status(config)
return config_status(config)
finally:
buildstatus("END_configure config.status")
def check_unicode(obj):
@ -219,7 +242,7 @@ def config_status(config, execute=True):
if not check_unicode(sanitized_config):
print("Configuration should be all unicode.", file=sys.stderr)
print("Please file a bug for the above.", file=sys.stderr)
sys.exit(1)
return 1
# Create config.status. Eventually, we'll want to just do the work it does
# here, when we're able to skip configure tests/use cached results/not rely

Просмотреть файл

@ -1677,6 +1677,7 @@ class BuildDriver(MozbuildObject):
command.extend(options)
if buildstatus_messages:
append_env["MOZ_CONFIGURE_BUILDSTATUS"] = "1"
line_handler("BUILDSTATUS TIERS configure")
line_handler("BUILDSTATUS TIER_START configure")