Files
cef/patch/patches/angle_commit_config.patch

64 lines
2.1 KiB
Diff

diff --git BUILD.gn BUILD.gn
index 462157e42ab55577290b9dc4ee3de53455d84b80..bafa4d77d539dc886dd7c3fd690a0c24f1a94f63 100644
--- BUILD.gn
+++ BUILD.gn
@@ -89,6 +89,9 @@ declare_args() {
# Prefix where the artifacts should be installed on the system
install_prefix = ""
+
+ angle_commit_id = ""
+ angle_commit_position = "0"
}
declare_args() {
@@ -909,6 +912,8 @@ action("angle_commit_id") {
"gen",
rebase_path(_commit_id_header, root_build_dir),
rebase_path(depfile, root_build_dir),
+ angle_commit_position,
+ angle_commit_id,
]
public_configs = [ ":angle_commit_id_config" ]
diff --git src/commit_id.py src/commit_id.py
index bb1e2ce746a40e9a269986ffa207365d8aa2cc9d..d826fe79f9328e172770cd0a85cdf3f3b7142810 100755
--- src/commit_id.py
+++ src/commit_id.py
@@ -13,7 +13,7 @@ import os
usage = """\
Usage: commit_id.py position - print commit position
- commit_id.py gen <output> [depfile] - generate commit.h"""
+ commit_id.py gen <output> [depfile] [commit_position] [commit_id] - generate commit.h"""
def grab_output(command, cwd):
@@ -126,15 +126,24 @@ if len(sys.argv) < 3 or operation != 'gen':
sys.exit(usage)
output_file = sys.argv[2]
-depfile = sys.argv[3] if len(sys.argv) == 4 else None
+depfile = sys.argv[3] if len(sys.argv) >= 4 else None
commit_id_size = 12
commit_date = 'unknown date'
commit_position = '0'
+if len(sys.argv) >= 5:
+ commit_position = sys.argv[4]
+ assert commit_position.isnumeric(), commit_position
+
+commit_id = None
+if len(sys.argv) >= 6 and len(sys.argv[5]) > 0:
+ commit_id = sys.argv[5]
+ assert len(commit_id) == commit_id_size, commit_id
+
# If the ANGLE_UPSTREAM_HASH environment variable is set, use it as
# commit_id. commit_date will be 'unknown date' and commit_position will be 0
# in this case. See details in roll_aosp.sh where commit_id.py is invoked.
-commit_id = os.environ.get('ANGLE_UPSTREAM_HASH')
+commit_id = os.environ.get('ANGLE_UPSTREAM_HASH', commit_id)
# If ANGLE_UPSTREAM_HASH environment variable is not set, use the git command
# to get the git hash, when .git is available
if git_dir_exists and not commit_id: