diff options
Diffstat (limited to 'tools/scripts')
-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 | 76 | ||||
-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 | 53 | ||||
-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 | 147 | ||||
-rwxr-xr-x | tools/scripts/update_change_ids.py | 30 | ||||
-rw-r--r-- | tools/scripts/version_resolver.py | 101 | ||||
-rwxr-xr-x | tools/scripts/windeploy-examples.py | 30 |
13 files changed, 322 insertions, 398 deletions
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 350da8a03..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 @@ -43,15 +19,14 @@ def subprocessCheckOutput(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,24 +46,18 @@ 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 @@ -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)) @@ -319,7 +285,7 @@ class Submodule: def readSubmodules(self, use_deps=False): submodules = [] if use_deps: - submodules = resolver.readSubmodules() + 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) 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 6209b4866..e6ec0c440 100755 --- a/tools/scripts/init-repository.py +++ b/tools/scripts/init-repository.py @@ -1,32 +1,6 @@ #!/usr/bin/env python3 - -############################################################################# -## -## 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 @@ -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) @@ -136,6 +112,20 @@ 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: @@ -145,3 +135,8 @@ if args.upstream: 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 126b88537..e312dd64c 100755 --- a/tools/scripts/take_snapshot.py +++ b/tools/scripts/take_snapshot.py @@ -1,32 +1,6 @@ #!/usr/bin/env python3 - -############################################################################# -## -## 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 @@ -38,6 +12,7 @@ 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,13 +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/') @@ -92,6 +77,7 @@ 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') @@ -106,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')) @@ -121,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') @@ -133,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') @@ -142,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') @@ -169,16 +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/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/typescript/')) + 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') @@ -190,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') @@ -206,6 +241,7 @@ def isInChromiumBlacklist(file_path): 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') @@ -242,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') @@ -268,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) @@ -276,11 +313,14 @@ 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: @@ -312,6 +352,16 @@ 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') @@ -354,11 +404,15 @@ def exportChromium(): 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)) @@ -367,10 +421,19 @@ def exportChromium(): 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', third_party_chromium + '/net/http/transport_security_state_static.json']) + subprocess.call(['gzip', '-n', third_party_chromium + '/net/http/transport_security_state_static.json']) print("") commandNotFound = subprocess.call(['which', 'dos2unix']) 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 986e6d3a3..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 @@ -37,9 +11,40 @@ import sys import json import urllib3 import git_submodule as GitSubmodule - -chromium_version = '94.0.4606.126' -chromium_branch = '4606' +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: 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 |