Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9273)

Unified Diff: chrome/tools/build/win/create_installer_archive.py

Issue 2559053002: Instrument setup.exe in the SyzyAsan builds.
Patch Set: create_installer_archive changes. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/mini_installer/BUILD.gn ('k') | chrome/tools/build/win/syzygy/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/build/win/create_installer_archive.py
diff --git a/chrome/tools/build/win/create_installer_archive.py b/chrome/tools/build/win/create_installer_archive.py
index 8c0f8144670e4e1116c04e62bb1d3578c32416dc..2e61bad05f000e6df601226afe223826fe04b18a 100755
--- a/chrome/tools/build/win/create_installer_archive.py
+++ b/chrome/tools/build/win/create_installer_archive.py
@@ -325,7 +325,7 @@ def PrepareSetupExec(options, current_version, prev_version):
'/D', 'CompressionType=LZX',
'/V1',
'/L', options.output_dir,
- os.path.join(options.build_dir, SETUP_EXEC),]
+ os.path.join(options.output_dir, SETUP_EXEC),]
RunSystemCommand(cmd, options.verbose)
setup_file = SETUP_EXEC[:-1] + "_"
return setup_file
@@ -366,11 +366,10 @@ def CreateResourceInputFile(
os.path.join(output_dir, archive_file)))
# Include all files needed to run setup.exe (these are copied into the
# 'Installer' dir by DoComponentBuildTasks).
- if component_build:
- installer_dir = os.path.join(staging_dir, CHROME_DIR, current_version,
- 'Installer')
- for file in os.listdir(installer_dir):
- resources.append((file, 'BN', os.path.join(installer_dir, file)))
grt (UTC plus 2) 2016/12/09 08:30:54 this puts the component DLLs in as uncompressed bl
Sébastien Marchand 2017/03/06 21:52:26 Sure, if you think that all the dll dependencies s
grt (UTC plus 2) 2017/03/10 09:08:10 Yeah, I think it's worth doing the compression. Do
+ installer_dir = os.path.join(staging_dir, CHROME_DIR, current_version,
+ 'Installer')
+ for file in os.listdir(installer_dir):
+ resources.append((file, 'BN', os.path.join(installer_dir, file)))
with open(resource_file_path, 'w') as f:
f.write(_RESOURCE_FILE_HEADER)
@@ -468,6 +467,19 @@ def ParseDLLsFromDeps(build_dir, runtime_deps_file):
build_dlls.add(os.path.join(build_dir, l))
return build_dlls
+
+def CopySetupRuntimeDeps(build_dir, setup_runtime_deps, version_dir):
+ installer_dir = os.path.join(version_dir, 'Installer')
+ # |installer_dir| is technically only created post-install, but we need it
+ # now to add setup.exe's config and manifest to the archive.
+ if not os.path.exists(installer_dir):
+ os.mkdir(installer_dir)
+
+ setup_component_dlls = ParseDLLsFromDeps(build_dir, setup_runtime_deps)
+ for setup_component_dll in setup_component_dlls:
+ g_archive_inputs.append(setup_component_dll)
+ shutil.copy(setup_component_dll, installer_dir)
+
grt (UTC plus 2) 2016/12/09 08:30:54 nit: extra blank line
Sébastien Marchand 2017/03/06 21:52:26 Done.
# Copies component build DLLs and generates required config files and manifests
# in order for chrome.exe and setup.exe to be able to find those DLLs at
# run-time.
@@ -479,39 +491,8 @@ def DoComponentBuildTasks(staging_dir, build_dir, target_arch,
# Get the required directories for the upcoming operations.
chrome_dir = os.path.join(staging_dir, CHROME_DIR)
version_dir = os.path.join(chrome_dir, current_version)
- installer_dir = os.path.join(version_dir, 'Installer')
- # |installer_dir| is technically only created post-install, but we need it
- # now to add setup.exe's config and manifest to the archive.
- if not os.path.exists(installer_dir):
- os.mkdir(installer_dir)
- if 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.
grt (UTC plus 2) 2016/12/09 08:30:54 w00t!
gab 2016/12/09 19:23:24 @grt: re. does setup.exe use the version manifest
- 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:
- g_archive_inputs.append(setup_component_dll)
- shutil.copy(setup_component_dll, installer_dir)
+ CopySetupRuntimeDeps(build_dir, setup_runtime_deps, version_dir)
# Stage all the component DLLs to the |version_dir| (for
# the version assembly to be able to refer to them below and make sure
@@ -584,6 +565,9 @@ def main(options):
DoComponentBuildTasks(staging_dir, options.build_dir,
options.target_arch, options.setup_runtime_deps,
options.chrome_runtime_deps, current_version)
+ elif options.setup_runtime_deps:
+ CopySetupRuntimeDeps(options.build_dir, options.setup_runtime_deps,
+ os.path.join(staging_dir, CHROME_DIR, current_version))
version_numbers = current_version.split('.')
current_build_number = version_numbers[2] + '.' + version_numbers[3]
« no previous file with comments | « chrome/installer/mini_installer/BUILD.gn ('k') | chrome/tools/build/win/syzygy/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698