Skip to content

Commit 0ca4016

Browse files
committed
Shallow support modifications to automate-git does not seem to actually work and not enabled by default
1 parent 1626f97 commit 0ca4016

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

Dockerfile_cef

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ARG CHROME_BRANCH=3239
1717
RUN setX /M DEPOT_TOOLS_WIN_TOOLCHAIN 0;setX /M GYP_MSVS_VERSION "$env:GN_DEFINES";setx /M GN_DEFINES "$env:GN_DEFINES";setx /M GN_ARGUMENTS "$env:GN_ARGUMENTS";setx /M GYP_DEFINES "$env:GYP_DEFINES";setx /M DUAL_BUILD "$env:DUAL_BUILD";setx /M BINARY_EXT "$env:BINARY_EXT";setx /M ARCHES "$env:ARCHES";setx /M CEF_SAVE_SOURCES "$env:CEF_SAVE_SOURCES";setx /M CHROME_BRANCH "$env:CHROME_BRANCH";
1818

1919
ADD https://bitbucket.org/chromiumembedded/cef/raw/master/tools/automate/automate-git.py c:/code/automate/
20-
ADD automate-git.py c:/code/automate/
20+
#ADD automate-git-shallow-support.py c:/code/automate/automate-git.py
2121
RUN cd c:/code/depot_tools/;./update_depot_tools.bat;./update_depot_tools.bat;
2222
RUN $env:Path = 'c:/code/depot_tools/;' + $env:Path;setx /M PATH $env:Path;
2323
ADD functions.ps1 cef_build.ps1 cef_patch.ps1 cef_patch_*.diff c:/code/

automate-git-shallow-support.py

+18-10
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636

3737
chromium_channel_json_url = 'https://omahaproxy.appspot.com/all.json'
3838

39+
shallow_git_depth_limit = ''
40+
shallow_gclient_no_history = ''
41+
42+
if os.environ.get('SHALLOW') == '1':
43+
shallow_gclient_no_history = '--no-history'
44+
shallow_git_depth_limit = '--depth 1'
45+
46+
3947
##
4048
# Global system variables.
4149
##
@@ -182,7 +190,7 @@ def download_and_extract(src, target):
182190
""" Extracts the contents of src, which may be a URL or local file, to the
183191
target directory. """
184192
temporary = False
185-
193+
sys.stdout.write("-------- downloading and extracting \"%s\" to \"%s\"...\n" % (src, target))
186194
if src[:4] == 'http':
187195
# Attempt to download a URL.
188196
opener = FancyURLopener({})
@@ -1181,7 +1189,7 @@ def check_pattern_matches(output_file=None):
11811189
# Create the CEF checkout if necessary.
11821190
if not options.nocefupdate and not os.path.exists(cef_dir):
11831191
cef_checkout_new = True
1184-
run('%s clone %s %s' % (git_exe, cef_url, cef_dir), download_dir,
1192+
run('%s clone %s %s %s' % (git_exe,shallow_git_depth_limit, cef_url, cef_dir), download_dir,
11851193
depot_tools_dir)
11861194
else:
11871195
cef_checkout_new = False
@@ -1191,8 +1199,8 @@ def check_pattern_matches(output_file=None):
11911199
cef_current_hash = get_git_hash(cef_dir, 'HEAD')
11921200

11931201
if not cef_checkout_new:
1194-
# Fetch updated sources.
1195-
run('%s fetch' % (git_exe), cef_dir, depot_tools_dir)
1202+
# fetch --depth 1 updated sources.
1203+
run('%s fetch %s' % (git_exe, shallow_git_depth_limit), cef_dir, depot_tools_dir)
11961204

11971205
cef_desired_hash = get_git_hash(cef_dir, cef_checkout)
11981206
cef_checkout_changed = cef_checkout_new or force_change or \
@@ -1287,7 +1295,7 @@ def check_pattern_matches(output_file=None):
12871295
# Initial Chromium checkout.
12881296
if not options.nochromiumupdate and not os.path.exists(chromium_src_dir):
12891297
chromium_checkout_new = True
1290-
run("gclient sync --nohooks --with_branch_heads --jobs 16", \
1298+
run("gclient sync " + shallow_gclient_no_history + " --nohooks --with_branch_heads --jobs 16", \
12911299
chromium_dir, depot_tools_dir)
12921300
else:
12931301
chromium_checkout_new = False
@@ -1299,13 +1307,13 @@ def check_pattern_matches(output_file=None):
12991307
if os.path.exists(chromium_src_dir):
13001308
msg("Chromium URL: %s" % (get_git_url(chromium_src_dir)))
13011309

1302-
# Fetch Chromium changes so that we can perform the necessary calculations using
1310+
# fetch Chromium changes so that we can perform the necessary calculations using
13031311
# local history.
13041312
if not options.nochromiumupdate and os.path.exists(chromium_src_dir):
1305-
# Fetch updated sources.
1306-
run("%s fetch" % (git_exe), chromium_src_dir, depot_tools_dir)
1313+
# fetch --depth 1 updated sources.
1314+
run("%s fetch %s" % (git_exe,shallow_git_depth_limit), chromium_src_dir, depot_tools_dir)
13071315
# Also fetch tags, which are required for release branch builds.
1308-
run("%s fetch --tags" % (git_exe), chromium_src_dir, depot_tools_dir)
1316+
run("%s fetch %s --tags" % (git_exe,shallow_git_depth_limit), chromium_src_dir, depot_tools_dir)
13091317

13101318
# Determine the Chromium checkout options required by CEF.
13111319
chromium_compat_version = build_compat_versions['chromium_checkout']
@@ -1375,7 +1383,7 @@ def check_pattern_matches(output_file=None):
13751383
apply_deps_patch()
13761384

13771385
# Update third-party dependencies including branch/tag information.
1378-
run("gclient sync %s--nohooks --with_branch_heads --jobs 16" % \
1386+
run("gclient sync " + shallow_gclient_no_history + " %s--nohooks --with_branch_heads --jobs 16" % \
13791387
('--reset ' if discard_local_changes else ''), chromium_dir, depot_tools_dir)
13801388

13811389
# Patch the Chromium runhooks scripts if necessary.

cef_build.ps1

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ Function RunBuild{
6767
return RunProc -verbose_mode "host" -proc "c:/code/depot_tools/ninja.exe" -opts "$build_args_add -C out/Release_GN_$version cefclient" -no_wait;
6868
}
6969

70-
$chrome_data = Invoke-RestMethod -Uri 'https://omahaproxy.appspot.com/all.json'
71-
$win_data = $chrome_data | Where { $_.os -eq "win64"} | Select -First 1
72-
$branch_data = $win_data.versions | Where {$_.true_branch -eq $env:CHROME_BRANCH} | Select -First 1
73-
$latest_tag = $branch_data.version
74-
7570
if ($Env:SHALLOW -eq "1"){
71+
$chrome_data = Invoke-RestMethod -Uri 'https://omahaproxy.appspot.com/all.json'
72+
$win_data = $chrome_data | Where { $_.os -eq "win64"} | Select -First 1
73+
$branch_data = $win_data.versions | Where {$_.true_branch -eq $env:CHROME_BRANCH} | Select -First 1
74+
$latest_tag = $branch_data.version
75+
7676
if (! (Test-Path /code/chromium_git/cef/.git)){ #we will manually clone this out first time or wont be on right branch
7777
Runproc -proc "c:/code/depot_tools/git.bat" -opts "clone --depth 1 --branch $env:CHROME_BRANCH https://bitbucket.org/chromiumembedded/cef.git c:/code/chromium_git/cef"; #as shallow fails if they don't speify the branch so we will do it first for them
7878
}

0 commit comments

Comments
 (0)