Commit 890d09b2 authored by jbauman's avatar jbauman Committed by Commit bot

Remove GYP support from create_installer_archive.py

The component build copier can always rely on having runtime deps
available.

BUG=586967

Review-Url: https://codereview.chromium.org/2556253009
Cr-Commit-Position: refs/heads/master@{#437890}
parent c0418c74
...@@ -485,30 +485,8 @@ def DoComponentBuildTasks(staging_dir, build_dir, target_arch, ...@@ -485,30 +485,8 @@ def DoComponentBuildTasks(staging_dir, build_dir, target_arch,
if not os.path.exists(installer_dir): if not os.path.exists(installer_dir):
os.mkdir(installer_dir) os.mkdir(installer_dir)
if setup_runtime_deps: setup_component_dlls = ParseDLLsFromDeps(build_dir, setup_runtime_deps)
setup_component_dlls = ParseDLLsFromDeps(build_dir, setup_runtime_deps)
else:
# Explicitly list the component DLLs setup.exe depends on (this list may
# contain wildcards). These will be copied to |installer_dir| in the
# archive.
# TODO(jbauman): Remove when GYP is deprecated on Windows.
setup_component_dll_globs = [ 'api-ms-win-*.dll',
'base.dll',
'boringssl.dll',
'crcrypto.dll',
'icui18n.dll',
'icuuc.dll',
'msvc*.dll',
'ucrtbase*.dll',
'vcruntime*.dll', ]
setup_component_dlls = set()
for setup_component_dll_glob in setup_component_dll_globs:
setup_component_partial_dlls = glob.glob(
os.path.join(build_dir, setup_component_dll_glob))
if len(setup_component_partial_dlls) == 0:
raise Exception('Error: missing expected DLL for component build '
'mini_installer: "%s"' % setup_component_dll_glob)
setup_component_dlls.update(setup_component_partial_dlls)
for setup_component_dll in setup_component_dlls: for setup_component_dll in setup_component_dlls:
g_archive_inputs.append(setup_component_dll) g_archive_inputs.append(setup_component_dll)
shutil.copy(setup_component_dll, installer_dir) shutil.copy(setup_component_dll, installer_dir)
...@@ -517,26 +495,13 @@ def DoComponentBuildTasks(staging_dir, build_dir, target_arch, ...@@ -517,26 +495,13 @@ def DoComponentBuildTasks(staging_dir, build_dir, target_arch,
# the version assembly to be able to refer to them below and make sure # the version assembly to be able to refer to them below and make sure
# chrome.exe can find them at runtime), except the ones that are already # chrome.exe can find them at runtime), except the ones that are already
# staged (i.e. non-component DLLs). # staged (i.e. non-component DLLs).
if chrome_runtime_deps: build_dlls = ParseDLLsFromDeps(build_dir, chrome_runtime_deps)
build_dlls = ParseDLLsFromDeps(build_dir, chrome_runtime_deps)
else:
# If no chrome_runtime_deps was specified, every DLL in build_dir is
# considered to be a component DLL.
# TODO(jbauman): Remove when GYP is deprecated on Windows.
build_dlls = glob.glob(os.path.join(build_dir, '*.dll'))
staged_dll_basenames = [os.path.basename(staged_dll) for staged_dll in \ staged_dll_basenames = [os.path.basename(staged_dll) for staged_dll in \
glob.glob(os.path.join(version_dir, '*.dll'))] glob.glob(os.path.join(version_dir, '*.dll'))]
component_dll_filenames = [] component_dll_filenames = []
for component_dll in [dll for dll in build_dlls if \ for component_dll in [dll for dll in build_dlls if \
os.path.basename(dll) not in staged_dll_basenames]: os.path.basename(dll) not in staged_dll_basenames]:
component_dll_name = os.path.basename(component_dll) component_dll_name = os.path.basename(component_dll)
# These remoting_*.dll's don't belong in the archive (it doesn't depend
# on them in gyp). Trying to copy them causes a build race when creating the
# installer archive in component mode. See: crbug.com/180996 and
# crbug.com/586967
if (component_dll_name.startswith('remoting_')):
continue
component_dll_filenames.append(component_dll_name) component_dll_filenames.append(component_dll_name)
g_archive_inputs.append(component_dll) g_archive_inputs.append(component_dll)
shutil.copy(component_dll, version_dir) shutil.copy(component_dll, version_dir)
...@@ -646,9 +611,6 @@ def _ParseOptions(): ...@@ -646,9 +611,6 @@ def _ParseOptions():
parser.add_option('--depfile', parser.add_option('--depfile',
help='Generate a depfile with the given name listing the implicit inputs ' help='Generate a depfile with the given name listing the implicit inputs '
'to the archive process that can be used with a build system.') 'to the archive process that can be used with a build system.')
# TODO(jbauman): Make --chrome_runtime_deps and --setup_runtime_deps
# mandatory when GYP is deprecated on Windows.
parser.add_option('--chrome_runtime_deps', parser.add_option('--chrome_runtime_deps',
help='A file listing runtime dependencies. This will be used to get a ' help='A file listing runtime dependencies. This will be used to get a '
'list of DLLs to archive in a component build.') 'list of DLLs to archive in a component build.')
...@@ -674,6 +636,12 @@ def _ParseOptions(): ...@@ -674,6 +636,12 @@ def _ParseOptions():
if not options.input_file: if not options.input_file:
parser.error('You must provide an input file') parser.error('You must provide an input file')
is_component_build = options.component_build == '1'
if is_component_build and not options.chrome_runtime_deps:
parser.error("chrome_runtime_deps must be specified for a component build")
if is_component_build and not options.setup_runtime_deps:
parser.error("setup_runtime_deps must be specified for a component build")
if not options.output_dir: if not options.output_dir:
options.output_dir = options.build_dir options.output_dir = options.build_dir
......
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