Skip to content

Commit 34bff76

Browse files
committed
Honor a CACHE_DIR environment variable for the cache dir.
1 parent 960376c commit 34bff76

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Apple/__main__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,11 @@ def configure_host_python(
380380
with group(f"Downloading dependencies ({host})"):
381381
if not prefix_dir.exists():
382382
prefix_dir.mkdir()
383-
cache_dir = context.cache_dir or CROSS_BUILD_DIR / "downloads"
383+
cache_dir = (
384+
Path(context.cache_dir).resolve()
385+
if context.cache_dir
386+
else CROSS_BUILD_DIR / "downloads"
387+
)
384388
unpack_deps(context.platform, host, prefix_dir, cache_dir)
385389
else:
386390
print("Dependencies already installed")
@@ -993,6 +997,7 @@ def parse_args() -> argparse.Namespace:
993997
for cmd in [configure_host, build, ci]:
994998
cmd.add_argument(
995999
"--cache-dir",
1000+
default=os.environ.get("CACHE_DIR"),
9961001
help="The directory to store cached downloads.",
9971002
)
9981003

0 commit comments

Comments
 (0)