Bug 1565706 - Allow to run `mach build rust` without setting MOZ_RUST_TIER. r=froydnj

At the same time, make things a little more tangible in the tiers setup
in baseconfig.mk.

Differential Revision: https://phabricator.services.mozilla.com/D37942

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2019-07-15 23:50:31 +00:00
Родитель a2b90fe037
Коммит 6098f22649
3 изменённых файлов: 29 добавлений и 6 удалений

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

@ -51,7 +51,7 @@ ifndef TEST_MOZBUILD
ifndef MOZ_PROFILE_USE
# We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
# rules.mk doesn't run early enough.
$(TIERS) binaries:: CLOBBER $(BUILD_BACKEND_FILES)
$(RUNNABLE_TIERS) binaries:: CLOBBER $(BUILD_BACKEND_FILES)
endif
endif

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

@ -42,7 +42,30 @@ endif # WINNT
ifndef INCLUDED_AUTOCONF_MK
default::
else
TIERS := $(if $(MOZ_ARTIFACT_BUILDS),artifact )$(if $(MOZ_EME_WIN32_ARTIFACT),win32-artifact )$(if $(MOZ_ANDROID_FAT_AAR_ARCHITECTURES),android-fat-aar-artifact )pre-export export $(if $(COMPILE_ENVIRONMENT),$(if $(MOZ_RUST_TIER),rust )compile )misc libs tools$(if $(filter check recurse_check,$(MAKECMDGOALS)), check)
# All possible tiers
ALL_TIERS := artifact win32-artifact android-fat-aar-artifact pre-export export rust compile misc libs tools check
# All tiers that may be used manually via `mach build $tier`
RUNNABLE_TIERS := $(ALL_TIERS)
ifndef MOZ_ARTIFACT_BUILDS
RUNNABLE_TIERS := $(filter-out artifact,$(RUNNABLE_TIERS))
endif
ifndef MOZ_EME_WIN32_ARTIFACT
RUNNABLE_TIERS := $(filter-out win32-artifact,$(RUNNABLE_TIERS))
endif
ifndef MOZ_ANDROID_FAT_AAR_ARCHITECTURES
RUNNABLE_TIERS := $(filter-out android-fat-aar-artifact,$(RUNNABLE_TIERS))
endif
# All tiers that run automatically on `mach build`
TIERS := $(filter-out check,$(RUNNABLE_TIERS))
ifndef COMPILE_ENVIRONMENT
TIERS := $(filter-out rust compile,$(TIERS))
endif
ifndef MOZ_RUST_TIER
TIERS := $(filter-out rust,$(TIERS))
endif
endif
# These defines are used to support the twin-topsrcdir model for comm-central.

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

@ -28,7 +28,7 @@ include root.mk
# Main rules (export, compile, libs and tools) call recurse_* rules.
# This wrapping is only really useful for build status.
$(TIERS)::
$(RUNNABLE_TIERS)::
$(if $(filter $@,$(MAKECMDGOALS)),$(call BUILDSTATUS,TIERS $@),)
$(call BUILDSTATUS,TIER_START $@)
+$(MAKE) recurse_$@
@ -41,7 +41,7 @@ binaries::
# Carefully avoid $(eval) type of rule generation, which makes pymake slower
# than necessary.
# Get current tier and corresponding subtiers from the data in root.mk.
CURRENT_TIER := $(filter $(foreach tier,$(TIERS) $(non_default_tiers),recurse_$(tier) $(tier)-deps),$(MAKECMDGOALS))
CURRENT_TIER := $(filter $(foreach tier,$(RUNNABLE_TIERS) $(non_default_tiers),recurse_$(tier) $(tier)-deps),$(MAKECMDGOALS))
ifneq (,$(filter-out 0 1,$(words $(CURRENT_TIER))))
$(error $(CURRENT_TIER) not supported on the same make command line)
endif
@ -129,7 +129,7 @@ else
# Don't recurse if MAKELEVEL is NO_RECURSE_MAKELEVEL as defined above
ifeq ($(NO_RECURSE_MAKELEVEL),$(MAKELEVEL))
$(TIERS)::
$(RUNNABLE_TIERS)::
else
#########################
@ -144,7 +144,7 @@ $(1):: $$(SUBMAKEFILES)
endef
$(foreach subtier,$(filter-out compile,$(TIERS)),$(eval $(call CREATE_SUBTIER_TRAVERSAL_RULE,$(subtier))))
$(foreach subtier,$(filter-out compile,$(RUNNABLE_TIERS)),$(eval $(call CREATE_SUBTIER_TRAVERSAL_RULE,$(subtier))))
ifndef TOPLEVEL_BUILD
ifdef COMPILE_ENVIRONMENT