Bug 1651130 - Part 2: Add a new tools/update-programs build project. r=froydnj

Here "update programs" refers to the various standalone binaries we
produce in order to update Firefox.  There's not strong conceptual
coherence between them; rather, it's the pieces that the
Install/Update team generally work on.

To use this build project, prepare a minimal mozconfig with
`--enable-project=tools/update-programs`.  Depending on the mozconfig
options and host and target OS, some of the following will be built:

1. the maintenance service;
2. the updater binary;
3. the Windows Default Browser Agent;
4. the Background Update Agent.

Differential Revision: https://phabricator.services.mozilla.com/D82644
This commit is contained in:
Nick Alexander 2020-07-08 23:03:21 +00:00
parent c15a785768
commit aa96e0fc28
7 changed files with 133 additions and 3 deletions

View File

@ -166,9 +166,13 @@ UNIFIED_SOURCES += [
'Utf8.cpp',
]
if CONFIG['MOZ_BUILD_APP'] not in ('memory', 'tools/crashreporter', 'tools/update-packaging'):
# Building MFBT tests adds a large overhead when building
# tools/crashreporter.
if CONFIG['MOZ_BUILD_APP'] not in (
'memory',
'tools/crashreporter',
'tools/update-packaging',
'tools/update-programs',
):
# Building MFBT tests adds a large overhead when building.
TEST_DIRS += ['tests']
DEFINES['IMPL_MFBT'] = True

View File

@ -32,6 +32,7 @@ class LintMeta(type):
'js',
'memory',
'mobile/android',
'tools/update-programs',
):
attrs['test_%s' % project.replace('/', '_')] = create_test(
project, attrs['lint'])

View File

@ -39,8 +39,10 @@ ifdef MOCHITESTBROWSERDIR
rsync -a -C $(XPCSHELLTESTDIR)/data/updater.app $(MOCHITESTBROWSERDIR)/
endif
else
$(MKDIR) -p $(XPCSHELLTESTDIR)/data
cp $(FINAL_TARGET)/updater-xpcshell$(BIN_SUFFIX) $(XPCSHELLTESTDIR)/data/updater$(BIN_SUFFIX)
ifdef MOCHITESTBROWSERDIR
$(MKDIR) -p $(MOCHITESTBROWSERDIR)
cp $(FINAL_TARGET)/updater-xpcshell$(BIN_SUFFIX) $(MOCHITESTBROWSERDIR)/updater$(BIN_SUFFIX)
endif
endif

View File

@ -0,0 +1,20 @@
This directory defines a build project for focused work on the "update
programs": programs owned or maintained by the Install/Update team
that are standalone binaries (i.e., not part of the Firefox binary
proper).
To use this build project, prepare a minimal mozconfig with
```
ac_add_options --enable-project=tools/update-programs
```
Depending on the mozconfig options and host and target OS, some of the
following will be built:
1. the maintenance service (when `--enable-maintenance-service`);
2. the updater binary (when `MOZ_UPDATER=1`);
3. the Windows Default Browser Agent (when `--enable-default-browser-agent`);
4. the Background Update Agent (when `--enable-update-agent`).
Packaging the installer and uninstaller is not yet supported: instead,
use an (artifact) build with `--enable-application=browser`.

View File

@ -0,0 +1,65 @@
# 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/.
if CONFIG['MOZ_MAINTENANCE_SERVICE'] or \
CONFIG['MOZ_UPDATE_AGENT'] or \
CONFIG['MOZ_UPDATER']:
DIRS += [
'/toolkit/mozapps/update/common',
]
if CONFIG['MOZ_DEFAULT_BROWSER_AGENT']:
DIRS += [
'/toolkit/components/jsoncpp/src/lib_json',
'/toolkit/mozapps/defaultagent',
]
if CONFIG['MOZ_MAINTENANCE_SERVICE']:
DIRS += [
'/toolkit/components/maintenanceservice'
]
if CONFIG['MOZ_UPDATE_AGENT']:
DIRS += [
'/toolkit/components/updateagent',
]
if CONFIG['MOZ_UPDATER']:
# NSS (and NSPR).
DIRS += [
'/modules/xz-embedded',
'/config/external/nspr',
'/config/external/sqlite',
'/config/external/zlib',
'/memory',
'/mozglue',
'/security',
]
# The signing related bits of libmar depend on NSS.
DIRS += [
'/modules/libmar',
'/other-licenses/bsdiff',
'/toolkit/mozapps/update/updater/bspatch',
'/toolkit/mozapps/update/updater',
]
# Expose specific non-XPCOM headers when building standalone.
if not CONFIG['MOZ_UPDATER']:
# When building the updater, we build /mozglue, which includes this.
EXPORTS.mozilla += [
'/mozglue/misc/DynamicallyLinkedFunctionPtr.h',
]
EXPORTS.mozilla += [
'/toolkit/xre/CmdLineAndEnvUtils.h',
'/widget/windows/WinHeaderOnlyUtils.h',
]
EXPORTS += [
'/xpcom/base/nsAutoRef.h',
'/xpcom/base/nsWindowsHelpers.h',
'/xpcom/string/nsCharTraits.h',
'/xpcom/string/nsUTF8Utils.h',
]

View File

@ -0,0 +1,13 @@
#! /bin/sh
# 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/.
MOZ_APP_BASENAME=Firefox
MOZ_APP_VENDOR=Mozilla
MOZ_BRANDING_DIRECTORY=browser/branding/unofficial
MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
# Build the updater by default. Use --disable-updater to not.
MOZ_UPDATER=1

View File

@ -0,0 +1,25 @@
# 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/.
# Spoof a stub of `js/moz.configure` for the included scripts.
@dependable
def building_js():
return False
option(env='JS_STANDALONE', default=building_js,
help='Reserved for internal use')
@depends(target)
def fold_libs(target):
return target.os in ('WINNT', 'OSX', 'Android')
set_config('MOZ_FOLD_LIBS', fold_libs)
include('../../build/moz.configure/rust.configure')
include('../../build/moz.configure/nspr.configure')
include('../../build/moz.configure/nss.configure')
include('../../build/moz.configure/update-programs.configure')