Wrap get_gitHash in try-catch to prevent failures in tarball builds.
Bug: chromium:1321370 Change-Id: If39d2236d1b4d965f7bd189f6bd1cdc70436c41d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88582 Commit-Queue: Loko Kung <lokokung@google.com> Reviewed-by: Austin Eng <enga@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
f05cba72c3
commit
03ddfbb81f
|
@ -27,11 +27,14 @@ def get_git():
|
|||
|
||||
|
||||
def get_gitHash(dawnDir):
|
||||
try:
|
||||
result = subprocess.run([get_git(), "rev-parse", "HEAD"],
|
||||
stdout=subprocess.PIPE,
|
||||
cwd=dawnDir)
|
||||
if result.returncode == 0:
|
||||
return result.stdout.decode("utf-8").strip()
|
||||
except Exception:
|
||||
return ""
|
||||
# No hash was available (possibly) because the directory was not a git checkout. Dawn should
|
||||
# explicitly handle its absenece and disable features relying on the hash, i.e. caching.
|
||||
return ""
|
||||
|
|
Loading…
Reference in New Issue