diff options
author | Itamar Oren <itamarost@gmail.com> | 2024-01-03 17:30:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-03 17:30:20 (GMT) |
commit | 178919cf2132a67bc03ae5994769d93cfb7e2cd3 (patch) | |
tree | 5ae8a69dd193aead3de939ed1900ceb4c4c55b5a /Tools | |
parent | 7d01fb48089872155e1721ba0a8cc27ee5c4fecd (diff) | |
download | cpython-178919cf2132a67bc03ae5994769d93cfb7e2cd3.zip cpython-178919cf2132a67bc03ae5994769d93cfb7e2cd3.tar.gz cpython-178919cf2132a67bc03ae5994769d93cfb7e2cd3.tar.bz2 |
gh-113258: Write frozen modules to the build tree on Windows (GH-113303)
This ensures the source directory is not modified at build time, and different builds (e.g. different versions or GIL vs no-GIL) do not have conflicts.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/build/freeze_modules.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Tools/build/freeze_modules.py b/Tools/build/freeze_modules.py index 6a54f45..a541b4b 100644 --- a/Tools/build/freeze_modules.py +++ b/Tools/build/freeze_modules.py @@ -658,7 +658,7 @@ def regen_pcbuild(modules): filterlines = [] corelines = [] deepfreezemappingsfile = f'$(IntDir)\\{DEEPFREEZE_MAPPING_FNAME}' - deepfreezerules = [f' <Exec Command=\'$(PythonForBuild) "$(PySourcePath)Tools\\build\\deepfreeze.py" -f "{deepfreezemappingsfile}" -o "$(PySourcePath)Python\\deepfreeze\\deepfreeze.c"\' />'] + deepfreezerules = [f' <Exec Command=\'$(PythonForBuild) "$(PySourcePath)Tools\\build\\deepfreeze.py" -f "{deepfreezemappingsfile}" -o "$(GeneratedFrozenModulesDir)deepfreeze.c"\' />'] deepfreezemappings = [] for src in _iter_sources(modules): pyfile = relpath_for_windows_display(src.pyfile, ROOT_DIR) @@ -667,15 +667,15 @@ def regen_pcbuild(modules): projlines.append(f' <None Include="..\\{pyfile}">') projlines.append(f' <ModName>{src.frozenid}</ModName>') projlines.append(f' <IntFile>$(IntDir){intfile}</IntFile>') - projlines.append(f' <OutFile>$(PySourcePath){header}</OutFile>') + projlines.append(f' <OutFile>$(GeneratedFrozenModulesDir){header}</OutFile>') projlines.append(f' </None>') filterlines.append(f' <None Include="..\\{pyfile}">') filterlines.append(' <Filter>Python Files</Filter>') filterlines.append(' </None>') - deepfreezemappings.append(f' <FrozenModule Include="$(PySourcePath)\\{header}" FrozenId="{src.frozenid}" />\n') + deepfreezemappings.append(f' <FrozenModule Include="$(GeneratedFrozenModulesDir){header}" FrozenId="{src.frozenid}" />\n') - corelines.append(f' <ClCompile Include="..\\Python\\deepfreeze\\deepfreeze.c" />') + corelines.append(f' <ClCompile Include="$(GeneratedFrozenModulesDir)deepfreeze.c" />') print(f'# Updating {os.path.relpath(PCBUILD_PROJECT)}') with updating_file_with_tmpfile(PCBUILD_PROJECT) as (infile, outfile): |