Skip to content

Commit 5e5ca48

Browse files
committed
update
1 parent 8b287d1 commit 5e5ca48

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

ci/create-artifacts.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def main():
1616
marker_files = [Path(p) for p in glob("target/**/main.c", recursive=True)]
1717
marker_files.sort(key=lambda path: path.stat().st_mtime)
1818
build_dir = marker_files[0].parent
19+
print(f"Located build directory '{build_dir}'")
1920

2021
# Collect all relevant Rust and C files
2122
add_files = glob("**/*.rs", recursive=True, root_dir=build_dir)
@@ -38,11 +39,19 @@ def main():
3839

3940

4041
if __name__ == "__main__":
42+
# FIXME(ci): remove after the bump to windoes-2025 GHA images
43+
# Python <= 3.9 does not support the very helpful `root_dir` argument,
44+
# and that is the version used by the Windows GHA images. Rather than
45+
# using setup-python or doing something in the CI script, just find
46+
# the newer version and relaunch if this happens to be run with an old
47+
# version.
4148
try:
42-
print("okay")
4349
glob("", root_dir="")
4450
except TypeError:
45-
print(f"failed with {sys.version}")
51+
if os.environ.get("CI") is None:
52+
sys.exit(1)
53+
54+
# Find the next 3.1x Python version
4655
dirs = sorted(list(Path(r"C:\hostedtoolcache\windows\Python").iterdir()))
4756
usepy = next(x for x in dirs if r"\3.1" in str(x))
4857
py = usepy.joinpath(r"x64\python.exe")

0 commit comments

Comments
 (0)