Skip to content

Commit bad080a

Browse files
authored
Merge pull request #6588 from jepler/signal-errors-ci-fetch-deps
signal errors in ci_fetch_deps subprocesses
2 parents 145cce9 + 8cdbeb6 commit bad080a

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tools/ci_fetch_deps.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@
4343
}
4444

4545

46-
def run(title, command):
46+
def run(title, command, check=True):
4747
print("::group::" + title, flush=True)
4848
print(command, flush=True)
4949
start = time.monotonic()
50-
subprocess.run(shlex.split(command), stderr=subprocess.STDOUT)
51-
print("Duration:", time.monotonic() - start, flush=True)
52-
print("::endgroup::", flush=True)
50+
try:
51+
subprocess.run(shlex.split(command), stderr=subprocess.STDOUT, check=check)
52+
finally:
53+
print("Duration:", time.monotonic() - start, flush=True)
54+
print("::endgroup::", flush=True)
5355

5456

5557
run(
@@ -106,7 +108,11 @@ def run(title, command):
106108
submodules = " ".join(submodules)
107109
# This line will fail because the submodule's need different commits than the tip of the branch. We
108110
# fix it later.
109-
run("Init the submodules we'll need", f"git submodule update --init -N --depth 1 {submodules}")
111+
run(
112+
"Init the submodules we'll need",
113+
f"git submodule update --init -N --depth 1 {submodules}",
114+
check=False,
115+
)
110116

111117
run(
112118
"Fetch the submodule sha",

0 commit comments

Comments
 (0)