pypa / distutils

distutils as found in cpython

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat`.

jaraco opened this issue · comments

The error in the CI seems to be unrelated to the change: distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat.

Maybe this error is also related to GitHub's update to windows-2022?

Refs:

Originally posted by @abravalheri in #116 (comment)

This issue is also affecting Setuptools build suite.

Looks like tox is not passing through PROGRAMFILES(x86) env variable and because of that distutils falls back to a vs2015 style registry key lookup and this registry key is not set in windows-2022 image.

Hi @isuruf, thank you very much for the tip.
I tried explicitly passing PROGRAMFILES and PROGRAMFILES(x86) via passenv configuration in tox.ini, but that does not seem to solve the problem: pypa/setuptools@89581b4

Looks like vswhere.exe needs PROGRAMDATA env variable passed through.

This workaround is great. Thanks for making it. I'm hoping that tox-dev/tox#2382 will help fix the issue at its core (rather than requiring every windows compiled package to patch tox config). If tox doesn't accept a solution, it might be necessary for Setuptools to work around the broken environment by digging into the registry and reconstructing the system environment.