diff options
author | siggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-05 16:19:04 +0000 |
---|---|---|
committer | siggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-05 16:19:04 +0000 |
commit | dadbe974bba4c8cc780b6aa96cdb550bdaac3c7a (patch) | |
tree | e56acd81b16ee7420aed335888a69709efa87f23 | |
parent | 8080cc2a06ed24dadc644d1283759107ebf7293b (diff) | |
download | chromium_src-dadbe974bba4c8cc780b6aa96cdb550bdaac3c7a.zip chromium_src-dadbe974bba4c8cc780b6aa96cdb550bdaac3c7a.tar.gz chromium_src-dadbe974bba4c8cc780b6aa96cdb550bdaac3c7a.tar.bz2 |
Remove bitrotted, misleading import dependency checking machinery.
BUG=None
TBR=thakis
Review URL: https://chromiumcodereview.appspot.com/12191007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180710 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | chrome/app/check_dependents.bat | 9 | ||||
-rw-r--r-- | chrome/app/chrome.dll.deps | 37 | ||||
-rw-r--r-- | chrome/app/chrome.exe.deps | 26 | ||||
-rw-r--r-- | chrome/chrome_dll.gypi | 5 | ||||
-rwxr-xr-x | chrome/tools/build/win/dependencies.py | 226 |
5 files changed, 0 insertions, 303 deletions
diff --git a/chrome/app/check_dependents.bat b/chrome/app/check_dependents.bat deleted file mode 100755 index 92f8b7b..0000000 --- a/chrome/app/check_dependents.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off -:: A wrapper file for running dependencies.py from visual studio. - -setlocal -:: Dumpbin runs link.exe /dump which detects this environment variable and -:: ignores stdout. So we need to undefine it. -set VS_UNICODE_OUTPUT= -set PYTHON=%~dp0..\..\third_party\python_24\python.exe -%PYTHON% ..\tools\build\win\dependencies.py %* diff --git a/chrome/app/chrome.dll.deps b/chrome/app/chrome.dll.deps deleted file mode 100644 index 3225307..0000000 --- a/chrome/app/chrome.dll.deps +++ /dev/null @@ -1,37 +0,0 @@ -# List of chrome.dll's dependencies.
-
-dependents = [
- 'KERNEL32.dll',
- 'ADVAPI32.dll',
- 'WINMM.dll',
- 'COMCTL32.dll',
- 'SHLWAPI.dll',
- 'GDI32.dll',
- 'SHELL32.dll',
- 'VERSION.dll',
- 'USP10.dll',
- 'ole32.dll',
- 'OLEAUT32.dll',
- 'OLEACC.dll',
- 'PSAPI.DLL',
- 'secur32.dll',
- 't2embed.dll',
- 'riched20.dll',
-]
-
-delay_loaded = [
- 'USER32.dll',
- 'CRYPTUI.dll',
- 'IMM32.dll',
- 'CRYPT32.dll',
- 'WINHTTP.dll',
- 'WININET.dll',
- 'WS2_32.dll',
- 'dwmapi.dll',
- 'dbghelp.dll',
- 'COMDLG32.dll',
- 'urlmon.dll',
- 'ffmpegsumo.dll',
- 'pthreads.dll',
- 'IPHLPAPI.dll',
-]
diff --git a/chrome/app/chrome.exe.deps b/chrome/app/chrome.exe.deps deleted file mode 100644 index b11f696..0000000 --- a/chrome/app/chrome.exe.deps +++ /dev/null @@ -1,26 +0,0 @@ -# List of chrome.exe's dependencies.
-
-dependents = [
- 'KERNEL32.dll',
- 'USER32.dll',
- 'ADVAPI32.dll',
- 'SHELL32.dll',
- 'VERSION.dll', # Used by breakpad
- 'winmm.dll',
-]
-
-dependents_google_chrome = [
- 'KERNEL32.dll',
- 'USER32.dll',
- 'ADVAPI32.dll',
- 'SHELL32.dll',
- 'VERSION.dll',
- 'winmm.dll',
- 'ole32.dll',
- 'oleaut32.dll',
-]
-
-delay_loaded = [
- 'OLE32.dll',
- 'OLEAUT32.dll',
-]
diff --git a/chrome/chrome_dll.gypi b/chrome/chrome_dll.gypi index 818f01b..085dda9 100644 --- a/chrome/chrome_dll.gypi +++ b/chrome/chrome_dll.gypi @@ -139,11 +139,6 @@ '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_unscaled_resources.rc', - - # TODO(sgk): left-over from pre-gyp build, figure out - # if we still need them and/or how to update to gyp. - #'app/check_dependents.bat', - #'app/chrome.dll.deps', ], 'include_dirs': [ '<(DEPTH)/third_party/wtl/include', diff --git a/chrome/tools/build/win/dependencies.py b/chrome/tools/build/win/dependencies.py deleted file mode 100755 index 01d9254..0000000 --- a/chrome/tools/build/win/dependencies.py +++ /dev/null @@ -1,226 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2011 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Script to verify a Portable Executable's dependencies. - -Analyzes the input portable executable (a DLL or an EXE for example), extracts -its imports and confirms that its dependencies haven't changed. This is for -regression testing. - -Returns 0 if the list matches. - 1 if one or more dependencies has been removed. - 2 if one or more dependencies has been added. This preempts removal - result code. -""" - -import optparse -import os -import subprocess -import sys - -# The default distribution name and the environment variable that overrides it. -DIST_DEFAULT = '_chromium' -DIST_ENV_VAR = 'CHROMIUM_BUILD' - -DUMPBIN = "dumpbin.exe" - - -class Error(Exception): - def __init__(self, message): - self.message = message - def __str__(self): - return self.message - - -def RunSystemCommand(cmd): - try: - return subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] - except: - raise Error("Failed to execute: " + cmd) - - -def RunDumpbin(binary_file): - """Runs dumpbin and parses its output. - - Args: binary_file: the binary to analyze - Returns: a tuple of the dependencies and the delay-load dependencies - - The output of dumpbin that we will be parsing looks like this: - -- - <blah blah> - - Image has the following dependencies: - - foo.dll - bar.dll - - Image has the following delay load dependencies: - - foobar.dll - other.dll - - Summary - - <blah blah> - -- - The following parser extracts the dll names from the above format. - """ - cmd = DUMPBIN + " /dependents " + binary_file - output = RunSystemCommand(cmd) - dependents = [] - delay_loaded = [] - (START, DEPENDENCIES_HEADER, DEPENDENCIES, DELAY_LOAD_HEADER, DELAY_LOAD, - SUMMARY_HEADER, SUMMARY) = (0, 1, 2, 3, 4, 5, 6) - current_section = START - # Very basic scanning. - for line in output.splitlines(): - line = line.strip() - if len(line) > 1: - if line == "Image has the following dependencies:": - if current_section != START: - raise Error("Internal parsing error.") - current_section = DEPENDENCIES_HEADER - elif line == "Image has the following delay load dependencies:": - if current_section != DEPENDENCIES: - raise Error("Internal parsing error.") - current_section = DELAY_LOAD_HEADER - elif line == "Summary": - current_section = SUMMARY_HEADER - elif current_section == DEPENDENCIES: - # Got a dependent - dependents.append(line) - elif current_section == DELAY_LOAD: - # Got a delay-loaded - delay_loaded.append(line) - else: - if current_section == DEPENDENCIES_HEADER: - current_section = DEPENDENCIES - elif current_section == DELAY_LOAD_HEADER: - current_section = DELAY_LOAD - elif current_section == SUMMARY_HEADER: - current_section = SUMMARY - return dependents, delay_loaded - - -def Diff(name, type, current, expected, deps_file): - """ - Args: name: Portable executable name being analysed. - type: Type of dependency. - current: List of current dependencies. - expected: List of dependencies that are expected. - deps_file: File name of the .deps file. - Returns 0 if the lists are equal - 1 if one entry in list1 is missing - 2 if one entry in list2 is missing. - """ - # Create sets of lower-case names. - set_expected = set([x.lower() for x in expected]) - set_current = set([x.lower() for x in current]) - only_in_expected = set_expected - set_current - only_in_current = set_current - set_expected - - # Find difference between the sets. - found_extra = 0 - name = os.path.basename(name).lower() - if len(only_in_expected) or len(only_in_current): - print name.upper() + " DEPENDENCIES MISMATCH\n" - - if len(only_in_expected): - # Setting found_extra to 1 causes the build to fail. In some case, some - # dependencies are stripped out on optimized build; don't break anything - # just for that. - found_extra = 0 - print "%s is no longer dependent on these %s: %s." % (name, - type, - ' '.join(only_in_expected)) - print "Please update \"%s\"." % deps_file - - if len(only_in_current): - found_extra = 2 - string = "%s is now dependent on these %s, but shouldn't: %s." % (name, - type, - ' '.join(only_in_current)) - stars = '*' * len(string) - print "**" + stars + "**" - print "* " + string + " *" - print "**" + stars + "**\n" - print "Please update \"%s\"." % deps_file - return found_extra - - -def VerifyDependents(pe_name, dependents, delay_loaded, list_file, verbose): - """Compare the actual dependents to the expected ones.""" - scope = {} - try: - execfile(list_file, scope) - except: - raise Error("Failed to load " + list_file) - - # The dependency files have dependencies in two section - dependents and - # delay_loaded. Also various distributions of Chromium can have different - # dependencies. So first we read generic dependencies ("dependents" and - # "delay_loaded"). If distribution specific dependencies exist - # (i.e. "dependents_google_chrome" and "delay_loaded_google_chrome") we use - # those instead. - distribution = DIST_DEFAULT - if DIST_ENV_VAR in os.environ.keys(): - distribution = os.environ[DIST_ENV_VAR].lower() - - expected_dependents = scope["dependents"] - dist_dependents = "dependents" + distribution - if dist_dependents in scope.keys(): - expected_dependents = scope[dist_dependents] - - expected_delay_loaded = scope["delay_loaded"] - dist_delay_loaded = "delay_loaded" + distribution - if dist_delay_loaded in scope.keys(): - expected_delay_loaded = scope[dist_delay_loaded] - - if verbose: - print "Expected dependents:" - print "\n".join(expected_dependents) - print "Expected delayloaded:" - print "\n".join(expected_delay_loaded) - - deps_result = Diff(pe_name, - "dll", - dependents, - expected_dependents, - list_file) - delayed_result = Diff(pe_name, - "delay loaded dll", - delay_loaded, - expected_delay_loaded, - list_file) - return max(deps_result, delayed_result) - - -def main(): - # PE means portable executable. It's any .DLL, .EXE, .SYS, .AX, etc. - usage = "usage: %prog [options] input output" - option_parser = optparse.OptionParser(usage=usage) - option_parser.add_option("-d", - "--debug", - dest="debug", - action="store_true", - default=False, - help="Display debugging information") - options, args = option_parser.parse_args() - if len(args) != 2: - option_parser.error("Incorrect number of arguments") - pe_name = args[0] - deps_file = args[1] - dependents, delay_loaded = RunDumpbin(pe_name) - if options.debug: - print "Dependents:" - print "\n".join(dependents) - print "Delayloaded:" - print "\n".join(delay_loaded) - return VerifyDependents(pe_name, dependents, delay_loaded, deps_file, - options.debug) - - -if '__main__' == __name__: - sys.exit(main()) |