build: make Windows OSS build work again with Python 3.10

Summary: Recently we changed the way we pick the preferred Python version. This affected parts of our OSS build, which this diff fixes.

Reviewed By: muirdm

Differential Revision: D49612380

fbshipit-source-id: ea39893f992025c2ad97c24eff03bc5dfe7b2581
This commit is contained in:
Saul Gutierrez 2023-09-25 16:02:21 -07:00 committed by Facebook GitHub Bot
parent 5dd8a7b26a
commit a1e038b1c9

View File

@ -44,6 +44,14 @@ def main(args):
paths = [os.path.join(d, name) for d in dirs]
for path in paths:
if does_python_look_good(path):
if os.name == "nt":
# This is a workaround for an issue with make.exe on Windows.
# On some of our Makefile targets (e.g., oss, oss-install) we set up environment variables.
# If environment variables are not set, backward slashes will be interpreted as such.
# e.g., having a make target that runs something like `FOO=bar echo c:\baz`
# will print `c:baz`, whereas having a target like `echo c:\baz` will print
# `c:\baz`.
path = path.replace("\\", "/")
print(path)
return