Skip to content

Commit 893d417

Browse files
committed
ci: Check process output in create-artifacts
Add `check=True` to catch nonzero exit codes, and address one other lint for unneeded collection to `list`. Additionally, add some print statements in an attempt to help debug the CI failure on Windows. (backport <#4813>) (cherry picked from commit 83bd32f)
1 parent 83f3c38 commit 893d417

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ci/create-artifacts.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ def main():
3030
archive_name = f"archive-{now}"
3131
archive_path = f"{archive_name}.tar.gz"
3232

33-
sp.run(["tar", "czvf", archive_path, "-C", build_dir, "-T-"], input=file_list)
33+
sp.run(
34+
["tar", "czvf", archive_path, "-C", build_dir, "-T-"],
35+
input=file_list,
36+
check=True,
37+
)
3438

3539
# If we are in GHA, set these env vars for future use
3640
gh_env = os.getenv("GITHUB_ENV")
@@ -42,6 +46,7 @@ def main():
4246

4347

4448
if __name__ == "__main__":
49+
print("Starting script...") # For debugging CI failures
4550
# FIXME(ci): remove after the bump to windoes-2025 GHA images
4651
# Python <= 3.9 does not support the very helpful `root_dir` argument,
4752
# and that is the version used by the Windows GHA images. Rather than
@@ -55,10 +60,12 @@ def main():
5560
sys.exit(1)
5661

5762
# Find the next 3.1x Python version
58-
dirs = sorted(list(Path(r"C:\hostedtoolcache\windows\Python").iterdir()))
63+
dirs = sorted(Path(r"C:\hostedtoolcache\windows\Python").iterdir())
5964
usepy = next(x for x in dirs if r"\3.1" in str(x))
6065
py = usepy.joinpath(r"x64\python.exe")
6166
print(f"relaunching with {py}")
6267
os.execvp(py, [__file__] + sys.argv)
6368

6469
main()
70+
else:
71+
print("not invoked as main, exiting") # For debugging CI failures

0 commit comments

Comments
 (0)