diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/about_credits.tmpl | 1 | ||||
-rw-r--r-- | tools/about_credits_entry.tmpl | 12 | ||||
-rwxr-xr-x | tools/buildscripts/qtwebengine_utils.py | 32 | ||||
-rwxr-xr-x | tools/buildscripts/repack_locales.py | 33 | ||||
-rwxr-xr-x | tools/scripts/check_patches.py | 30 | ||||
-rw-r--r-- | tools/scripts/cipd_package.py | 103 | ||||
-rwxr-xr-x | tools/scripts/get_version.py | 30 | ||||
-rw-r--r-- | tools/scripts/git_submodule.py | 104 | ||||
-rw-r--r-- | tools/scripts/gn_find_mocables.py | 31 | ||||
-rw-r--r-- | tools/scripts/gn_run_binary.py | 29 | ||||
-rwxr-xr-x | tools/scripts/init-repository.py | 64 | ||||
-rwxr-xr-x | tools/scripts/make_archive.sh | 30 | ||||
-rwxr-xr-x | tools/scripts/patch_upstream.py | 30 | ||||
-rwxr-xr-x | tools/scripts/take_snapshot.py | 216 | ||||
-rwxr-xr-x | tools/scripts/update_change_ids.py | 30 | ||||
-rw-r--r-- | tools/scripts/version_resolver.py | 105 | ||||
-rwxr-xr-x | tools/scripts/windeploy-examples.py | 30 |
17 files changed, 394 insertions, 516 deletions
diff --git a/tools/about_credits.tmpl b/tools/about_credits.tmpl deleted file mode 100644 index 57fae9e78..000000000 --- a/tools/about_credits.tmpl +++ /dev/null @@ -1 +0,0 @@ -{{entries}} diff --git a/tools/about_credits_entry.tmpl b/tools/about_credits_entry.tmpl deleted file mode 100644 index 2bb9cff4e..000000000 --- a/tools/about_credits_entry.tmpl +++ /dev/null @@ -1,12 +0,0 @@ -/*! -\page qtwebengine-3rdparty-{{name-sanitized}}.html attribution -\ingroup qtwebengine-licensing -\brief {{license-type}} -\title {{name}} - -\l{{{url}}}{Project Homepage} - -\badcode -{{license}} -\endcode -*/ diff --git a/tools/buildscripts/qtwebengine_utils.py b/tools/buildscripts/qtwebengine_utils.py index 85f9a5d27..32bccbf4d 100755 --- a/tools/buildscripts/qtwebengine_utils.py +++ b/tools/buildscripts/qtwebengine_utils.py @@ -1,32 +1,6 @@ -#!/usr/bin/env python - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +#!/usr/bin/env python3 +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import os import subprocess diff --git a/tools/buildscripts/repack_locales.py b/tools/buildscripts/repack_locales.py index dc4452d94..99b91867c 100755 --- a/tools/buildscripts/repack_locales.py +++ b/tools/buildscripts/repack_locales.py @@ -1,32 +1,7 @@ -#!/usr/bin/env python -############################################################################# -## -## Copyright (c) 2012 The Chromium Authors. All rights reserved. -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +#!/usr/bin/env python3 +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 # This is esentially a trimmed down version of chrome's repack_locales script """Helper script to repack paks for a list of locales. diff --git a/tools/scripts/check_patches.py b/tools/scripts/check_patches.py index 7437f1587..e14d54f63 100755 --- a/tools/scripts/check_patches.py +++ b/tools/scripts/check_patches.py @@ -1,32 +1,6 @@ #!/usr/bin/env python - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import glob import os diff --git a/tools/scripts/cipd_package.py b/tools/scripts/cipd_package.py new file mode 100644 index 000000000..8ab448c86 --- /dev/null +++ b/tools/scripts/cipd_package.py @@ -0,0 +1,103 @@ +# Copyright (C) 2023 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +import glob +import os +import re +import subprocess +import sys +import version_resolver as resolver + +androidx_package_name = 'chromium/third_party/androidx' + +def subprocessCall(args): + print(args) + return subprocess.call(args) + +def subprocessCheckOutput(args): + print(args) + return subprocess.check_output(args).decode() + +class PackageDEPSParser(resolver.DEPSParser): + def __init__(self): + super().__init__() + + def createEntitiesFromScope(self, scope): + entities = [] + for dep in scope: + if (type(scope[dep]) == dict and 'packages' in scope[dep] \ + and 'dep_type' in scope[dep] and scope[dep]['dep_type'] == 'cipd'): + subdir = self.subdir(dep) + if subdir is None: + continue + entity = CIPDEntity(subdir, sp=self.topmost_supermodule_path_prefix) + path = entity.pathRelativeToTopMostSupermodule() + for pkg in scope[dep]['packages']: + p = Package(pkg['package'], pkg['version'], path) + entity.packages.append(p) + entities.append(entity) + return entities + + def parse(self, deps_content, module_whitelist = []): + exec(deps_content, self.global_scope, self.local_scope) + entities = [] + entities.extend(self.createEntitiesFromScope(self.local_scope['deps'])) + return entities + +class Package: + def __init__(self, name, version, path): + self.name = name + self.version = version + self.path = path + self.fileName = name.replace('/','.') + '.pkg' + + def fetchAndDeploy(self): + if os.path.isdir(self.path): + currentDir = os.getcwd() + os.chdir(self.path) + subprocessCall(['cipd', 'pkg-fetch', self.name ,'-out' , self.fileName, '-version', self.version ]) + subprocessCall(['cipd', 'pkg-deploy', self.fileName , '-root', '.' ]) + os.chdir(currentDir) + else: + print('-- missing directory' + self.path + ' skipping') + + def listFiles(self): + if os.path.isdir(self.path): + currentDir = os.getcwd() + os.chdir(self.path) + files = [] + if os.path.isfile(self.fileName): + files = subprocessCheckOutput(['cipd', 'pkg-inspect', self.fileName]).splitlines() + files = map( lambda x: x.replace( ' F ', self.path + '/'), files) + else: + print('-- missing package file ' + self.path + ' skipping') + os.chdir(currentDir) + return files + else: + print('-- missing directory' + self.path + ' skipping') + return [] + +class CIPDEntity: + def __init__(self, path='', packages=[], os=[], sp=''): + self.path = path + self.packages = [] + self.topmost_supermodule_path_prefix = sp + + def pathRelativeToTopMostSupermodule(self): + return os.path.normpath(os.path.join(self.topmost_supermodule_path_prefix, self.path)) + + def findPackage(self, package): + pkg = [p for p in self.packages if p.name == package] + if len(pkg) > 1: + raise Exception(package + " is ambiguous package name for" + self.path) + return pkg[0] if pkg else None + + def readEntities(self): + cipd_packages = [] + cipd_packages = resolver.read(PackageDEPSParser) + print('DEPS file provides the following packages:') + for cipd_package in cipd_packages: + print(cipd_package.pathRelativeToTopMostSupermodule() + ':') + for package in cipd_package.packages: + print(' * {:<80}'.format(package.name) + package.version) + return cipd_packages diff --git a/tools/scripts/get_version.py b/tools/scripts/get_version.py index d3928f6e5..897b9866e 100755 --- a/tools/scripts/get_version.py +++ b/tools/scripts/get_version.py @@ -1,32 +1,6 @@ #!/usr/bin/env python - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import sys import json diff --git a/tools/scripts/git_submodule.py b/tools/scripts/git_submodule.py index 43a652b11..3d301d16b 100644 --- a/tools/scripts/git_submodule.py +++ b/tools/scripts/git_submodule.py @@ -1,34 +1,10 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import glob import os import re +import string import subprocess import sys import version_resolver as resolver @@ -36,22 +12,21 @@ import version_resolver as resolver extra_os = ['mac', 'win'] def subprocessCall(args): - print args + print(args) return subprocess.call(args) def subprocessCheckOutput(args): - print args - return subprocess.check_output(args) + print(args) + return subprocess.check_output(args).decode() -class DEPSParser: +# Special string formatter that support flat key names with '.' in them +class DepsFormatter(string.Formatter): + def get_field(self, field_name, args, kwargs): + return (self.get_value(field_name, args, kwargs), field_name) + +class SubmoduleDEPSParser(resolver.DEPSParser): def __init__(self): - self.global_scope = { - 'Var': lambda var_name: '{%s}' % var_name, - 'Str': str, - 'deps_os': {}, - } - self.local_scope = {} - self.topmost_supermodule_path_prefix = '' + super().__init__() def get_vars(self): """Returns a dictionary of effective variable values @@ -62,10 +37,7 @@ class DEPSParser: #result.update(self.custom_vars or {}) return result - def get_recursedeps(self): - return self.local_scope["recursedeps"] - - def createSubmodulesFromScope(self, scope, os): + def createSubmodulesFromScope(self, scope, os, module_whitelist = []): submodules = [] for dep in scope: url = '' @@ -74,29 +46,23 @@ class DEPSParser: elif (type(scope[dep]) == dict and 'url' in scope[dep]): url = scope[dep]['url'] - if ('condition' in scope[dep]) and (not 'checkout_linux' in scope[dep]['condition']): - url = '' - + if ('condition' in scope[dep]) and \ + (not 'checkout_linux' in scope[dep]['condition']) and \ + (not dep in module_whitelist): + continue if url: - url = url.format(**self.get_vars()) + url = DepsFormatter().vformat(url, [], self.get_vars()) repo_rev = url.split('@') repo = repo_rev[0] rev = repo_rev[1] - subdir = dep - if subdir.startswith('src/'): - subdir = subdir[4:] - # Don't skip submodules that have a supermodule path prefix set (at the moment these - # are 2nd level deep submodules). - elif not self.topmost_supermodule_path_prefix: - # Ignore the information about chromium itself since we get that from git, - # also ignore anything outside src/ (e.g. depot_tools) + subdir = self.subdir(dep) + if subdir is None: continue - submodule = Submodule(subdir, repo, sp=self.topmost_supermodule_path_prefix) submodule.os = os if not submodule.matchesOS(): - print '-- skipping ' + submodule.pathRelativeToTopMostSupermodule() + ' for this operating system. --' + print('-- skipping ' + submodule.pathRelativeToTopMostSupermodule() + ' for this operating system. --') continue if len(rev) == 40: # Length of a git shasum @@ -108,11 +74,11 @@ class DEPSParser: submodules.append(submodule) return submodules - def parse(self, deps_content): + def parse(self, deps_content, module_whitelist = []): exec(deps_content, self.global_scope, self.local_scope) submodules = [] - submodules.extend(self.createSubmodulesFromScope(self.local_scope['deps'], 'all')) + submodules.extend(self.createSubmodulesFromScope(self.local_scope['deps'], 'all', module_whitelist)) if 'deps_os' in self.local_scope: for os_dep in self.local_scope['deps_os']: submodules.extend(self.createSubmodulesFromScope(self.local_scope['deps_os'][os_dep], os_dep)) @@ -201,7 +167,7 @@ class Submodule: def findGitDir(self): try: return subprocessCheckOutput(['git', 'rev-parse', '--git-dir']).strip() - except subprocess.CalledProcessError, e: + except subprocess.CalledProcessError as e: sys.exit("git dir could not be determined! - Initialization failed! " + e.output) def reset(self): @@ -210,27 +176,27 @@ class Submodule: gitdir = self.findGitDir() if os.path.isdir(os.path.join(gitdir, 'rebase-merge')): if os.path.isfile(os.path.join(gitdir, 'MERGE_HEAD')): - print 'merge in progress... aborting merge.' + print('merge in progress... aborting merge.') subprocessCall(['git', 'merge', '--abort']) else: - print 'rebase in progress... aborting merge.' + print('rebase in progress... aborting merge.') subprocessCall(['git', 'rebase', '--abort']) if os.path.isdir(os.path.join(gitdir, 'rebase-apply')): - print 'am in progress... aborting am.' + print('am in progress... aborting am.') subprocessCall(['git', 'am', '--abort']) subprocessCall(['git', 'reset', '--hard']) os.chdir(currentDir) def initialize(self): if self.matchesOS(): - print '\n\n-- initializing ' + self.pathRelativeToTopMostSupermodule() + ' --' + print('\n\n-- initializing ' + self.pathRelativeToTopMostSupermodule() + ' --') oldCwd = os.getcwd() # The submodule operations should be done relative to the current submodule's # supermodule. if self.topmost_supermodule_path_prefix: if not os.path.isdir(self.path): - print '-- creating ' + self.path + ' as dir is missing. --' + print('-- creating ' + self.path + ' as dir is missing. --') os.makedirs(self.path) os.chdir(self.topmost_supermodule_path_prefix) @@ -254,7 +220,7 @@ class Submodule: os.chdir(oldCwd) else: - print '-- skipping ' + self.path + ' for this operating system. --' + print('-- skipping ' + self.path + ' for this operating system. --') def listFiles(self): if self.matchesOS() and os.path.isdir(self.pathRelativeToTopMostSupermodule()): @@ -264,7 +230,7 @@ class Submodule: os.chdir(currentDir) return files else: - print '-- skipping ' + self.path + ' for this operating system. --' + print('-- skipping ' + self.path + ' for this operating system. --') return [] def parseGitModulesFileContents(self, gitmodules_lines): @@ -319,10 +285,10 @@ class Submodule: def readSubmodules(self, use_deps=False): submodules = [] if use_deps: - submodules = resolver.readSubmodules() - print 'DEPS file provides the following submodules:' + submodules = resolver.read(SubmoduleDEPSParser) + print('DEPS file provides the following submodules:') for submodule in submodules: - print '{:<80}'.format(submodule.pathRelativeToTopMostSupermodule()) + '{:<120}'.format(submodule.url) + submodule.ref + print('{:<80}'.format(submodule.pathRelativeToTopMostSupermodule()) + '{:<120}'.format(submodule.url) + submodule.ref) else: # Try .gitmodules instead gitmodules_file_name = '.gitmodules' submodules = self.readSubmodulesFromGitModules(self, gitmodules_file_name, self.path) diff --git a/tools/scripts/gn_find_mocables.py b/tools/scripts/gn_find_mocables.py index 4dc2576e3..68f648889 100644 --- a/tools/scripts/gn_find_mocables.py +++ b/tools/scripts/gn_find_mocables.py @@ -1,30 +1,5 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import re import sys @@ -32,7 +7,7 @@ import os mocables = set() includedMocs = set() -files = sys.argv[2:] +files = sys.argv[1:] for f in filter(os.path.isfile, files): inBlockComment = False diff --git a/tools/scripts/gn_run_binary.py b/tools/scripts/gn_run_binary.py index 5debf02ab..0e30e23ed 100644 --- a/tools/scripts/gn_run_binary.py +++ b/tools/scripts/gn_run_binary.py @@ -1,30 +1,5 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import sys diff --git a/tools/scripts/init-repository.py b/tools/scripts/init-repository.py index 221f74a65..e6ec0c440 100755 --- a/tools/scripts/init-repository.py +++ b/tools/scripts/init-repository.py @@ -1,32 +1,6 @@ -#!/usr/bin/env python - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +#!/usr/bin/env python3 +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import glob import os @@ -38,6 +12,7 @@ import argparse qtwebengine_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) import git_submodule as GitSubmodule +import cipd_package as CIPDPackage import version_resolver as resolver chromium_src = os.environ.get('CHROMIUM_SRC_DIR') @@ -47,13 +22,14 @@ use_external_chromium = False parser = argparse.ArgumentParser(description='Initialize QtWebEngine repository.') parser.add_argument('--baseline-upstream', action='store_true', help='initialize using upstream Chromium submodule w/o applying patches (for maintenance purposes only)') +parser.add_argument('--use_cipd', action='store_true', help='fetch and deploy packages with cipd') group = parser.add_mutually_exclusive_group() group.add_argument('-u', '--upstream', action='store_true', help='initialize using upstream Chromium submodule') group.add_argument('-s', '--snapshot', action='store_true', help='initialize using flat Chromium snapshot submodule (default)') args = parser.parse_args() - if args.baseline_upstream: args.upstream = True + args.use_cipd = True if chromium_src: chromium_src = os.path.abspath(chromium_src) @@ -66,7 +42,7 @@ if not chromium_src or not os.path.isdir(chromium_src): ninja_src = os.path.join(qtwebengine_root, 'src/3rdparty/ninja') gn_src = os.path.join(qtwebengine_root, 'src/3rdparty/gn') args.snapshot = True - print 'CHROMIUM_SRC_DIR not set, using Chromium in' + chromium_src + print('CHROMIUM_SRC_DIR not set, using Chromium in' + chromium_src) if not args.baseline_upstream: # Write our chromium sources directory into git config. @@ -79,7 +55,7 @@ def updateLastChange(): return currentDir = os.getcwd() os.chdir(chromium_src) - print 'updating LASTCHANGE files' + print('updating LASTCHANGE files') subprocess.call(['python', 'build/util/lastchange.py', '-o', 'build/util/LASTCHANGE']) subprocess.call(['python', 'build/util/lastchange.py', '-m', 'SKIA_COMMIT_HASH', '-s', 'third_party/skia', '--header', 'skia/ext/skia_commit_hash.h']) subprocess.call(['python', 'build/util/lastchange.py', '-m', 'GPU_LISTS_VERSION', '--revision-id-only', '--header', 'gpu/config/gpu_lists_version.h']) @@ -93,7 +69,7 @@ def initUpstreamSubmodules(): chromium_ref = 'refs/tags/' + resolver.currentVersion() os.chdir(qtwebengine_root) - current_submodules = subprocess.check_output(['git', 'submodule']) + current_submodules = subprocess.check_output(['git', 'submodule']).decode() if not 'src/3rdparty_upstream/gn' in current_submodules: subprocess.call(['git', 'submodule', 'add', gn_url, 'src/3rdparty_upstream/gn']) if not 'src/3rdparty_upstream/ninja' in current_submodules: @@ -123,6 +99,7 @@ def initUpstreamSubmodules(): chromiumSubmodule.os = 'all' chromiumSubmodule.initialize() chromiumSubmodule.initSubmodules() + subprocess.call(['src/3rdparty_upstream/chromium/third_party/node/update_npm_deps']) # Unstage repositories so we do not accidentally commit them. subprocess.call(['git', 'reset', '-q', 'HEAD', 'src/3rdparty_upstream/gn']) @@ -135,12 +112,31 @@ def initSnapshot(): snapshot.os = 'all' snapshot.initialize() +def initPackages(): + # 'androidx' it is the only so far cipd package we need + third_party_upstream_chromium = os.path.join(qtwebengine_root, 'src/3rdparty_upstream/chromium') + currentDir = os.getcwd() + os.chdir(third_party_upstream_chromium) + cipd = CIPDPackage.CIPDEntity(third_party_upstream_chromium) + cipd_entites = cipd.readEntities() + for e in cipd_entites: + pkg = e.findPackage(CIPDPackage.androidx_package_name) + if pkg: + print('-- fetching and deploying ' + CIPDPackage.androidx_package_name) + pkg.fetchAndDeploy() + os.chdir(currentDir) + os.chdir(qtwebengine_root) if args.upstream: initUpstreamSubmodules() updateLastChange() if not args.baseline_upstream and not use_external_chromium: - subprocess.call(['python', os.path.join(qtwebengine_root, 'tools', 'scripts', 'patch_upstream.py')]) + subprocess.call(['python3', os.path.join(qtwebengine_root, 'tools', 'scripts', 'patch_upstream.py')]) if args.snapshot: initSnapshot() +if args.use_cipd: + cipdNotFound = subprocess.call(['which', 'cipd']) + if cipdNotFound: + raise Exception("You need cipd from depo tools.Try setting ./src/3rdparty_upstream/chromium/third_party/depot_tools/cipd in your PATH.") + initPackages() diff --git a/tools/scripts/make_archive.sh b/tools/scripts/make_archive.sh index a98061e65..fe61dfa2b 100755 --- a/tools/scripts/make_archive.sh +++ b/tools/scripts/make_archive.sh @@ -1,32 +1,6 @@ #!/bin/bash - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 if [ $# -ne 3 ]; then echo "Usage: $0 git-ref release-name version" diff --git a/tools/scripts/patch_upstream.py b/tools/scripts/patch_upstream.py index b1fd78076..53f3fdb91 100755 --- a/tools/scripts/patch_upstream.py +++ b/tools/scripts/patch_upstream.py @@ -1,32 +1,6 @@ #!/usr/bin/env python - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import glob import os diff --git a/tools/scripts/take_snapshot.py b/tools/scripts/take_snapshot.py index 8b03076bc..e312dd64c 100755 --- a/tools/scripts/take_snapshot.py +++ b/tools/scripts/take_snapshot.py @@ -1,43 +1,18 @@ -#!/usr/bin/env python - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +#!/usr/bin/env python3 +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import glob import os import subprocess import sys -import imp +import importlib import errno import shutil from distutils.version import StrictVersion import git_submodule as GitSubmodule +import cipd_package as CIPDPackage qtwebengine_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) os.chdir(qtwebengine_root) @@ -58,10 +33,14 @@ def isInChromiumBlacklist(file_path): if file_path.endswith('.gn') or file_path.endswith('.gni') or file_path.endswith('.typemap') or \ file_path.endswith('.mojom'): return False + # Add android dependencies info so gn build tree can be parsed + if file_path.endswith('.info') or file_path.endswith('.pydeps'): + return False + if file_path.endswith('.mailmap') or file_path.endswith('.tat.gz.sha1'): + return True if (file_path.startswith('android_webview') or file_path.startswith('apps/') or file_path.startswith('ash/') - or file_path.startswith('base/android') or file_path.startswith('buildtools/clang_format/script') or file_path.startswith('buildtools/third_party/libc++') or file_path.startswith('buildtools/third_party/libc++abi') @@ -75,11 +54,19 @@ def isInChromiumBlacklist(file_path): and not file_path.startswith('chrome/browser/custom_handlers/') and not file_path.startswith('chrome/browser/devtools/') and not file_path.startswith('chrome/browser/extensions/api/') + and not file_path.startswith('chrome/browser/gcm/') and not file_path.startswith('chrome/browser/media/webrtc/') and not file_path.startswith('chrome/browser/net/') and not file_path.startswith('chrome/browser/prefs/') and not file_path.startswith('chrome/browser/printing/') + and not file_path.startswith('chrome/browser/profiles/incognito_helpers') + and not file_path.startswith('chrome/browser/profiles/profile_keyed_service_factory') + and not file_path.startswith('chrome/browser/profiles/profile_selections') + and not file_path.startswith('chrome/browser/push_messaging/') and not file_path.startswith('chrome/browser/renderer_host/') + and not file_path.startswith('chrome/browser/share/core/') + and not file_path.startswith('chrome/browser/share/proto/') + and not file_path.startswith('chrome/browser/signin/') and not file_path.startswith('chrome/browser/spellchecker') and not file_path.startswith('chrome/browser/tab_contents/') and not file_path.startswith('chrome/browser/ui/webui/') @@ -90,10 +77,12 @@ def isInChromiumBlacklist(file_path): and not (file_path.startswith('chrome/common/') and not file_path.startswith('chrome/common/extensions/docs')) and not file_path.startswith('chrome/renderer/') + and not file_path.startswith('chrome/test/chromedriver/') and not file_path.startswith('chrome/tools/convert_dict/') and not file_path.endswith('.grd') and not file_path.endswith('.grdp') - and not file_path.endswith('chrome_version.rc.version')) + and not file_path.endswith('chrome_version.rc.version') + and not file_path.endswith('service_sandbox_type.h')) or file_path.startswith('chrome_elf') or file_path.startswith('chromecast') or file_path.startswith('chromeos') @@ -103,10 +92,9 @@ def isInChromiumBlacklist(file_path): or file_path.startswith('components/cronet/') or file_path.startswith('components/drive/') or file_path.startswith('components/invalidation/') - or file_path.startswith('components/gcm_driver/') or file_path.startswith('components/nacl/') or file_path.startswith('components/omnibox/') - or file_path.startswith('components/policy/') + or file_path.startswith('components/policy/resources/') or file_path.startswith('components/proximity_auth/') or (file_path.startswith('components/resources/terms/') and not file_path.endswith('terms_chromium.html')) @@ -118,10 +106,10 @@ def isInChromiumBlacklist(file_path): or file_path.startswith('components/translate/') )) or file_path.startswith('content/public/android/java') - or (file_path.startswith('content/shell') - and not file_path.startswith('content/shell/common') - and not file_path.endswith('.grd')) + or file_path.startswith('content/shell/android/') + or file_path.startswith('content/shell/browser/') or file_path.startswith('courgette') + or file_path.startswith('docs/website/') or file_path.startswith('google_update') or file_path.startswith('ios') or file_path.startswith('media/base/android/java') @@ -130,7 +118,10 @@ def isInChromiumBlacklist(file_path): or (file_path.startswith('net/data/') and '_unittest/' in file_path) or file_path.startswith('net/data/fuzzer_data/') - or file_path.startswith('remoting') + or (file_path.startswith('remoting') + and not file_path.endswith('VERSION') + and not file_path.endswith('branding_Chromium') + and not file_path.endswith('remove_spaces.py')) or file_path.startswith('rlz') or file_path.startswith('testing/android') or file_path.startswith('testing/buildbot') @@ -139,6 +130,7 @@ def isInChromiumBlacklist(file_path): or file_path.startswith('third_party/accessibility') or file_path.startswith('third_party/afl') or file_path.startswith('third_party/android_') + or file_path.startswith('third_party/androidx') or file_path.startswith('third_party/angle/third_party/deqp') or file_path.startswith('third_party/angle/third_party/glmark2') or file_path.startswith('third_party/angle/third_party/VK-GL-CTS') @@ -166,13 +158,61 @@ def isInChromiumBlacklist(file_path): or file_path.startswith('third_party/chromite') or file_path.startswith('third_party/colorama') or file_path.startswith('third_party/depot_tools') - or file_path.startswith('third_party/devtools-frontend/src/node-modules/') + or file_path.startswith('third_party/devtools-frontend/src/third_party/image_diff') + or (file_path.startswith('third_party/node/node_modules/') + and not file_path.startswith('third_party/node/node_modules/@babel/') + and not file_path.startswith('third_party/node/node_modules/@types/d3') + and not file_path.startswith('third_party/node/node_modules/@types/trusted-types/') + and not file_path.startswith('third_party/node/node_modules/ansi-styles/') + and not file_path.startswith('third_party/node/node_modules/balanced-match/') + and not file_path.startswith('third_party/node/node_modules/brace-expansion/') + and not file_path.startswith('third_party/node/node_modules/cancel-token/') + and not file_path.startswith('third_party/node/node_modules/chalk/') + and not file_path.startswith('third_party/node/node_modules/color-convert/') + and not file_path.startswith('third_party/node/node_modules/color-name/') + and not file_path.startswith('third_party/node/node_modules/commander/') + and not file_path.startswith('third_party/node/node_modules/concat-map/') + and not file_path.startswith('third_party/node/node_modules/cssbeautify/') + and not file_path.startswith('third_party/node/node_modules/debug/') + and not file_path.startswith('third_party/node/node_modules/escape-string-regexp/') + and not file_path.startswith('third_party/node/node_modules/esutils/') + and not file_path.startswith('third_party/node/node_modules/function-bind/') + and not file_path.startswith('third_party/node/node_modules/globals/') + and not file_path.startswith('third_party/node/node_modules/has-ansi/') + and not file_path.startswith('third_party/node/node_modules/has-flag/') + and not file_path.startswith('third_party/node/node_modules/has/') + and not file_path.startswith('third_party/node/node_modules/indent/') + and not file_path.startswith('third_party/node/node_modules/is-core-module/') + and not file_path.startswith('third_party/node/node_modules/is-windows/') + and not file_path.startswith('third_party/node/node_modules/@jridgewell/') + and not file_path.startswith('third_party/node/node_modules/js-tokens/') + and not file_path.startswith('third_party/node/node_modules/jsesc/') + and not file_path.startswith('third_party/node/node_modules/jsonschema/') + and not file_path.startswith('third_party/node/node_modules/lodash.camelcase/') + and not file_path.startswith('third_party/node/node_modules/lodash.sortby/') + and not file_path.startswith('third_party/node/node_modules/minimatch/') + and not file_path.startswith('third_party/node/node_modules/ms/') + and not file_path.startswith('third_party/node/node_modules/path-is-inside/') + and not file_path.startswith('third_party/node/node_modules/polymer-analyzer/') + and not file_path.startswith('third_party/node/node_modules/polymer-css-build/') + and not file_path.startswith('third_party/node/node_modules/resolve/') + and not file_path.startswith('third_party/node/node_modules/rollup/') + and not file_path.startswith('third_party/node/node_modules/shady-css-parser/') + and not file_path.startswith('third_party/node/node_modules/source-map/') + and not file_path.startswith('third_party/node/node_modules/stable/') + and not file_path.startswith('third_party/node/node_modules/supports-color/') + and not file_path.startswith('third_party/node/node_modules/terser/') + and not file_path.startswith('third_party/node/node_modules/to-fast-properties/') + and not file_path.startswith('third_party/node/node_modules/tr46/') + and not file_path.startswith('third_party/node/node_modules/typescript/') + and not file_path.startswith('third_party/node/node_modules/vscode-uri/') + and not file_path.startswith('third_party/node/node_modules/webidl-conversions/') + and not file_path.startswith('third_party/node/node_modules/whatwg-url/')) or file_path.startswith('third_party/fuschsia-sdk/') or file_path.startswith('third_party/glslang/src/Test/') or file_path.startswith('third_party/google_') or file_path.startswith('third_party/grpc/') or file_path.startswith('third_party/hunspell_dictionaries') - or file_path.startswith('third_party/icu/android') or file_path.startswith('third_party/icu/cast') or file_path.startswith('third_party/icu/chromeos') or file_path.startswith('third_party/instrumented_libraries') @@ -184,6 +224,7 @@ def isInChromiumBlacklist(file_path): or file_path.startswith('third_party/libFuzzer') or file_path.startswith('third_party/liblouis') or file_path.startswith('third_party/libphonenumber') + or file_path.startswith('third_party/libunwindstack') or file_path.startswith('third_party/logilab') or file_path.startswith('third_party/markdown') or file_path.startswith('third_party/openh264/src/res') @@ -196,10 +237,11 @@ def isInChromiumBlacklist(file_path): or file_path.startswith('third_party/sfntly/src/java') or file_path.startswith('third_party/skia/docs/') or file_path.startswith('third_party/skia/infra') - or file_path.startswith('third_party/skia/site/dev/tools/calendar.mskp') + or file_path.startswith('third_party/skia/site/docs/dev/tools/calendar.mskp') or file_path.startswith('third_party/sqlite/sqlite-src-') or file_path.startswith('third_party/spirv-cross/spirv-cross/reference/') or file_path.startswith('third_party/swiftshader/third_party/') + or file_path.startswith('third_party/tflite/') or file_path.startswith('third_party/unrar') or file_path.startswith('third_party/wayland') or file_path.startswith('third_party/webgl') @@ -236,6 +278,7 @@ def isInChromiumBlacklist(file_path): or ('/test/' in file_path and not '/webrtc/' in file_path and not file_path.startswith('net/test/') + and not file_path.startswith('chrome/test/chromedriver/') and not file_path.endswith('test_hook.h') and not file_path.endswith('perftimer.h') and not file_path.endswith('test-torque.tq') @@ -262,7 +305,7 @@ def printProgress(current, total): sys.stdout.write("\r{} of {}".format(current, total)) sys.stdout.flush() -def copyFile(src, dst): +def copyFile(src, dst, use_link = True, force_remove = False): src = os.path.abspath(src) dst = os.path.abspath(dst) dst_dir = os.path.dirname(dst) @@ -270,16 +313,19 @@ def copyFile(src, dst): if not os.path.isdir(dst_dir): os.makedirs(dst_dir) - if os.path.exists(dst): + if force_remove or os.path.exists(dst): os.remove(dst) try: - os.link(src, dst) + if use_link: + os.link(src, dst) + else: + shutil.copy(src,dst) # Qt uses LF-only but Chromium isn't. subprocess.call(['dos2unix', '--keep-bom', '--quiet', dst]) except OSError as exception: if exception.errno == errno.ENOENT: - print 'file does not exist:' + src + print('file does not exist: ' + src) else: raise @@ -289,10 +335,10 @@ third_party = os.path.join(qtwebengine_root, 'src/3rdparty') def clearDirectory(directory): currentDir = os.getcwd() os.chdir(directory) - print 'clearing the directory:' + directory + print('clearing the directory:' + directory) for direntry in os.listdir(directory): if not direntry == '.git' and os.path.isdir(direntry): - print 'clearing:' + direntry + print('clearing:' + direntry) shutil.rmtree(direntry) os.chdir(currentDir) @@ -306,17 +352,27 @@ def listFilesInCurrentRepository(use_deps=False): files.append(os.path.join(submodule.pathRelativeToTopMostSupermodule(), submodule_file)) return files +def listPackageFilesInCurrentRepositoryForPackage(packageName): + cipd = CIPDPackage.CIPDEntity(os.getcwd()) + cipd_entities = cipd.readEntities() + files = [] + for e in cipd_entities: + pkg = e.findPackage(CIPDPackage.androidx_package_name) + if pkg: + files.extend(pkg.listFiles()) + return files + def exportGn(): third_party_upstream_gn = os.path.join(third_party_upstream, 'gn') third_party_gn = os.path.join(third_party, 'gn') os.makedirs(third_party_gn); - print 'exporting contents of:' + third_party_upstream_gn + print('exporting contents of:' + third_party_upstream_gn) os.chdir(third_party_upstream_gn) files = listFilesInCurrentRepository() - print 'copying files to ' + third_party_gn - for i in xrange(len(files)): + print('copying files to ' + third_party_gn) + for i in range(len(files)): printProgress(i+1, len(files)) - f = files[i] + f = files[i].decode() if not isInGitBlacklist(f): copyFile(f, os.path.join(third_party_gn, f)) print("") @@ -325,13 +381,13 @@ def exportNinja(): third_party_upstream_ninja = os.path.join(third_party_upstream, 'ninja') third_party_ninja = os.path.join(third_party, 'ninja') os.makedirs(third_party_ninja); - print 'exporting contents of:' + third_party_upstream_ninja + print('exporting contents of:' + third_party_upstream_ninja) os.chdir(third_party_upstream_ninja) files = listFilesInCurrentRepository() - print 'copying files to ' + third_party_ninja - for i in xrange(len(files)): + print('copying files to ' + third_party_ninja) + for i in range(len(files)): printProgress(i+1, len(files)) - f = files[i] + f = files[i].decode() if not isInGitBlacklist(f): copyFile(f, os.path.join(third_party_ninja, f)) print("") @@ -340,36 +396,60 @@ def exportChromium(): third_party_upstream_chromium = os.path.join(third_party_upstream, 'chromium') third_party_chromium = os.path.join(third_party, 'chromium') os.makedirs(third_party_chromium); - print 'exporting contents of:' + third_party_upstream_chromium + print('exporting contents of:' + third_party_upstream_chromium) os.chdir(third_party_upstream_chromium) files = listFilesInCurrentRepository(True) # Add LASTCHANGE files which are not tracked by git. - files.append('build/util/LASTCHANGE') - files.append('build/util/LASTCHANGE.committime') - files.append('skia/ext/skia_commit_hash.h') - files.append('gpu/config/gpu_lists_version.h') - print 'copying files to ' + third_party_chromium - for i in xrange(len(files)): + files.append(b'build/util/LASTCHANGE') + files.append(b'build/util/LASTCHANGE.committime') + files.append(b'skia/ext/skia_commit_hash.h') + files.append(b'gpu/config/gpu_lists_version.h') + + files.extend(listPackageFilesInCurrentRepositoryForPackage(CIPDPackage.androidx_package_name)) + + for root, directories, local_files in os.walk(third_party_upstream_chromium + '/third_party/node/node_modules'): + for name in local_files: + f = os.path.relpath(os.path.join(root, name)) + files.append(f) + + symlinks = [] + print('copying files to ' + third_party_chromium) + for i in range(len(files)): printProgress(i+1, len(files)) - f = files[i] + if isinstance(files[i], bytes): + f = files[i].decode() + else: + f = files[i] if not isInChromiumBlacklist(f) and not isInGitBlacklist(f): - copyFile(f, os.path.join(third_party_chromium, f)) + d = os.path.join(third_party_chromium, f) + copyFile(f,d) + # make sure we did not make a hardlink of symlink which is broken afterwards + if os.path.islink(f): + symlinks.append((f,d)) + # this is mostly used for files coming from cipd packages + for s in symlinks: + if not os.path.exists(s[1]): + print('fixing ivalid link ' + s[1]) + copyFile(s[0],s[1], use_link = False, force_remove = True) + + # We need to gzip transport_security_state_static.json since it is otherwise too big for our git configuration: + subprocess.call(['gzip', '-n', third_party_chromium + '/net/http/transport_security_state_static.json']) print("") commandNotFound = subprocess.call(['which', 'dos2unix']) if not commandNotFound: - dos2unixVersion , err = subprocess.Popen(['dos2unix', '-V', '| true'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + dos2unixVersion, err = subprocess.Popen(['dos2unix', '-V', '| true'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() if not dos2unixVersion: raise Exception("You need dos2unix version 6.0.6 minimum.") - dos2unixVersion = StrictVersion(dos2unixVersion.splitlines()[0].split()[1]) + dos2unixVersion = StrictVersion(dos2unixVersion.splitlines()[0].split()[1].decode()) if commandNotFound or dos2unixVersion < StrictVersion('6.0.6'): raise Exception("You need dos2unix version 6.0.6 minimum.") os.chdir(third_party) ignore_case_setting = subprocess.Popen(['git', 'config', '--get', 'core.ignorecase'], stdout=subprocess.PIPE).communicate()[0] -if 'true' in ignore_case_setting: +if b'true' in ignore_case_setting: raise Exception("Your 3rdparty repository is configured to ignore case. " "A snapshot created with these settings would cause problems on case sensitive file systems.") @@ -379,5 +459,5 @@ exportGn() exportNinja() exportChromium() -print 'done.' +print('done.') diff --git a/tools/scripts/update_change_ids.py b/tools/scripts/update_change_ids.py index 481d8424d..64149d2b6 100755 --- a/tools/scripts/update_change_ids.py +++ b/tools/scripts/update_change_ids.py @@ -1,32 +1,6 @@ #!/usr/bin/env python - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import glob import subprocess diff --git a/tools/scripts/version_resolver.py b/tools/scripts/version_resolver.py index d339b72dd..a29ee34e8 100644 --- a/tools/scripts/version_resolver.py +++ b/tools/scripts/version_resolver.py @@ -1,32 +1,6 @@ #!/usr/bin/env python - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import glob import os @@ -35,11 +9,42 @@ import shutil import subprocess import sys import json -import urllib2 +import urllib3 import git_submodule as GitSubmodule - -chromium_version = '90.0.4430.228' -chromium_branch = '4430' +from abc import ABC, abstractmethod + +class DEPSParser(ABC): + def __init__(self): + self.global_scope = { + 'Var': lambda var_name: '{%s}' % var_name, + 'Str': str, + 'deps_os': {}, + } + self.local_scope = {} + self.topmost_supermodule_path_prefix = '' + + def subdir(self, dep): + if dep.startswith('src/'): + return dep[4:] + # Don't skip submodules that have a supermodule path prefix set (at the moment these + # are 2nd level deep submodules). + elif not self.topmost_supermodule_path_prefix: + # Ignore the information about chromium itself since we get that from git, + # also ignore anything outside src/ (e.g. depot_tools) + return None + else: + return dep + + @abstractmethod + def parse(self): + pass + + def get_recursedeps(self): + return self.local_scope["recursedeps"] + + +chromium_version = '118.0.5993.220' +chromium_branch = '5993' ninja_version = 'v1.8.2' json_url = 'http://omahaproxy.appspot.com/all.json' @@ -49,20 +54,18 @@ snapshot_src_dir = os.path.abspath(os.path.join(qtwebengine_root, 'src/3rdparty' upstream_src_dir = os.path.abspath(snapshot_src_dir + '_upstream') submodule_blacklist = [ - 'third_party/WebKit/LayoutTests/w3c/csswg-test' - , 'third_party/WebKit/LayoutTests/w3c/web-platform-tests' - , 'chrome/tools/test/reference_build/chrome_mac' - , 'chrome/tools/test/reference_build/chrome_linux' - , 'chrome/tools/test/reference_build/chrome_win' - # buildtools duplicates: - , 'buildtools/clang_format/script' - , 'buildtools/linux64' - , 'buildtools/mac' - , 'buildtools/win' - , 'buildtools/third_party/libc++/trunk' - , 'buildtools/third_party/libc++abi/trunk' - , 'buildtools/third_party/libunwind/trunk' - ] + 'buildtools/clang_format/script', + 'buildtools/third_party/libc++/trunk', + 'buildtools/third_party/libc++abi/trunk', + 'buildtools/third_party/libunwind/trunk', + 'chrome/browser/resources/chromeos/quickoffice', + 'remoting/host/installer/linux/internal', + 'third_party/widevine/cdm/chromeos', + 'third_party/widevine/cdm/linux', + 'third_party/widevine/test/license_server', + 'ui/file_manager/internal' +] +submodule_whitelist = [ 'src/third_party/android_ndk' , 'src/third_party/libunwindstack' ] sys.path.append(os.path.join(qtwebengine_root, 'tools', 'scripts')) @@ -85,11 +88,11 @@ def readReleaseChannels(): channels[os].append({ 'channel': ver['channel'], 'version': ver['version'], 'branch': ver['true_branch'] }) return channels -def readSubmodules(): +def read(parserCls): git_deps = subprocess.check_output(['git', 'show', chromium_version +':DEPS']) - parser = GitSubmodule.DEPSParser() - git_submodules = parser.parse(git_deps) + parser = parserCls() + git_submodules = parser.parse(git_deps, submodule_whitelist) submodule_dict = {} @@ -106,7 +109,7 @@ def readSubmodules(): with open(extra_deps_file_path, 'r') as extra_deps_file: extra_deps = extra_deps_file.read() if extra_deps: - extradeps_parser = GitSubmodule.DEPSParser() + extradeps_parser = parserCls() extradeps_parser.topmost_supermodule_path_prefix = extradeps_dir extradeps_submodules = extradeps_parser.parse(extra_deps) for sub in extradeps_submodules: @@ -171,7 +174,7 @@ def resetUpstream(): chromium = GitSubmodule.Submodule() chromium.path = "." - submodules = chromium.readSubmodules() + submodules = chromium.readSubmodules(True) submodules.append(chromium) print('-- resetting upstream submodules in ' + os.path.relpath(target_dir) + ' to baseline --') diff --git a/tools/scripts/windeploy-examples.py b/tools/scripts/windeploy-examples.py index 3b2b42318..ef0e195aa 100755 --- a/tools/scripts/windeploy-examples.py +++ b/tools/scripts/windeploy-examples.py @@ -1,32 +1,6 @@ #!/usr/bin/env python - -############################################################################# -## -## Copyright (C) 2015 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2015 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import argparse import os |