Commit d77dbc1e authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Add diagnostics and clean up chrome.release warnings

While working on some installer changes I realized that misspelled
patterns in chrome.release are silently ignored, which makes installer
errors harder to find. This change adds optional diagnostics (verbose
only) for patterns that don't match any files, and it cleans up the
errors found by this.

eventlog_provider.dll was not listed as a dependency and was therefore
not reliably placed in chrome.7z.

ffmpeg.dll, icudt.dll, and locales\*.dll no longer ship but were still
listed in chrome.release.

chrome_child.dll is missing but is retained for now so that we can go
back to multi-dll builds if we want to.

The default_apps and Chrome-branded logos were not in the GOOGLE_CHROME
section.

The only other warnings I have seen are from files that are
configuration specific.

We should also consider tagging which patterns are optional so that we
can fail on unexpected missing files, although there may be too many
files that are optional given config variations.

While cleaning up the Python script I made some print-commands
Python 3 compatible and changed how the archive command was printed
so that back-slashes wouldn't be doubled-up.

Bug: 920704, 445616
Change-Id: I96928ea1e1f18a4c52664cf19d0ccca0a10de1d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894434Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712178}
parent 67941fca
......@@ -182,6 +182,7 @@ template("generate_mini_installer") {
":setup_runtime_deps",
"//chrome",
"//chrome/browser/extensions/default_extensions",
"//chrome/common/win:eventlog_provider",
"//chrome/installer/setup",
"//third_party/icu:icudata",
chrome_dll_target,
......
......@@ -25,8 +25,6 @@ chrome_elf.dll: %(VersionDir)s\
chrome_watcher.dll: %(VersionDir)s\
d3dcompiler_47.dll: %(VersionDir)s\
eventlog_provider.dll: %(VersionDir)s\
ffmpeg.dll: %(VersionDir)s\
icudt.dll: %(VersionDir)s\
icudtl.dat: %(VersionDir)s\
libEGL.dll: %(VersionDir)s\
libGLESv2.dll: %(VersionDir)s\
......@@ -39,26 +37,17 @@ v8_context_snapshot.bin: %(VersionDir)s\
#
# Sub directories living in the version dir
#
default_apps\*.crx: %(VersionDir)s\default_apps\
default_apps\external_extensions.json: %(VersionDir)s\default_apps\
Extensions\*.*: %(VersionDir)s\Extensions\
locales\*.dll: %(VersionDir)s\Locales
locales\*.pak: %(VersionDir)s\Locales
#
# VisualElements sub-dir.
#
# All or none of the following files need to be present as the creation of
# All or none of the *Logo*.png files need to be present as the creation of
# VisualElementsManifest.xml is based on the existence of
# %(VersionDir)\VisualElements.
Logo.png: %(VersionDir)s\VisualElements\
LogoBeta.png: %(VersionDir)s\VisualElements\
LogoCanary.png: %(VersionDir)s\VisualElements\
LogoDev.png: %(VersionDir)s\VisualElements\
SmallLogo.png: %(VersionDir)s\VisualElements\
SmallLogoBeta.png: %(VersionDir)s\VisualElements\
SmallLogoCanary.png: %(VersionDir)s\VisualElements\
SmallLogoDev.png: %(VersionDir)s\VisualElements\
#
# SwiftShader sub-dir
......@@ -81,6 +70,22 @@ chrome_200_percent.pak: %(VersionDir)s\
# The elevation service is only installed for Google Chrome builds.
elevation_service.exe: %(VersionDir)s\
#
# Sub directories living in the version dir
#
default_apps\*.crx: %(VersionDir)s\default_apps\
default_apps\external_extensions.json: %(VersionDir)s\default_apps\
#
# VisualElements sub-dir.
#
LogoBeta.png: %(VersionDir)s\VisualElements\
LogoCanary.png: %(VersionDir)s\VisualElements\
LogoDev.png: %(VersionDir)s\VisualElements\
SmallLogoBeta.png: %(VersionDir)s\VisualElements\
SmallLogoCanary.png: %(VersionDir)s\VisualElements\
SmallLogoDev.png: %(VersionDir)s\VisualElements\
#
# Widevine CDM sub-dir
#
......
......@@ -24,7 +24,7 @@ import sys
ARCHIVE_DIR = "installer_archive"
# suffix to uncompresed full archive file, appended to options.output_name
# suffix to uncompressed full archive file, appended to options.output_name
ARCHIVE_SUFFIX = ".7z"
BSDIFF_EXEC = "bsdiff.exe"
CHROME_DIR = "Chrome-bin"
......@@ -94,12 +94,13 @@ def CompressUsingLZMA(build_dir, compressed_file, input_file, verbose):
def CopyAllFilesToStagingDir(config, distribution, staging_dir, build_dir,
enable_hidpi, include_snapshotblob):
enable_hidpi, include_snapshotblob, verbose):
"""Copies the files required for installer archive.
Copies all common files required for various distributions of Chromium and
also files for the specific Chromium build specified by distribution.
"""
CopySectionFilesToStagingDir(config, 'GENERAL', staging_dir, build_dir)
CopySectionFilesToStagingDir(config, 'GENERAL', staging_dir, build_dir,
verbose)
if distribution:
if len(distribution) > 1 and distribution[0] == '_':
distribution = distribution[1:]
......@@ -107,15 +108,18 @@ def CopyAllFilesToStagingDir(config, distribution, staging_dir, build_dir,
distribution = distribution.upper()
if config.has_section(distribution):
CopySectionFilesToStagingDir(config, distribution,
staging_dir, build_dir)
staging_dir, build_dir, verbose)
if enable_hidpi == '1':
CopySectionFilesToStagingDir(config, 'HIDPI', staging_dir, build_dir)
CopySectionFilesToStagingDir(config, 'HIDPI', staging_dir, build_dir,
verbose)
if include_snapshotblob == '1':
CopySectionFilesToStagingDir(config, 'SNAPSHOTBLOB', staging_dir, build_dir)
CopySectionFilesToStagingDir(config, 'SNAPSHOTBLOB', staging_dir, build_dir,
verbose)
def CopySectionFilesToStagingDir(config, section, staging_dir, src_dir):
def CopySectionFilesToStagingDir(config, section, staging_dir, src_dir,
verbose):
"""Copies installer archive files specified in section from src_dir to
staging_dir. This method reads section from config and copies all the
files specified from src_dir to staging dir.
......@@ -128,6 +132,8 @@ def CopySectionFilesToStagingDir(config, section, staging_dir, src_dir):
dst_dir = os.path.join(staging_dir, config.get(section, option))
dst_dir = dst_dir.replace('\\', os.sep)
src_paths = glob.glob(os.path.join(src_dir, src_subdir))
if verbose and not src_paths:
print('No matches found for %s' % option)
if src_paths and not os.path.exists(dst_dir):
os.makedirs(dst_dir)
for src_path in src_paths:
......@@ -196,14 +202,14 @@ def RunSystemCommand(cmd, verbose):
captures its output and only emits it on failure.
"""
if verbose:
print 'Running', cmd
print('Running %s' % ' '.join(cmd))
try:
# Run |cmd|, redirecting stderr to stdout in order for captured errors to be
# inline with corresponding stdout.
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
if verbose:
print output
print(output)
except subprocess.CalledProcessError as e:
raise Exception("Error while running cmd: %s\n"
"Exit code: %s\n"
......@@ -520,7 +526,8 @@ def main(options):
CopyAllFilesToStagingDir(config, options.distribution,
staging_dir, options.build_dir,
options.enable_hidpi,
options.include_snapshotblob)
options.include_snapshotblob,
options.verbose)
if options.component_build == '1':
DoComponentBuildTasks(staging_dir, options.build_dir,
......@@ -636,5 +643,5 @@ def _ParseOptions():
if '__main__' == __name__:
options = _ParseOptions()
if options.verbose:
print sys.argv
print(sys.argv)
sys.exit(main(options))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment