Commit d3535fc2 authored by Chad Austin's avatar Chad Austin Committed by Facebook GitHub Bot

fix 'error: Microsoft Visual C++ 14.0 is required' red herring on GitHub Actions (#998)

Summary:
Pull Request resolved: https://github.com/facebook/watchman/pull/998

A detailed description of this change is included in the new comment.

Reviewed By: fanzeyi

Differential Revision: D34124030

fbshipit-source-id: f37c458bae135357e16b256e09f0d6eb8f1f996d
parent 6b9d840a
......@@ -205,6 +205,31 @@ class BuildOptions(object):
env["GETDEPS_BUILD_DIR"] = os.path.join(self.scratch_dir, "build")
env["GETDEPS_INSTALL_DIR"] = self.install_dir
# Python setuptools attempts to discover a local MSVC for
# building Python extensions. On Windows, getdeps already
# supports invoking a vcvarsall prior to compilation.
#
# Tell setuptools to bypass its own search. This fixes a bug
# where setuptools would fail when run from CMake on GitHub
# Actions with the inscrutable message 'error: Microsoft
# Visual C++ 14.0 is required. Get it with "Build Tools for
# Visual Studio"'. I suspect the actual error is that the
# environment or PATH is overflowing.
#
# For extra credit, someone could patch setuptools to
# propagate the actual error message from vcvarsall, because
# often it does not mean Visual C++ is not available.
#
# Related discussions:
# - https://github.com/pypa/setuptools/issues/2028
# - https://github.com/pypa/setuptools/issues/2307
# - https://developercommunity.visualstudio.com/t/error-microsoft-visual-c-140-is-required/409173
# - https://github.com/OpenMS/OpenMS/pull/4779
# - https://github.com/actions/virtual-environments/issues/1484
if self.is_windows() and self.get_vcvars_path():
env["DISTUTILS_USE_SDK"] = "1"
# On macOS we need to set `SDKROOT` when we use clang for system
# header files.
if self.is_darwin() and "SDKROOT" not in env:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment