Set USERPROFILE for Windows builds to fix CI issue.

This change fixes https://github.com/jax-ml/jax/actions/runs/13686468791/job/38270929632.

From the [documentation](https://docs.python.org/3/library/os.path.html#os.path.expanduser):
`On Windows, USERPROFILE will be used if set, otherwise a combination of HOMEPATH and HOMEDRIVE will be used.`

PiperOrigin-RevId: 733935305
This commit is contained in:
jax authors 2025-03-05 18:08:35 -08:00
parent 016b351f00
commit c16f37d89d

View File

@ -70,6 +70,12 @@ def build_wheel(
env = dict(os.environ)
if git_hash:
env["JAX_GIT_HASH"] = git_hash
if is_windows() and (
"USERPROFILE" not in env
and "HOMEDRIVE" not in env
and "HOMEPATH" not in env
):
env["USERPROFILE"] = env.get("SYSTEMDRIVE", "C:")
subprocess.run(
[sys.executable, "-m", "build", "-n"]
+ (["-w"] if build_wheel_only else []),