diff options
author | Steve Dower <steve.dower@python.org> | 2021-12-08 02:18:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-08 02:18:21 (GMT) |
commit | b0b30862796e97b3f0ee358bcc61d21f0cc98441 (patch) | |
tree | b469f6d3faa7f9e69cdb4114f7ddabf2157c319f | |
parent | 32a67246b0d1e08cd50fc3bfa58052cfeb515b2e (diff) | |
download | cpython-b0b30862796e97b3f0ee358bcc61d21f0cc98441.zip cpython-b0b30862796e97b3f0ee358bcc61d21f0cc98441.tar.gz cpython-b0b30862796e97b3f0ee358bcc61d21f0cc98441.tar.bz2 |
bpo-45582: Write empty pybuilddir.txt on Windows to allow relocatable build directories (GH-29979)
-rw-r--r-- | Modules/getpath.py | 4 | ||||
-rw-r--r-- | PCbuild/pyproject.props | 2 | ||||
-rw-r--r-- | PCbuild/python.vcxproj | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/Modules/getpath.py b/Modules/getpath.py index 4ef49a8..6a13e23 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 0eaeb6b..bbcabb5 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -73,7 +73,7 @@ <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGInstrument'">PGInstrument</LinkTimeCodeGeneration> <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">PGUpdate</LinkTimeCodeGeneration> <AdditionalDependencies>advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalOptions Condition="$(Configuration) != 'Debug'">/OPT:REF,NOICF /CGTHREADS:1 /PDBTHREADS:1 %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions Condition="$(Configuration) != 'Debug'">/OPT:REF,NOICF %(AdditionalOptions)</AdditionalOptions> </Link> <Lib> <LinkTimeCodeGeneration Condition="$(Configuration) == 'Release'">true</LinkTimeCodeGeneration> diff --git a/PCbuild/python.vcxproj b/PCbuild/python.vcxproj index 0b4329d..f445137 100644 --- a/PCbuild/python.vcxproj +++ b/PCbuild/python.vcxproj @@ -148,10 +148,6 @@ $(_PGOPath) <WriteLinesToFile File="$(PySourcePath)python.bat" Lines="$(_Content)" Overwrite="true" Condition="'$(_Content)' != '$(_ExistingContent)'" /> </Target> <Target Name="GeneratePyBuildDirTxt" BeforeTargets="AfterBuild"> - <PropertyGroup> - <_Content>$(OutDir)</_Content> - <_ExistingContent Condition="Exists('$(OutDir)pybuilddir.txt')">$([System.IO.File]::ReadAllText('$(OutDir)pybuilddir.txt'))</_ExistingContent> - </PropertyGroup> - <WriteLinesToFile File="$(OutDir)pybuilddir.txt" Lines="$(_Content)" Overwrite="true" Condition="'$(_Content)' != '$(_ExistingContent)'" /> + <WriteLinesToFile File="$(OutDir)pybuilddir.txt" Lines="" Overwrite="true" /> </Target> </Project> |