diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-04-05 17:15:33 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-04-11 07:47:18 +0000 |
commit | 7324afb043a0b1e623d8e8eb906cdc53bdeb4685 (patch) | |
tree | a3fe2d74ea9c9e142c390dac4ca0e219382ace46 /chromium/buildtools | |
parent | 6a4cabb866f66d4128a97cdc6d9d08ce074f1247 (diff) | |
download | qtwebengine-chromium-7324afb043a0b1e623d8e8eb906cdc53bdeb4685.tar.gz |
BASELINE: Update Chromium to 58.0.3029.54
Change-Id: I67f57065a7afdc8e4614adb5c0230281428df4d1
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/buildtools')
-rw-r--r-- | chromium/buildtools/DEPS | 2 | ||||
-rw-r--r-- | chromium/buildtools/README.txt | 41 | ||||
-rwxr-xr-x | chromium/buildtools/checkdeps/checkdeps.py | 28 | ||||
-rwxr-xr-x | chromium/buildtools/checkdeps/checkdeps_test.py | 36 | ||||
-rw-r--r-- | chromium/buildtools/checkdeps/proto_checker.py | 125 | ||||
-rw-r--r-- | chromium/buildtools/clang_format/README.chromium | 4 | ||||
-rw-r--r-- | chromium/buildtools/clang_format/README.txt | 2 | ||||
-rw-r--r-- | chromium/buildtools/linux64/clang-format.sha1 | 2 | ||||
-rw-r--r-- | chromium/buildtools/linux64/gn.sha1 | 2 | ||||
-rw-r--r-- | chromium/buildtools/mac/clang-format.sha1 | 2 | ||||
-rw-r--r-- | chromium/buildtools/mac/gn.sha1 | 2 | ||||
-rw-r--r-- | chromium/buildtools/win/clang-format.exe.sha1 | 2 | ||||
-rw-r--r-- | chromium/buildtools/win/gn.exe.sha1 | 2 |
13 files changed, 229 insertions, 21 deletions
diff --git a/chromium/buildtools/DEPS b/chromium/buildtools/DEPS index ca48a906b09..a426c604b0c 100644 --- a/chromium/buildtools/DEPS +++ b/chromium/buildtools/DEPS @@ -3,7 +3,7 @@ use_relative_paths = True vars = { "chromium_url": "https://chromium.googlesource.com", - "clang_format_rev": "6a413e91d56d6fd0a6ff2f97c905c6dc5ca5d789", # r284988 + "clang_format_rev": "c09c8deeac31f05bd801995c475e7c8070f9ecda", # r296408 "libcxx_revision": "b1ece9c037d879843b0b0f5a2802e1e9d443b75a", # r256621 "libcxxabi_revision": "0edb61e2e581758fc4cd4cd09fc588b3fc91a653", # r256323 } diff --git a/chromium/buildtools/README.txt b/chromium/buildtools/README.txt index 4bef1bffa28..1db97b4c501 100644 --- a/chromium/buildtools/README.txt +++ b/chromium/buildtools/README.txt @@ -6,6 +6,36 @@ The repository is separate so that the shared build tools can be shared between the various Chromium-related projects without each one needing to maintain their own versionining of each binary. +To update the GN binary, run (from the Chromium repo) tools/gn/bin/roll_gn.py +which will automatically upload the binaries and roll build tools. + +________________________________________ +UPDATING AND ROLLING BUILDTOOLS MANUALLY + +When you update buildtools, you should roll the new version into the Chromium +repository right away. Otherwise, the next person who makes a change will end +up rolling (and testing) your change. If there are any unresolved problems with +your change, the next person will be blocked. + + - From the buildtools directory, make a branch, edit and upload normally. + + - Get your change reviewed and landed. There are no trybots so landing will + be very fast. + + - Get the hash for the commit that commit-bot made. Make a new branch in + the Chromium repository and paste the hash into the line in //DEPS + labeled "buildtools_revision". + + - You can TBR changes to the DEPS file since the git hashes can't be reviewed + in any practical way. Submit that patch to the commit queue. + + - If this roll identifies a problem with your patch, fix it promptly. If you + are unable to fix it promptly, it's best to revert your buildtools patch + to avoid blocking other people that want to make changes. + +________________________ +ADDING BINARIES MANUALLY + One uploads new versions of the tools using the 'gsutil' binary from the Google Storage SDK: @@ -17,13 +47,10 @@ To initialize gsutil's credentials: python ~/depot_tools/third_party/gsutil/gsutil config - That will give a URL which you should log into with your web browser. The - username should be the one that is on the ACL for the "chromium-gn" bucket - (probably your @google.com address). Contact the build team for help getting - access if necessary. + That will give a URL which you should log into with your web browser. For + rolling GN, the username should be the one that is on the ACL for the + "chromium-gn" bucket (probably your @google.com address). Contact the build + team for help getting access if necessary. Copy the code back to the command line util. Ignore the project ID (it's OK to just leave blank when prompted). - -Instructions for how to upload the .sha1 digests of the GN binaries -can be found at https://code.google.com/p/chromium/wiki/UpdateGNBinaries . diff --git a/chromium/buildtools/checkdeps/checkdeps.py b/chromium/buildtools/checkdeps/checkdeps.py index 63b97fa0605..d3d977c01a5 100755 --- a/chromium/buildtools/checkdeps/checkdeps.py +++ b/chromium/buildtools/checkdeps/checkdeps.py @@ -6,7 +6,7 @@ """Makes sure that files include headers from allowed directories. Checks DEPS files in the source tree for rules, and applies those rules to -"#include" and "import" directives in the .cpp and .java source files. +"#include" and "import" directives in the .cpp, .java, and .proto source files. Any source file including something not permitted by the DEPS files will fail. See builddeps.py for a detailed description of the DEPS format. @@ -17,6 +17,7 @@ import optparse import re import sys +import proto_checker import cpp_checker import java_checker import results @@ -54,7 +55,8 @@ class DepsChecker(DepsBuilder): ignore_temp_rules: Ignore rules that start with Rule.TEMP_ALLOW ("!"). """ DepsBuilder.__init__( - self, base_directory, extra_repos, verbose, being_tested, ignore_temp_rules) + self, base_directory, extra_repos, verbose, being_tested, + ignore_temp_rules) self._skip_tests = skip_tests self._resolve_dotdot = resolve_dotdot @@ -80,9 +82,11 @@ class DepsChecker(DepsBuilder): java = java_checker.JavaChecker(self.base_directory, self.verbose) cpp = cpp_checker.CppChecker( self.verbose, self._resolve_dotdot, self.base_directory) + proto = proto_checker.ProtoChecker( + self.verbose, self._resolve_dotdot, self.base_directory) checkers = dict( (extension, checker) - for checker in [java, cpp] for extension in checker.EXTENSIONS) + for checker in [java, cpp, proto] for extension in checker.EXTENSIONS) for rules, file_paths in self.GetAllRulesAndFiles(start_dir): for full_name in file_paths: @@ -102,7 +106,7 @@ class DepsChecker(DepsBuilder): Args: added_lines: ((file_path, (changed_line, changed_line, ...), ...) - checker: CppChecker/JavaChecker checker instance + checker: CppChecker/JavaChecker/ProtoChecker checker instance Return: A list of tuples, (bad_file_path, rule_type, rule_description) @@ -160,6 +164,22 @@ class DepsChecker(DepsBuilder): added_imports, java_checker.JavaChecker(self.base_directory, self.verbose)) + def CheckAddedProtoImports(self, added_imports): + """This is used from PRESUBMIT.py to check new #import statements added in + the change being presubmit checked. + + Args: + added_imports : ((file_path, (import_line, import_line, ...), ...) + + Return: + A list of tuples, (bad_file_path, rule_type, rule_description) + where rule_type is one of Rule.DISALLOW or Rule.TEMP_ALLOW and + rule_description is human-readable. Empty if no problems. + """ + return self.CheckIncludesAndImports( + added_imports, proto_checker.ProtoChecker( + verbose=self.verbose, root_dir=self.base_directory)) + def PrintUsage(): print """Usage: python checkdeps.py [--root <root>] [tocheck] diff --git a/chromium/buildtools/checkdeps/checkdeps_test.py b/chromium/buildtools/checkdeps/checkdeps_test.py index 760668ce800..5b5b03f8569 100755 --- a/chromium/buildtools/checkdeps/checkdeps_test.py +++ b/chromium/buildtools/checkdeps/checkdeps_test.py @@ -198,6 +198,42 @@ class CheckDepsTest(unittest.TestCase): dirs_traversed.append(dir_names.pop()) self.failUnlessEqual(dirs_traversed, sorted(dirs_traversed)) + def testCheckPartialImportsAreAllowed(self): + problems = self.deps_checker.CheckAddedProtoImports( + [['checkdeps/testdata/test.proto', + ['import "no_rule_for_this/nogood.proto"'] + ]]) + self.failIf(problems) + + def testCheckAddedFullPathImportsAllowed(self): + # NOTE: Base directory is buildtools. + problems = self.deps_checker.CheckAddedProtoImports( + [['checkdeps/testdata/test.proto', + ['import "checkdeps/testdata/allowed/good.proto"', + 'import "checkdeps/testdata/disallowed/sub_folder/good.proto"'] + ]]) + self.failIf(problems) + + def testCheckAddedFullPathImportsDisallowed(self): + problems = self.deps_checker.CheckAddedProtoImports( + [['checkdeps/testdata/test.proto', + ['import "checkdeps/testdata/disallowed/bad.proto"'] + ]]) + self.failUnless(problems) + + def testCheckAddedFullPathImportsManyGarbageLines(self): + garbage_lines = ["My name is Sam%d\n" % num for num in range(50)] + problems = self.deps_checker.CheckAddedProtoImports( + [['checkdeps/testdata/test.proto', + garbage_lines]]) + self.failIf(problems) + + def testCheckAddedIncludesNoRuleFullPath(self): + problems = self.deps_checker.CheckAddedProtoImports( + [['checkdeps/testdata/test.proto', + ['import "../tools/some.proto"'] + ]]) + self.failUnless(problems) if __name__ == '__main__': unittest.main() diff --git a/chromium/buildtools/checkdeps/proto_checker.py b/chromium/buildtools/checkdeps/proto_checker.py new file mode 100644 index 00000000000..a90628a6c93 --- /dev/null +++ b/chromium/buildtools/checkdeps/proto_checker.py @@ -0,0 +1,125 @@ +# Copyright (c) 2012 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. + +"""Checks protobuf files for illegal imports.""" + +import codecs +import os +import re + +import results +from rules import Rule, MessageRule + + +class ProtoChecker(object): + + EXTENSIONS = [ + '.proto', + ] + + # The maximum number of non-import lines we can see before giving up. + _MAX_UNINTERESTING_LINES = 50 + + # The maximum line length, this is to be efficient in the case of very long + # lines (which can't be import). + _MAX_LINE_LENGTH = 128 + + # This regular expression will be used to extract filenames from import + # statements. + _EXTRACT_IMPORT_PATH = re.compile( + '[ \t]*[ \t]*import[ \t]+"(.*)"') + + def __init__(self, verbose, resolve_dotdot=False, root_dir=''): + self._verbose = verbose + self._resolve_dotdot = resolve_dotdot + self._root_dir = root_dir + + def IsFullPath(self, import_path): + """Checks if the given path is a valid path starting from |_root_dir|.""" + match = re.match('(.*)/([^/]*\.proto)', import_path) + if not match: + return False + return os.path.isdir(self._root_dir + "/" + match.group(1)) + + def CheckLine(self, rules, line, dependee_path, fail_on_temp_allow=False): + """Checks the given line with the given rule set. + + Returns a tuple (is_import, dependency_violation) where + is_import is True only if the line is an import + statement, and dependency_violation is an instance of + results.DependencyViolation if the line violates a rule, or None + if it does not. + """ + found_item = self._EXTRACT_IMPORT_PATH.match(line) + if not found_item: + return False, None # Not a match + + import_path = found_item.group(1) + + if '\\' in import_path: + return True, results.DependencyViolation( + import_path, + MessageRule('Import paths may not include backslashes.'), + rules) + + if '/' not in import_path: + # Don't fail when no directory is specified. We may want to be more + # strict about this in the future. + if self._verbose: + print ' WARNING: import specified with no directory: ' + import_path + return True, None + + if self._resolve_dotdot and '../' in import_path: + dependee_dir = os.path.dirname(dependee_path) + import_path = os.path.join(dependee_dir, import_path) + import_path = os.path.relpath(import_path, self._root_dir) + + if not self.IsFullPath(import_path): + return True, None + + rule = rules.RuleApplyingTo(import_path, dependee_path) + + if (rule.allow == Rule.DISALLOW or + (fail_on_temp_allow and rule.allow == Rule.TEMP_ALLOW)): + return True, results.DependencyViolation(import_path, rule, rules) + return True, None + + def CheckFile(self, rules, filepath): + if self._verbose: + print 'Checking: ' + filepath + + dependee_status = results.DependeeStatus(filepath) + last_import = 0 + with codecs.open(filepath, encoding='utf-8') as f: + for line_num, line in enumerate(f): + if line_num - last_import > self._MAX_UNINTERESTING_LINES: + break + + line = line.strip() + + is_import, violation = self.CheckLine(rules, line, filepath) + if is_import: + last_import = line_num + if violation: + dependee_status.AddViolation(violation) + + return dependee_status + + @staticmethod + def IsProtoFile(file_path): + """Returns True iff the given path ends in one of the extensions + handled by this checker. + """ + return os.path.splitext(file_path)[1] in ProtoChecker.EXTENSIONS + + def ShouldCheck(self, file_path): + """Check if the new #include file path should be presubmit checked. + + Args: + file_path: file path to be checked + + Return: + bool: True if the file should be checked; False otherwise. + """ + return self.IsProtoFile(file_path) diff --git a/chromium/buildtools/clang_format/README.chromium b/chromium/buildtools/clang_format/README.chromium index 32e1477eb6e..32934ea9d10 100644 --- a/chromium/buildtools/clang_format/README.chromium +++ b/chromium/buildtools/clang_format/README.chromium @@ -1,8 +1,8 @@ Name: clang-format Short Name: clang-format URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/ -Version: 4.0 -Date: 23 Sep 2016 +Version: 5.0.0 +Date: 27 Feb 2017 Revision: See DEPS License: University of Illinois/NCSA Open Source License License File: NOT_SHIPPED diff --git a/chromium/buildtools/clang_format/README.txt b/chromium/buildtools/clang_format/README.txt index fa1309b3b37..29b446ce5dd 100644 --- a/chromium/buildtools/clang_format/README.txt +++ b/chromium/buildtools/clang_format/README.txt @@ -2,7 +2,7 @@ This folder contains clang-format scripts. The binaries will be automatically downloaded from Google Storage by gclient runhooks for the current platform. For a walkthrough on how to maintain these binaries: - https://code.google.com/p/chromium/wiki/UpdatingClangFormatBinaries + https://chromium.googlesource.com/chromium/src/+/master/docs/updating_clang_format_binaries.md To upload a file: python ~/depot_tools/upload_to_google_storage.py -b chromium-clang-format <FILENAME> diff --git a/chromium/buildtools/linux64/clang-format.sha1 b/chromium/buildtools/linux64/clang-format.sha1 index db3b30d38ea..a17404d146e 100644 --- a/chromium/buildtools/linux64/clang-format.sha1 +++ b/chromium/buildtools/linux64/clang-format.sha1 @@ -1 +1 @@ -8f37fe78cc478600761211413e4974ceef94501d
\ No newline at end of file +416d0a9dc7ad199afd28df9e58b1b2953d33308e
\ No newline at end of file diff --git a/chromium/buildtools/linux64/gn.sha1 b/chromium/buildtools/linux64/gn.sha1 index a446ca0fb60..865d7f9923c 100644 --- a/chromium/buildtools/linux64/gn.sha1 +++ b/chromium/buildtools/linux64/gn.sha1 @@ -1 +1 @@ -1d3be4ca830bf9455f5980b7265c2127b5379b2e +d72c62d3a8b3b8d538743dbc97a1377c0e796357 diff --git a/chromium/buildtools/mac/clang-format.sha1 b/chromium/buildtools/mac/clang-format.sha1 index 619d0ce6e1c..92910171bf0 100644 --- a/chromium/buildtools/mac/clang-format.sha1 +++ b/chromium/buildtools/mac/clang-format.sha1 @@ -1 +1 @@ -c44ad67f6d04cdd2e321d980488afa3e71a8ec79
\ No newline at end of file +8a60d832db0144283acbb6d8278dde4163472959
\ No newline at end of file diff --git a/chromium/buildtools/mac/gn.sha1 b/chromium/buildtools/mac/gn.sha1 index 43f63f1491d..3677bdf17d3 100644 --- a/chromium/buildtools/mac/gn.sha1 +++ b/chromium/buildtools/mac/gn.sha1 @@ -1 +1 @@ -248e9147f96ce59320a35bd60f5d9089cb85706c +e098e4ea4fead6adac8f456a26073149cf41739a diff --git a/chromium/buildtools/win/clang-format.exe.sha1 b/chromium/buildtools/win/clang-format.exe.sha1 index 79efddc8a6d..213343b417a 100644 --- a/chromium/buildtools/win/clang-format.exe.sha1 +++ b/chromium/buildtools/win/clang-format.exe.sha1 @@ -1 +1 @@ -0384c08856f48f3900e293226b83b7e26c4620b1
\ No newline at end of file +6ddedd571c56b8c184f30a3c1fc36984e8c10ccd
\ No newline at end of file diff --git a/chromium/buildtools/win/gn.exe.sha1 b/chromium/buildtools/win/gn.exe.sha1 index 942c149a7b6..ac43082cccb 100644 --- a/chromium/buildtools/win/gn.exe.sha1 +++ b/chromium/buildtools/win/gn.exe.sha1 @@ -1 +1 @@ -919d6c5911dc38979f44b26f672e05ab385c07df +82be7db32e9b97159a1e733165839051249df591 |