From: Steve Dower Date: Wed, 8 Dec 2021 02:18:21 +0000 (+0000) Subject: bpo-45582: Write empty pybuilddir.txt on Windows to allow relocatable build directori... X-Git-Tag: v3.11.0a3~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b0b30862796e97b3f0ee358bcc61d21f0cc98441;p=thirdparty%2FPython%2Fcpython.git bpo-45582: Write empty pybuilddir.txt on Windows to allow relocatable build directories (GH-29979) --- diff --git a/Modules/getpath.py b/Modules/getpath.py index 4ef49a8847dd..6a13e232ec3e 100644 --- a/Modules/getpath.py +++ b/Modules/getpath.py @@ -449,6 +449,10 @@ if not home_was_set and real_executable_dir and not py_setpath: readlines(joinpath(real_executable_dir, BUILDDIR_TXT))[0], ) build_prefix = joinpath(real_executable_dir, VPATH) + except IndexError: + # File exists but is empty + platstdlib_dir = real_executable_dir + build_prefix = joinpath(real_executable_dir, VPATH) except FileNotFoundError: if isfile(joinpath(real_executable_dir, BUILD_LANDMARK)): build_prefix = joinpath(real_executable_dir, VPATH) diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 0eaeb6b1229a..bbcabb5cdb40 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -73,7 +73,7 @@ PGInstrument PGUpdate advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;%(AdditionalDependencies) - /OPT:REF,NOICF /CGTHREADS:1 /PDBTHREADS:1 %(AdditionalOptions) + /OPT:REF,NOICF %(AdditionalOptions) true diff --git a/PCbuild/python.vcxproj b/PCbuild/python.vcxproj index 0b4329dd0763..f44513702879 100644 --- a/PCbuild/python.vcxproj +++ b/PCbuild/python.vcxproj @@ -148,10 +148,6 @@ $(_PGOPath) - - <_Content>$(OutDir) - <_ExistingContent Condition="Exists('$(OutDir)pybuilddir.txt')">$([System.IO.File]::ReadAllText('$(OutDir)pybuilddir.txt')) - - +