Bug 1861288 - Improve coverage of the pre-export and export phases in profiles. r=firefox-build-system-reviewers,ahochheiden

At the top-level, what we currently have is something akin to:
  export: some deps
    echo BUILDSTATUS TIER_START export
    make recurse_export
    ...

In practice, what this means is that `some` and `deps` are built outside
the export tier/phase.

Since recurse_export is itself a recipe with dependencies, we can "just"
move `some` and `deps` to become dependencies of recurse_export instead.
But since in non top-level directories, recurse_export is not a thing,
we still need to keep the dependencies on export there.

Unfortunately, we have one instance of something built during
recurse_export that relied on its undeclared/undeclarable dependencies
being built before recurse_export, so we need to accomodate for that.

Also, for some reason, recurse_pre-export was a two-colons recipe, while
the other recurse_* recipes were single-colon, so fix that.

Come to think of it, the same probably applies to misc and libs, which
this would mechanically fix alongside.

Incidentally, this also makes those things that ran before recurse_* run
in parallel of the other things that run during recurse_*.

Differential Revision: https://phabricator.services.mozilla.com/D191913
This commit is contained in:
Mike Hommey 2023-10-27 00:01:35 +00:00
parent d812b6e780
commit cc280619c4
4 changed files with 9 additions and 7 deletions

View File

@ -28,6 +28,8 @@ $(MDDEPDIR)/buildid.h.stub $(MDDEPDIR)/source-repo.h.stub: FORCE
endif
source-repo.h: $(MDDEPDIR)/source-repo.h.stub
buildid.h: $(MDDEPDIR)/buildid.h.stub
# Add explicit dependencies that moz.build can't declare yet.
build/$(MDDEPDIR)/application.ini.stub: source-repo.h buildid.h
BUILD_BACKEND_FILES := $(addprefix backend.,$(addsuffix Backend,$(BUILD_BACKENDS)))
@ -98,11 +100,11 @@ install-test-files:
include $(topsrcdir)/build/moz-automation.mk
# Dummy rule for the cases below where we don't depend on dist/include
recurse_pre-export::
recurse_pre-export:
# For the binaries rule, not all the install manifests matter, so force only
# the interesting ones to be done.
recurse_pre-export:: install-manifests
recurse_pre-export: install-manifests
binaries::
@$(MAKE) install-manifests install_manifests=dist/include

View File

@ -44,7 +44,7 @@ include backend.mk
# Add e.g. `export:: $(EXPORT_TARGETS)` rules. The *_TARGETS variables are defined
# in backend.mk.
$(foreach tier,$(RUNNABLE_TIERS),$(eval $(tier):: $($(call varize,$(tier))_TARGETS)))
$(foreach tier,$(RUNNABLE_TIERS),$(eval $(if $(filter .,$(DEPTH)),recurse_$(tier):,$(tier)::) $($(call varize,$(tier))_TARGETS)))
endif
endif

View File

@ -159,7 +159,7 @@ ifeq (.,$(DEPTH))
# This is required so that the pre-export tier sees the rules in
# mobile/android
ifeq ($(MOZ_WIDGET_TOOLKIT),android)
recurse_pre-export:: mobile/android/pre-export
recurse_pre-export: mobile/android/pre-export
endif
# CSS2Properties.webidl needs ServoCSSPropList.py from layout/style
@ -234,7 +234,7 @@ $(addprefix build/unix/stdc++compat/,target host) build/clang-plugin/host: confi
# that run cbindgen, tricking Make into keeping them early.
$(rust_targets): $(DEPTH)/.cargo/config
ifndef TEST_MOZBUILD
pre-export:: $(DEPTH)/.cargo/config
recurse_pre-export: $(DEPTH)/.cargo/config
endif
# When building gtest as part of the build (LINK_GTEST_DURING_COMPILE),

View File

@ -1000,7 +1000,7 @@ $(foreach category,$(INSTALL_TARGETS),\
)
$(foreach tier,$(INSTALL_TARGETS_TIERS), \
$(eval $(tier):: $(INSTALL_TARGETS_FILES_$(tier)) $(INSTALL_TARGETS_EXECUTABLES_$(tier))) \
$(eval $(if $(filter .,$(DEPTH)),recurse_$(tier):,$(tier)::) $(INSTALL_TARGETS_FILES_$(tier)) $(INSTALL_TARGETS_EXECUTABLES_$(tier))) \
)
install_targets_sanity = $(if $(filter-out $(notdir $@),$(notdir $(<))),$(error Looks like $@ has an unexpected dependency on $< which breaks INSTALL_TARGETS))
@ -1070,7 +1070,7 @@ $(foreach category,$(PP_TARGETS), \
)
$(foreach tier,$(PP_TARGETS_TIERS), \
$(eval $(tier):: $(PP_TARGETS_RESULTS_$(tier))) \
$(eval $(if $(filter .,$(DEPTH)),recurse_$(tier):,$(tier)::) $(PP_TARGETS_RESULTS_$(tier))) \
)
PP_TARGETS_ALL_RESULTS := $(sort $(foreach tier,$(PP_TARGETS_TIERS),$(PP_TARGETS_RESULTS_$(tier))))