Skip to content

Commit 0f0ea34

Browse files
authored
Add git submodule update when doing a git checkout (#974)
This is required to build binaryen since WebAssembly/binaryen#4466
1 parent 61c35ab commit 0f0ea34

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

emsdk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ def git_clone(url, dstpath):
812812
if GIT_CLONE_SHALLOW:
813813
git_clone_args += ['--depth', '1']
814814
print('Cloning from ' + url + '...')
815-
return run([GIT(), 'clone'] + git_clone_args + [url, dstpath]) == 0
815+
return run([GIT(), 'clone', '--recurse-submodules'] + git_clone_args + [url, dstpath]) == 0
816816

817817

818818
def git_checkout_and_pull(repo_path, branch_or_tag):
@@ -827,7 +827,7 @@ def git_checkout_and_pull(repo_path, branch_or_tag):
827827
return False
828828
# this line assumes that the user has not gone and manually messed with the
829829
# repo and added new remotes to ambiguate the checkout.
830-
ret = run([GIT(), 'checkout', '--quiet', branch_or_tag], repo_path)
830+
ret = run([GIT(), 'checkout', '--recurse-submodules', '--quiet', branch_or_tag], repo_path)
831831
if ret != 0:
832832
return False
833833
# Test if branch_or_tag is a branch, or if it is a tag that needs to be updated
@@ -838,6 +838,7 @@ def git_checkout_and_pull(repo_path, branch_or_tag):
838838
ret = run([GIT(), 'merge', '--ff-only', 'origin/' + branch_or_tag], repo_path)
839839
if ret != 0:
840840
return False
841+
run([GIT(), 'submodule', 'update', '--init'], repo_path, quiet=True)
841842
except:
842843
errlog('git operation failed!')
843844
return False

0 commit comments

Comments
 (0)