Skip to content

Commit 6969759

Browse files
committed
Make fetch-gn and activate-emsdk optional in git-sync-deps
These two scripts is platform-dependent and may fail if there are no prebuilt binaries for an unsupported platform. Making these steps optional makes building on those platforms easier, for they can use their own versions of toolchain (e.g. packages in a Linux distro).
1 parent e9d6992 commit 6969759

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

tools/git-sync-deps

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ Environment Variables:
1919
2020
GIT_SYNC_DEPS_QUIET: if set to non-empty string, suppress messages.
2121
22+
GIT_SYNC_DEPS_NO_FETCH_GN: if set to non-empty string, bin/fetch-gn
23+
will not be called.
24+
25+
GIT_SYNC_DEPS_NO_ACTIVATE_EMSDK: if set to non-empty string,
26+
bin/activate-emsdk will not be called.
27+
2228
Git Config:
2329
To disable syncing of a single repository:
2430
cd path/to/repository
@@ -258,18 +264,22 @@ def multithread(function, list_of_arg_lists):
258264
def main(argv):
259265
deps_file_path = os.environ.get('GIT_SYNC_DEPS_PATH', DEFAULT_DEPS_PATH)
260266
verbose = not bool(os.environ.get('GIT_SYNC_DEPS_QUIET', False))
267+
fetch_gn = not bool(os.environ.get('GIT_SYNC_DEPS_NO_FETCH_GN', False))
268+
activate_emsdk = not bool(os.environ.get('GIT_SYNC_DEPS_NO_ACTIVATE_EMSDK', False))
261269

262270
if '--help' in argv or '-h' in argv:
263271
usage(deps_file_path)
264272
return 1
265273

266274
git_sync_deps(deps_file_path, argv, verbose)
267-
subprocess.check_call(
268-
[sys.executable,
269-
os.path.join(os.path.dirname(deps_file_path), 'bin', 'fetch-gn')])
270-
subprocess.check_call(
271-
[sys.executable,
272-
os.path.join(os.path.dirname(deps_file_path), 'bin', 'activate-emsdk')])
275+
if fetch_gn:
276+
subprocess.check_call(
277+
[sys.executable,
278+
os.path.join(os.path.dirname(deps_file_path), 'bin', 'fetch-gn')])
279+
if activate_emsdk:
280+
subprocess.check_call(
281+
[sys.executable,
282+
os.path.join(os.path.dirname(deps_file_path), 'bin', 'activate-emsdk')])
273283
return 0
274284

275285

0 commit comments

Comments
 (0)