Files
Alex Hochheiden d436c321ed Bug 2035575 - Add desktop architecture support (Linux, macOS, Windows) to the fat AAR pipeline for libsForTests r=nalexander,firefox-build-system-reviewers,geckoview-reviewers
The `libsForTests` JAR consumers need a complete set of native libraries for
whichever host platform their JVM tests run on, and the fat AAR handled Android
architectures only. It now also stages target.libmegazord_so_artifacts.zip from
the desktop builds.

Only a build with an in-tree app-services produces that archive, so the desktop
paths are named explicitly rather than downloaded, and the Android fallback
takes its AAR from the app-services build when one is in tree.

Differential Revision: https://phabricator.services.mozilla.com/D292612
2026-09-04 06:41:31 +00:00

180 lines
6.1 KiB
Makefile

#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
export TOPLEVEL_BUILD := 1
default::
ifndef TEST_MOZBUILD
ifdef MOZ_BUILD_APP
include $(wildcard $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk)
endif
endif
include $(topsrcdir)/config/config.mk
ifneq (mobile/android,$(MOZ_BUILD_APP))
# We only want to generate buildid.h once, during the (recurse) export phase.
# faster make build the files explicitly so also match thoses
ifneq ($(filter $(MAKECMDGOALS),recurse_export buildid.h source-repo.h),)
$(MDDEPDIR)/buildid.h.stub $(MDDEPDIR)/source-repo.h.stub: FORCE
endif
endif
source-repo.h: $(MDDEPDIR)/source-repo.h.stub
buildid.h: $(MDDEPDIR)/buildid.h.stub
BUILD_BACKEND_FILES := $(addprefix backend.,$(addsuffix Backend,$(BUILD_BACKENDS)))
ifndef TEST_MOZBUILD
# We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
# rules.mk doesn't run early enough.
$(RUNNABLE_TIERS) binaries:: CLOBBER $(BUILD_BACKEND_FILES)
endif
ifdef JS_STANDALONE
.PHONY: CLOBBER
CLOBBER:
else
CLOBBER: $(topsrcdir)/CLOBBER
@echo 'STOP! The CLOBBER file has changed.'
@echo 'Please run the build through "mach build".'
@exit 1
endif
# Consumed by backend-emitted install manifest rules.
install_manifest_depends = \
CLOBBER \
$(BUILD_BACKEND_FILES) \
$(NULL)
include $(topsrcdir)/build/moz-automation.mk
# Dummy rule for the cases below where we don't depend on dist/include
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
binaries::
@$(MAKE) install-manifests-binaries
ifdef BUILD_VERBOSE_LOG
verbose_flag = -v
endif
recurse_artifact:
$(PYTHON3) $(topsrcdir)/mach --log-no-times artifact install$(if $(MOZ_ARTIFACT_BUILD_SYMBOLS), --symbols$(addprefix =,$(filter full,$(MOZ_ARTIFACT_BUILD_SYMBOLS)))) $(if $(ENABLE_TESTS),,--no-tests) $(verbose_flag)
ifdef MOZ_ANDROID_FAT_AAR_ARCHITECTURES
recurse_android-fat-aar-artifact:
$(call py_action,fat_aar,--android-architectures $(MOZ_ANDROID_FAT_AAR_ARCHITECTURES) \
$(if $(MOZ_ANDROID_FAT_AAR_ARMEABI_V7A),--armeabi-v7a $(MOZ_ANDROID_FAT_AAR_ARMEABI_V7A)) \
$(if $(MOZ_ANDROID_FAT_AAR_ARM64_V8A),--arm64-v8a $(MOZ_ANDROID_FAT_AAR_ARM64_V8A)) \
$(if $(MOZ_ANDROID_FAT_AAR_X86_64),--x86-64 $(MOZ_ANDROID_FAT_AAR_X86_64)) \
$(if $(MOZ_ANDROID_FAT_AAR_DESKTOP_ARCHITECTURES),--desktop-architectures $(MOZ_ANDROID_FAT_AAR_DESKTOP_ARCHITECTURES)) \
$(if $(MOZ_ANDROID_FAT_AAR_DESKTOP_LINUX_X86_64),--linux-x86-64 $(MOZ_ANDROID_FAT_AAR_DESKTOP_LINUX_X86_64)) \
$(if $(MOZ_ANDROID_FAT_AAR_DESKTOP_LINUX_AARCH64),--linux-aarch64 $(MOZ_ANDROID_FAT_AAR_DESKTOP_LINUX_AARCH64)) \
$(if $(MOZ_ANDROID_FAT_AAR_DESKTOP_DARWIN_X86_64),--darwin-x86-64 $(MOZ_ANDROID_FAT_AAR_DESKTOP_DARWIN_X86_64)) \
$(if $(MOZ_ANDROID_FAT_AAR_DESKTOP_DARWIN_AARCH64),--darwin-aarch64 $(MOZ_ANDROID_FAT_AAR_DESKTOP_DARWIN_AARCH64)) \
$(if $(MOZ_ANDROID_FAT_AAR_DESKTOP_WIN32_X86_64),--win32-x86-64 $(MOZ_ANDROID_FAT_AAR_DESKTOP_WIN32_X86_64)) \
$(if $(MOZ_ANDROID_FAT_AAR_DESKTOP_WIN32_AARCH64),--win32-aarch64 $(MOZ_ANDROID_FAT_AAR_DESKTOP_WIN32_AARCH64)) \
--distdir $(abspath $(DIST)/fat-aar) \
$(verbose_flag))
endif
ifeq ($(MOZ_BUILD_APP),mobile/android)
recurse_android-stage-package: stage-package
recurse_android-archive-geckoview:
GRADLE_INVOKED_WITHIN_MACH_BUILD=1 $(PYTHON3) $(topsrcdir)/mach --log-no-times android archive-geckoview $(if $(MOZ_AUTOMATION),--no-configuration-cache)
endif
ifdef MOZ_WIDGET_TOOLKIT
ifdef ENABLE_TESTS
# Additional makefile targets to call automated test suites
include $(topsrcdir)/testing/testsuite-targets.mk
endif
endif
default all::
$(call BUILDSTATUS,TIERS $(TIERS) $(if $(MOZ_AUTOMATION),$(MOZ_AUTOMATION_TIERS)))
include $(topsrcdir)/config/rules.mk
ifdef SCCACHE_VERBOSE_STATS
default::
-$(CCACHE) --show-adv-stats --stats-format=json > '$(UPLOAD_PATH)/sccache-stats.json'
@echo "===SCCACHE STATS==="
-$(CCACHE) --show-adv-stats
@echo "==================="
endif
ifdef MOZ_CRASHREPORTER
include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
endif
.PHONY: prepsymbolsarchive
prepsymbolsarchive:
echo packing symbols
$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
ifndef MOZ_AUTOMATION
prepsymbolsarchive: recurse_syms
endif
.PHONY: symbolsfullarchive
symbolsfullarchive: prepsymbolsarchive
$(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst'
$(call py_action,symbols_archive $(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst,'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst' \
$(abspath $(DIST)/crashreporter-symbols) \
--full-archive)
.PHONY: symbolsarchive
symbolsarchive: prepsymbolsarchive
$(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip'
$(call py_action,symbols_archive $(SYMBOL_ARCHIVE_BASENAME).zip,'$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' \
$(abspath $(DIST)/crashreporter-symbols))
# Set MOZ_ENABLE_FULL_SYMBOLS to enable generation and upload of the full
# crashreporter symbols archives
ifdef MOZ_ENABLE_FULL_SYMBOLS
buildsymbols: symbolsfullarchive symbolsarchive
else
ifdef MOZ_CRASHREPORTER
buildsymbols: symbolsarchive
else
buildsymbols:
@echo "Skipping symbols generation because MOZ_CRASHREPORTER is not set."
endif # MOZ_CRASHREPORTER
endif # MOZ_ENABLE_FULL_SYMBOLS
uploadsymbols:
ifdef MOZ_ENABLE_FULL_SYMBOLS
$(PYTHON3) -u $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst'
endif
.PHONY: package-generated-sources
package-generated-sources:
$(call py_action,package_generated_sources,'$(DIST)/$(PKG_PATH)$(GENERATED_SOURCE_FILE_PACKAGE)')
ifdef JS_STANDALONE
# Delegate js-specific rules to js
check-%:
$(MAKE) -C js/src $@
install:
$(MAKE) -C js/src $@
# Every export rule depends on config/export, but the rule for config/export
# doesn't exist when building js non-standalone.
.PHONY: config/export
config/export:
endif
# There used to be build interdependencies here. They are now in config/recurse.mk