summaryrefslogtreecommitdiff
path: root/chromium/buildtools
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-09-03 13:32:17 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-01 14:31:55 +0200
commit21ba0c5d4bf8fba15dddd97cd693bad2358b77fd (patch)
tree91be119f694044dfc1ff9fdc054459e925de9df0 /chromium/buildtools
parent03c549e0392f92c02536d3f86d5e1d8dfa3435ac (diff)
downloadqtwebengine-chromium-21ba0c5d4bf8fba15dddd97cd693bad2358b77fd.tar.gz
BASELINE: Update Chromium to 92.0.4515.166
Change-Id: I42a050486714e9e54fc271f2a8939223a02ae364
Diffstat (limited to 'chromium/buildtools')
-rwxr-xr-xchromium/buildtools/checkdeps/builddeps.py21
-rwxr-xr-xchromium/buildtools/checkdeps/checkdeps.py26
-rw-r--r--chromium/buildtools/checkdeps/cpp_checker.py6
-rw-r--r--chromium/buildtools/checkdeps/java_checker.py27
-rw-r--r--chromium/buildtools/checkdeps/proto_checker.py6
-rw-r--r--chromium/buildtools/checkdeps/results.py12
-rw-r--r--chromium/buildtools/checkdeps/rules.py6
-rw-r--r--chromium/buildtools/clang_format/README.txt2
-rw-r--r--chromium/buildtools/reclient_cfgs/rewrapper_linux.cfg2
-rw-r--r--chromium/buildtools/reclient_cfgs/rewrapper_linux_nacl.cfg2
10 files changed, 67 insertions, 43 deletions
diff --git a/chromium/buildtools/checkdeps/builddeps.py b/chromium/buildtools/checkdeps/builddeps.py
index 2fe48b2d6ff..a0df3284b22 100755
--- a/chromium/buildtools/checkdeps/builddeps.py
+++ b/chromium/buildtools/checkdeps/builddeps.py
@@ -9,10 +9,13 @@ a dependency rule table to be used by subclasses.
See README.md for the format of the deps file.
"""
+from __future__ import print_function
+
import copy
import os.path
import posixpath
import subprocess
+import sys
from rules import Rule, Rules
@@ -58,11 +61,10 @@ def _GitSourceDirectories(base_directory):
# FIXME: Use a context manager in Python 3.2+
popen = subprocess.Popen(git_ls_files_cmd,
stdout=subprocess.PIPE,
- bufsize=1, # line buffering, since read by line
cwd=base_directory)
try:
try:
- for line in popen.stdout:
+ for line in popen.stdout.read().decode('utf-8').splitlines():
dir_path = os.path.join(base_directory, os.path.dirname(line))
dir_path_norm = NormalizePath(dir_path)
# Add the directory as well as all the parent directories,
@@ -180,7 +182,7 @@ class DepsBuilder(object):
if self._ignore_specific_rules:
return rules
- for regexp, specific_rules in specific_includes.iteritems():
+ for regexp, specific_rules in specific_includes.items():
for rule_str in specific_rules:
ApplyOneRule(rule_str, regexp)
@@ -210,7 +212,7 @@ class DepsBuilder(object):
# Check the DEPS file in this directory.
if self.verbose:
- print 'Applying rules from', dir_path_local_abs
+ print('Applying rules from', dir_path_local_abs)
def FromImpl(*_):
pass # NOP function so "From" doesn't fail.
@@ -248,9 +250,16 @@ class DepsBuilder(object):
if os.path.isfile(deps_file_path) and not (
self._under_test and
os.path.basename(dir_path_local_abs) == 'checkdeps'):
- execfile(deps_file_path, global_scope, local_scope)
+ if sys.version_info.major == 2:
+ execfile(deps_file_path, global_scope, local_scope)
+ else:
+ try:
+ exec(open(deps_file_path).read(), global_scope, local_scope)
+ except Exception as e:
+ print(' Error reading %s: %s' % (deps_file_path, str(e)))
+ raise
elif self.verbose:
- print ' No deps file found in', dir_path_local_abs
+ print(' No deps file found in', dir_path_local_abs)
# Even if a DEPS file does not exist we still invoke ApplyRules
# to apply the implicit "allow" rule for the current directory
diff --git a/chromium/buildtools/checkdeps/checkdeps.py b/chromium/buildtools/checkdeps/checkdeps.py
index 4713dc0f3a6..24cb58a5438 100755
--- a/chromium/buildtools/checkdeps/checkdeps.py
+++ b/chromium/buildtools/checkdeps/checkdeps.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 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.
@@ -12,6 +12,8 @@ Any source file including something not permitted by the DEPS files will fail.
See README.md for a detailed description of the DEPS format.
"""
+from __future__ import print_function
+
import os
import optparse
import re
@@ -68,7 +70,7 @@ class DepsChecker(DepsBuilder):
if self.results_formatter.GetResults():
self.results_formatter.PrintResults()
return 1
- print '\nSUCCESS\n'
+ print('\nSUCCESS\n')
return 0
def CheckDirectory(self, start_dir):
@@ -149,14 +151,16 @@ class DepsChecker(DepsBuilder):
return self.CheckIncludesAndImports(
added_includes, cpp_checker.CppChecker(self.verbose))
- def CheckAddedJavaImports(self, added_imports, allow_multiple_definitions=None):
+ def CheckAddedJavaImports(self, added_imports,
+ allow_multiple_definitions=None):
"""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, ...), ...)
- allow_multiple_definitions: [file_name, file_name, ...]. List of java file
- names allowing multipe definition in presubmit check.
+ allow_multiple_definitions: [file_name, file_name, ...]. List of java
+ file names allowing multiple definitions in
+ presubmit check.
Return:
A list of tuples, (bad_file_path, rule_type, rule_description)
@@ -185,7 +189,7 @@ class DepsChecker(DepsBuilder):
verbose=self.verbose, root_dir=self.base_directory))
def PrintUsage():
- print """Usage: python checkdeps.py [--root <root>] [tocheck]
+ print("""Usage: python checkdeps.py [--root <root>] [tocheck]
--root ROOT Specifies the repository root. This defaults to "../../.."
relative to the script file. This will be correct given the
@@ -198,7 +202,7 @@ def PrintUsage():
Examples:
python checkdeps.py
- python checkdeps.py --root c:\\source chrome"""
+ python checkdeps.py --root c:\\source chrome""")
def main():
@@ -266,12 +270,12 @@ def main():
return 1
if not start_dir.startswith(deps_checker.base_directory):
- print 'Directory to check must be a subdirectory of the base directory,'
- print 'but %s is not a subdirectory of %s' % (start_dir, base_directory)
+ print('Directory to check must be a subdirectory of the base directory,')
+ print('but %s is not a subdirectory of %s' % (start_dir, base_directory))
return 1
- print 'Using base directory:', base_directory
- print 'Checking:', start_dir
+ print('Using base directory:', base_directory)
+ print('Checking:', start_dir)
if options.generate_temp_rules:
deps_checker.results_formatter = results.TemporaryRulesFormatter()
diff --git a/chromium/buildtools/checkdeps/cpp_checker.py b/chromium/buildtools/checkdeps/cpp_checker.py
index 3efad9741c9..0f9df9f9b14 100644
--- a/chromium/buildtools/checkdeps/cpp_checker.py
+++ b/chromium/buildtools/checkdeps/cpp_checker.py
@@ -4,6 +4,8 @@
"""Checks C++ and Objective-C files for illegal includes."""
+from __future__ import print_function
+
import codecs
import os
import re
@@ -64,7 +66,7 @@ class CppChecker(object):
# 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: include specified with no directory: ' + include_path
+ print(' WARNING: include specified with no directory: ' + include_path)
return True, None
if self._resolve_dotdot and '../' in include_path:
@@ -80,7 +82,7 @@ class CppChecker(object):
def CheckFile(self, rules, filepath):
if self._verbose:
- print 'Checking: ' + filepath
+ print('Checking: ' + filepath)
dependee_status = results.DependeeStatus(filepath)
ret_val = '' # We'll collect the error messages in here
diff --git a/chromium/buildtools/checkdeps/java_checker.py b/chromium/buildtools/checkdeps/java_checker.py
index a5b1db73ff6..f2f50769215 100644
--- a/chromium/buildtools/checkdeps/java_checker.py
+++ b/chromium/buildtools/checkdeps/java_checker.py
@@ -4,6 +4,8 @@
"""Checks Java files for illegal imports."""
+from __future__ import print_function
+
import codecs
import os
import re
@@ -35,7 +37,7 @@ class JavaChecker(object):
# This regular expression will be used to extract filenames from import
# statements.
- _EXTRACT_IMPORT_PATH = re.compile('^import\s+(?:static\s+)?([\w\.]+)\s*;')
+ _EXTRACT_IMPORT_PATH = re.compile(r'^import\s+(?:static\s+)?([\w\.]+)\s*;')
def __init__(self, base_directory, verbose, added_imports=None,
allow_multiple_definitions=None):
@@ -54,7 +56,7 @@ class JavaChecker(object):
with codecs.open(filepath, encoding='utf-8') as f:
short_class_name, _ = os.path.splitext(os.path.basename(filepath))
for line in f:
- for package in re.findall('^package\s+([\w\.]+);', line):
+ for package in re.findall(r'^package\s+([\w\.]+);', line):
return package + '.' + short_class_name
def _IgnoreDir(self, d):
@@ -75,10 +77,11 @@ class JavaChecker(object):
return False
def _PrescanFiles(self, added_classset):
- for root, dirs, files in os.walk(self._base_directory.encode('utf-8')):
+ for root, dirs, files in os.walk(self._base_directory):
# Skip unwanted subdirectories. TODO(husky): it would be better to do
# this via the skip_child_includes flag in DEPS files. Maybe hoist this
# prescan logic into checkdeps.py itself?
+ # Modify dirs in-place with slice assignment to avoid recursing into them.
dirs[:] = [d for d in dirs if not self._IgnoreDir(d)]
for f in files:
if f.endswith('.java'):
@@ -112,21 +115,25 @@ class JavaChecker(object):
def _PrescanFile(self, filepath, added_classset):
if self._verbose:
- print 'Prescanning: ' + filepath
+ print('Prescanning: ' + filepath)
full_class_name = self._GetClassFullName(filepath)
if full_class_name:
if full_class_name in self._classmap:
if self._verbose or full_class_name in added_classset:
if not any(re.match(i, filepath) for i in
self._allow_multiple_definitions):
- print 'WARNING: multiple definitions of %s:' % full_class_name
- print ' ' + filepath
- print ' ' + self._classmap[full_class_name]
- print
+ print('WARNING: multiple definitions of %s:' % full_class_name)
+ print(' ' + filepath)
+ print(' ' + self._classmap[full_class_name])
+ print()
+ # Prefer the public repo when multiple matches are found.
+ if self._classmap[full_class_name].startswith(
+ os.path.join(self._base_directory, 'clank')):
+ self._classmap[full_class_name] = filepath
else:
self._classmap[full_class_name] = filepath
elif self._verbose:
- print 'WARNING: no package definition found in %s' % filepath
+ print('WARNING: no package definition found in %s' % filepath)
def CheckLine(self, rules, line, filepath, fail_on_temp_allow=False):
"""Checks the given line with the given rule set.
@@ -157,7 +164,7 @@ class JavaChecker(object):
def CheckFile(self, rules, filepath):
if self._verbose:
- print 'Checking: ' + filepath
+ print('Checking: ' + filepath)
dependee_status = results.DependeeStatus(filepath)
with codecs.open(filepath, encoding='utf-8') as f:
diff --git a/chromium/buildtools/checkdeps/proto_checker.py b/chromium/buildtools/checkdeps/proto_checker.py
index a90628a6c93..a073ec6a672 100644
--- a/chromium/buildtools/checkdeps/proto_checker.py
+++ b/chromium/buildtools/checkdeps/proto_checker.py
@@ -4,6 +4,8 @@
"""Checks protobuf files for illegal imports."""
+from __future__ import print_function
+
import codecs
import os
import re
@@ -67,7 +69,7 @@ class ProtoChecker(object):
# 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
+ print(' WARNING: import specified with no directory: ' + import_path)
return True, None
if self._resolve_dotdot and '../' in import_path:
@@ -87,7 +89,7 @@ class ProtoChecker(object):
def CheckFile(self, rules, filepath):
if self._verbose:
- print 'Checking: ' + filepath
+ print('Checking: ' + filepath)
dependee_status = results.DependeeStatus(filepath)
last_import = 0
diff --git a/chromium/buildtools/checkdeps/results.py b/chromium/buildtools/checkdeps/results.py
index b52880ccca3..929e1601adf 100644
--- a/chromium/buildtools/checkdeps/results.py
+++ b/chromium/buildtools/checkdeps/results.py
@@ -2,9 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-
"""Results object and results formatters for checkdeps tool."""
+from __future__ import print_function
import json
@@ -96,9 +96,9 @@ class NormalResultsFormatter(ResultsFormatter):
def PrintResults(self):
for result in self.results:
- print result
+ print(result)
if self.results:
- print '\nFAILED\n'
+ print('\nFAILED\n')
class JSONResultsFormatter(ResultsFormatter):
@@ -133,7 +133,7 @@ class JSONResultsFormatter(ResultsFormatter):
self.wrapped_formatter.PrintResults()
return
- print self.results
+ print(self.results)
class TemporaryRulesFormatter(ResultsFormatter):
@@ -154,7 +154,7 @@ class TemporaryRulesFormatter(ResultsFormatter):
def PrintResults(self):
for result in self.GetResults():
- print result
+ print(result)
class CountViolationsFormatter(ResultsFormatter):
@@ -175,4 +175,4 @@ class CountViolationsFormatter(ResultsFormatter):
return '%d' % self.count
def PrintResults(self):
- print self.count
+ print(self.count)
diff --git a/chromium/buildtools/checkdeps/rules.py b/chromium/buildtools/checkdeps/rules.py
index bafcf66af73..1180111b27b 100644
--- a/chromium/buildtools/checkdeps/rules.py
+++ b/chromium/buildtools/checkdeps/rules.py
@@ -112,7 +112,7 @@ class Rules(object):
def __str__(self):
result = ['Rules = {\n (apply to all files): [\n%s\n ],' % '\n'.join(
' %s' % x for x in self._general_rules)]
- for regexp, rules in self._specific_rules.iteritems():
+ for regexp, rules in self._specific_rules.items():
result.append(' (limited to files matching %s): [\n%s\n ]' % (
regexp, '\n'.join(' %s' % x for x in rules)))
result.append(' }')
@@ -132,7 +132,7 @@ class Rules(object):
if include_general_rules:
AddDependencyTuplesImpl(deps, self._general_rules)
if include_specific_rules:
- for regexp, rules in self._specific_rules.iteritems():
+ for regexp, rules in self._specific_rules.items():
AddDependencyTuplesImpl(deps, rules, "/" + regexp)
return deps
@@ -175,7 +175,7 @@ class Rules(object):
file located at |dependee_path|.
"""
dependee_filename = os.path.basename(dependee_path)
- for regexp, specific_rules in self._specific_rules.iteritems():
+ for regexp, specific_rules in self._specific_rules.items():
if re.match(regexp, dependee_filename):
for rule in specific_rules:
if rule.ChildOrMatch(include_path):
diff --git a/chromium/buildtools/clang_format/README.txt b/chromium/buildtools/clang_format/README.txt
index 29b446ce5dd..20e72c32254 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://chromium.googlesource.com/chromium/src/+/master/docs/updating_clang_format_binaries.md
+ https://chromium.googlesource.com/chromium/src/+/main/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/reclient_cfgs/rewrapper_linux.cfg b/chromium/buildtools/reclient_cfgs/rewrapper_linux.cfg
index 042b4f79bbd..86b91e2df40 100644
--- a/chromium/buildtools/reclient_cfgs/rewrapper_linux.cfg
+++ b/chromium/buildtools/reclient_cfgs/rewrapper_linux.cfg
@@ -2,4 +2,4 @@ platform=container-image=docker://gcr.io/cloud-marketplace/google/rbe-ubuntu16-0
server_address=unix:///tmp/reproxy.sock
labels=type=compile,compiler=clang,lang=cpp
exec_strategy=remote_local_fallback
-inputs=third_party/llvm-build/Release+Asserts
+inputs=third_party/llvm-build/Release+Asserts/bin/clang,third_party/llvm-build/Release+Asserts/bin/clang++,third_party/llvm-build/Release+Asserts/bin/clang-cl,third_party/llvm-build/Release+Asserts/lib/libstdc++.so.6
diff --git a/chromium/buildtools/reclient_cfgs/rewrapper_linux_nacl.cfg b/chromium/buildtools/reclient_cfgs/rewrapper_linux_nacl.cfg
index 4de1e23078b..e22419e9a3e 100644
--- a/chromium/buildtools/reclient_cfgs/rewrapper_linux_nacl.cfg
+++ b/chromium/buildtools/reclient_cfgs/rewrapper_linux_nacl.cfg
@@ -2,4 +2,4 @@ platform=container-image=docker://gcr.io/cloud-marketplace/google/rbe-ubuntu16-0
server_address=unix:///tmp/reproxy.sock
labels=type=compile,compiler=nacl,lang=cpp
exec_strategy=remote_local_fallback
-inputs=third_party/llvm-build/Release+Asserts,native_client/toolchain/linux_x86/pnacl_newlib
+inputs=third_party/llvm-build/Release+Asserts/bin/clang,third_party/llvm-build/Release+Asserts/bin/clang++,third_party/llvm-build/Release+Asserts/bin/clang-cl,third_party/llvm-build/Release+Asserts/lib/libstdc++.so.6,native_client/toolchain/linux_x86/pnacl_newlib