Packager improvements

This commit is contained in:
K4sum1 2025-04-26 22:31:50 -07:00
commit 413bd9a872
4 changed files with 13 additions and 79 deletions

View file

@ -39,14 +39,20 @@ MOZ_PKG_PLATFORM := win32
endif
endif
ifeq ($(OS_ARCH),Darwin)
ifdef UNIVERSAL_BINARY
MOZ_PKG_PLATFORM := mac
else
ifeq ($(TARGET_CPU),x86_64)
MOZ_PKG_PLATFORM := intel64
else
endif
ifeq ($(TARGET_CPU),x86)
MOZ_PKG_PLATFORM := intel32
endif
ifeq ($(TARGET_CPU),aarch64)
MOZ_PKG_PLATFORM := arm64
endif
ifeq ($(TARGET_CPU),powerpc)
MOZ_PKG_PLATFORM := powerpc
endif
ifdef UNIVERSAL_BINARY
MOZ_PKG_PLATFORM := mac
endif
endif
ifeq ($(TARGET_OS),linux-gnu)

View file

@ -65,19 +65,6 @@ ifdef MOZ_PACKAGE_JSSHELL
$(RM) $(PKG_JSSHELL)
$(MAKE_JSSHELL)
endif # MOZ_PACKAGE_JSSHELL
ifdef MOZ_ARTIFACT_BUILD_SYMBOLS
@echo 'Packaging existing crashreporter symbols from artifact build...'
$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
cd $(DIST)/crashreporter-symbols && \
zip -r5D '../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' . -i '*.sym' -i '*.txt'
endif # MOZ_ARTIFACT_BUILD_SYMBOLS
ifdef MOZ_CODE_COVERAGE
# Package code coverage gcno tree
@echo 'Packaging code coverage data...'
$(RM) $(CODE_COVERAGE_ARCHIVE_BASENAME).zip
$(PYTHON) -mmozbuild.codecoverage.packager \
--output-file='$(DIST)/$(PKG_PATH)$(CODE_COVERAGE_ARCHIVE_BASENAME).zip'
endif
ifeq (Darwin, $(OS_ARCH))
ifdef MOZ_ASAN
@echo "Rewriting ASan runtime dylib paths for all binaries in $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH) ..."

View file

@ -32,21 +32,6 @@ import os
from StringIO import StringIO
import subprocess
import platform
import mozinfo
# List of libraries to shlibsign.
SIGN_LIBS = [
'softokn3',
'nssdbm3',
'freebl3',
'freeblpriv3',
'freebl_32fpu_3',
'freebl_32int_3',
'freebl_32int64_3',
'freebl_64fpu_3',
'freebl_64int_3',
]
class ToolLauncher(object):
'''
@ -109,23 +94,6 @@ class ToolLauncher(object):
launcher = ToolLauncher()
class LibSignFile(File):
'''
File class for shlibsign signatures.
'''
def copy(self, dest, skip_if_older=True):
assert isinstance(dest, basestring)
# os.path.getmtime returns a result in seconds with precision up to the
# microsecond. But microsecond is too precise because shutil.copystat
# only copies milliseconds, and seconds is not enough precision.
if os.path.exists(dest) and skip_if_older and \
int(os.path.getmtime(self.path) * 1000) <= \
int(os.path.getmtime(dest) * 1000):
return False
if launcher.launch(['shlibsign', '-v', '-o', dest, '-i', self.path]):
errors.fatal('Error while signing %s' % self.path)
def precompile_cache(registry, source_path, gre_path, app_path):
'''
Create startup cache for the given application directory, using the
@ -373,18 +341,6 @@ def main():
preprocess(removals_in, removals, defines)
copier.add(mozpath.join(respath, 'removed-files'), removals)
# shlibsign libraries
if launcher.can_launch():
if not mozinfo.isMac and buildconfig.substs.get('COMPILE_ENVIRONMENT'):
for lib in SIGN_LIBS:
libbase = mozpath.join(respath, '%s%s') \
% (buildconfig.substs['DLL_PREFIX'], lib)
libname = '%s%s' % (libbase, buildconfig.substs['DLL_SUFFIX'])
if copier.contains(libname):
copier.add(libbase + '.chk',
LibSignFile(os.path.join(args.destination,
libname)))
# Setup preloading
if args.jarlog and os.path.exists(args.jarlog):
from mozpack.mozjar import JarLog

View file

@ -15,11 +15,7 @@ else
ifeq (,$(filter-out gtk2 gtk3 qt, $(MOZ_WIDGET_TOOLKIT)))
MOZ_PKG_FORMAT = BZ2
else
ifeq (android,$(MOZ_WIDGET_TOOLKIT))
MOZ_PKG_FORMAT = APK
else
MOZ_PKG_FORMAT = TGZ
endif
MOZ_PKG_FORMAT = TGZ
endif
endif
endif
@ -384,14 +380,8 @@ ifndef MOZ_PACKAGER_FORMAT
MOZ_PACKAGER_FORMAT = $(error MOZ_PACKAGER_FORMAT is not set)
endif
ifneq (android,$(MOZ_WIDGET_TOOLKIT))
OPTIMIZEJARS = 1
ifneq (gonk,$(MOZ_WIDGET_TOOLKIT))
ifdef NIGHTLY_BUILD
JAR_COMPRESSION ?= none
endif
endif
endif
# We optimize jars on all supported OS-es
OPTIMIZEJARS = 1
# A js binary is needed to perform verification of JavaScript minification.
# We can only use the built binary when not cross-compiling. Environments
@ -459,11 +449,6 @@ UPLOAD_FILES= \
$(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip) \
$(if $(UPLOAD_EXTRA_FILES), $(foreach f, $(UPLOAD_EXTRA_FILES), $(wildcard $(DIST)/$(f))))
ifdef MOZ_CODE_COVERAGE
UPLOAD_FILES += \
$(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(CODE_COVERAGE_ARCHIVE_BASENAME).zip)
endif
ifdef UNIFY_DIST
UNIFY_ARCH := $(notdir $(patsubst %/,%,$(dir $(UNIFY_DIST))))
UPLOAD_FILES += \