Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 45bc17b

Browse files
committed
Issue #19962: The Windows build process now creates "python.bat"
in the root of the source tree, which passes all arguments through to the most recently built interpreter.
1 parent b151f8f commit 45bc17b

3 files changed

Lines changed: 166 additions & 1 deletion

File tree

.hgignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ db_home
1818
platform$
1919
pyconfig.h$
2020
python$
21+
python.bat$
2122
python.exe$
2223
python-config$
2324
python-config.py$

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ IDLE
322322
Build
323323
-----
324324

325+
- Issue #19962: The Windows build process now creates "python.bat" in the
326+
root of the source tree, which passes all arguments through to the most
327+
recently built interpreter.
328+
325329
- Issue #21285: Refactor and fix curses configure check to always search
326330
in a ncursesw directory.
327331

PCbuild/python.vcxproj

Lines changed: 161 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@
156156
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
157157
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
158158
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
159+
<CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Link</CustomBuildAfterTargets>
160+
<CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Link</CustomBuildAfterTargets>
161+
<CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">Link</CustomBuildAfterTargets>
162+
<CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'">Link</CustomBuildAfterTargets>
163+
<CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">Link</CustomBuildAfterTargets>
164+
<CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'">Link</CustomBuildAfterTargets>
165+
<CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Link</CustomBuildAfterTargets>
166+
<CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Link</CustomBuildAfterTargets>
159167
</PropertyGroup>
160168
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
161169
<ClCompile>
@@ -176,6 +184,25 @@
176184
<StackReserveSize>2000000</StackReserveSize>
177185
<BaseAddress>0x1d000000</BaseAddress>
178186
</Link>
187+
<CustomBuildStep>
188+
<Command>echo @rem This script invokes the most recently built Python with all arguments&gt; "$(SolutionDir)..\python.bat"
189+
echo @rem passed through to the interpreter. This file is generated by the&gt;&gt; "$(SolutionDir)..\python.bat"
190+
echo @rem build process and any changes *will* be thrown away by the next&gt;&gt; "$(SolutionDir)..\python.bat"
191+
echo @rem rebuild.&gt;&gt; "$(SolutionDir)..\python.bat"
192+
echo @rem This is only meant as a convenience for developing CPython&gt;&gt; "$(SolutionDir)..\python.bat"
193+
echo @rem and using it outside of that context is ill-advised.&gt;&gt; "$(SolutionDir)..\python.bat"
194+
echo @echo Running $(Configuration)^^^|$(Platform) interpreter...&gt;&gt; "$(SolutionDir)..\python.bat"
195+
echo @"$(OutDir)python$(PyDebugExt).exe" %%*&gt;&gt; "$(SolutionDir)..\python.bat"</Command>
196+
</CustomBuildStep>
197+
<CustomBuildStep>
198+
<Message>Creating convenience batch file for easily invoking the newly built interpreter.</Message>
199+
</CustomBuildStep>
200+
<CustomBuildStep>
201+
<Outputs>$(SolutionDir)..\python.bat</Outputs>
202+
</CustomBuildStep>
203+
<CustomBuildStep>
204+
<Inputs>$(OutDir)python$(PyDebugExt).exe;%(Inputs)</Inputs>
205+
</CustomBuildStep>
179206
</ItemDefinitionGroup>
180207
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
181208
<Midl>
@@ -199,6 +226,25 @@
199226
<StackReserveSize>2000000</StackReserveSize>
200227
<BaseAddress>0x1d000000</BaseAddress>
201228
</Link>
229+
<CustomBuildStep>
230+
<Command>echo @rem This script invokes the most recently built Python with all arguments&gt; "$(SolutionDir)..\python.bat"
231+
echo @rem passed through to the interpreter. This file is generated by the&gt;&gt; "$(SolutionDir)..\python.bat"
232+
echo @rem build process and any changes *will* be thrown away by the next&gt;&gt; "$(SolutionDir)..\python.bat"
233+
echo @rem rebuild.&gt;&gt; "$(SolutionDir)..\python.bat"
234+
echo @rem This is only meant as a convenience for developing CPython&gt;&gt; "$(SolutionDir)..\python.bat"
235+
echo @rem and using it outside of that context is ill-advised.&gt;&gt; "$(SolutionDir)..\python.bat"
236+
echo @echo Running $(Configuration)^^^|$(Platform) interpreter...&gt;&gt; "$(SolutionDir)..\python.bat"
237+
echo @"$(OutDir)python$(PyDebugExt).exe" %%*&gt;&gt; "$(SolutionDir)..\python.bat"</Command>
238+
</CustomBuildStep>
239+
<CustomBuildStep>
240+
<Message>Creating convenience batch file for easily invoking the newly built interpreter.</Message>
241+
</CustomBuildStep>
242+
<CustomBuildStep>
243+
<Outputs>$(SolutionDir)..\python.bat</Outputs>
244+
</CustomBuildStep>
245+
<CustomBuildStep>
246+
<Inputs>$(OutDir)python$(PyDebugExt).exe;%(Inputs)</Inputs>
247+
</CustomBuildStep>
202248
</ItemDefinitionGroup>
203249
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
204250
<ClCompile>
@@ -221,6 +267,25 @@
221267
<StackReserveSize>2000000</StackReserveSize>
222268
<BaseAddress>0x1d000000</BaseAddress>
223269
</Link>
270+
<CustomBuildStep>
271+
<Command>echo @rem This script invokes the most recently built Python with all arguments&gt; "$(SolutionDir)..\python.bat"
272+
echo @rem passed through to the interpreter. This file is generated by the&gt;&gt; "$(SolutionDir)..\python.bat"
273+
echo @rem build process and any changes *will* be thrown away by the next&gt;&gt; "$(SolutionDir)..\python.bat"
274+
echo @rem rebuild.&gt;&gt; "$(SolutionDir)..\python.bat"
275+
echo @rem This is only meant as a convenience for developing CPython&gt;&gt; "$(SolutionDir)..\python.bat"
276+
echo @rem and using it outside of that context is ill-advised.&gt;&gt; "$(SolutionDir)..\python.bat"
277+
echo @echo Running $(Configuration)^^^|$(Platform) interpreter...&gt;&gt; "$(SolutionDir)..\python.bat"
278+
echo @"$(OutDir)python$(PyDebugExt).exe" %%*&gt;&gt; "$(SolutionDir)..\python.bat"</Command>
279+
</CustomBuildStep>
280+
<CustomBuildStep>
281+
<Message>Creating convenience batch file for easily invoking the newly built interpreter.</Message>
282+
</CustomBuildStep>
283+
<CustomBuildStep>
284+
<Outputs>$(SolutionDir)..\python.bat</Outputs>
285+
</CustomBuildStep>
286+
<CustomBuildStep>
287+
<Inputs>$(OutDir)python$(PyDebugExt).exe;%(Inputs)</Inputs>
288+
</CustomBuildStep>
224289
</ItemDefinitionGroup>
225290
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
226291
<Midl>
@@ -246,6 +311,25 @@
246311
<StackReserveSize>4194304</StackReserveSize>
247312
<BaseAddress>0x1d000000</BaseAddress>
248313
</Link>
314+
<CustomBuildStep>
315+
<Command>echo @rem This script invokes the most recently built Python with all arguments&gt; "$(SolutionDir)..\python.bat"
316+
echo @rem passed through to the interpreter. This file is generated by the&gt;&gt; "$(SolutionDir)..\python.bat"
317+
echo @rem build process and any changes *will* be thrown away by the next&gt;&gt; "$(SolutionDir)..\python.bat"
318+
echo @rem rebuild.&gt;&gt; "$(SolutionDir)..\python.bat"
319+
echo @rem This is only meant as a convenience for developing CPython&gt;&gt; "$(SolutionDir)..\python.bat"
320+
echo @rem and using it outside of that context is ill-advised.&gt;&gt; "$(SolutionDir)..\python.bat"
321+
echo @echo Running $(Configuration)^^^|$(Platform) interpreter...&gt;&gt; "$(SolutionDir)..\python.bat"
322+
echo @"$(OutDir)python$(PyDebugExt).exe" %%*&gt;&gt; "$(SolutionDir)..\python.bat"</Command>
323+
</CustomBuildStep>
324+
<CustomBuildStep>
325+
<Message>Creating convenience batch file for easily invoking the newly built interpreter.</Message>
326+
</CustomBuildStep>
327+
<CustomBuildStep>
328+
<Outputs>$(SolutionDir)..\python.bat</Outputs>
329+
</CustomBuildStep>
330+
<CustomBuildStep>
331+
<Inputs>$(OutDir)python$(PyDebugExt).exe;%(Inputs)</Inputs>
332+
</CustomBuildStep>
249333
</ItemDefinitionGroup>
250334
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
251335
<ClCompile>
@@ -268,6 +352,25 @@
268352
<ImportLibrary>
269353
</ImportLibrary>
270354
</Link>
355+
<CustomBuildStep>
356+
<Command>echo @rem This script invokes the most recently built Python with all arguments&gt; "$(SolutionDir)..\python.bat"
357+
echo @rem passed through to the interpreter. This file is generated by the&gt;&gt; "$(SolutionDir)..\python.bat"
358+
echo @rem build process and any changes *will* be thrown away by the next&gt;&gt; "$(SolutionDir)..\python.bat"
359+
echo @rem rebuild.&gt;&gt; "$(SolutionDir)..\python.bat"
360+
echo @rem This is only meant as a convenience for developing CPython&gt;&gt; "$(SolutionDir)..\python.bat"
361+
echo @rem and using it outside of that context is ill-advised.&gt;&gt; "$(SolutionDir)..\python.bat"
362+
echo @echo Running $(Configuration)^^^|$(Platform) interpreter...&gt;&gt; "$(SolutionDir)..\python.bat"
363+
echo @"$(OutDir)python$(PyDebugExt).exe" %%*&gt;&gt; "$(SolutionDir)..\python.bat"</Command>
364+
</CustomBuildStep>
365+
<CustomBuildStep>
366+
<Message>Creating convenience batch file for easily invoking the newly built interpreter.</Message>
367+
</CustomBuildStep>
368+
<CustomBuildStep>
369+
<Outputs>$(SolutionDir)..\python.bat</Outputs>
370+
</CustomBuildStep>
371+
<CustomBuildStep>
372+
<Inputs>$(OutDir)python$(PyDebugExt).exe;%(Inputs)</Inputs>
373+
</CustomBuildStep>
271374
</ItemDefinitionGroup>
272375
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'">
273376
<Midl>
@@ -294,6 +397,25 @@
294397
</ImportLibrary>
295398
<TargetMachine>MachineX64</TargetMachine>
296399
</Link>
400+
<CustomBuildStep>
401+
<Command>echo @rem This script invokes the most recently built Python with all arguments&gt; "$(SolutionDir)..\python.bat"
402+
echo @rem passed through to the interpreter. This file is generated by the&gt;&gt; "$(SolutionDir)..\python.bat"
403+
echo @rem build process and any changes *will* be thrown away by the next&gt;&gt; "$(SolutionDir)..\python.bat"
404+
echo @rem rebuild.&gt;&gt; "$(SolutionDir)..\python.bat"
405+
echo @rem This is only meant as a convenience for developing CPython&gt;&gt; "$(SolutionDir)..\python.bat"
406+
echo @rem and using it outside of that context is ill-advised.&gt;&gt; "$(SolutionDir)..\python.bat"
407+
echo @echo Running $(Configuration)^^^|$(Platform) interpreter...&gt;&gt; "$(SolutionDir)..\python.bat"
408+
echo @"$(OutDir)python$(PyDebugExt).exe" %%*&gt;&gt; "$(SolutionDir)..\python.bat"</Command>
409+
</CustomBuildStep>
410+
<CustomBuildStep>
411+
<Message>Creating convenience batch file for easily invoking the newly built interpreter.</Message>
412+
</CustomBuildStep>
413+
<CustomBuildStep>
414+
<Outputs>$(SolutionDir)..\python.bat</Outputs>
415+
</CustomBuildStep>
416+
<CustomBuildStep>
417+
<Inputs>$(OutDir)python$(PyDebugExt).exe;%(Inputs)</Inputs>
418+
</CustomBuildStep>
297419
</ItemDefinitionGroup>
298420
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
299421
<ClCompile>
@@ -316,6 +438,25 @@
316438
<ImportLibrary>
317439
</ImportLibrary>
318440
</Link>
441+
<CustomBuildStep>
442+
<Command>echo @rem This script invokes the most recently built Python with all arguments&gt; "$(SolutionDir)..\python.bat"
443+
echo @rem passed through to the interpreter. This file is generated by the&gt;&gt; "$(SolutionDir)..\python.bat"
444+
echo @rem build process and any changes *will* be thrown away by the next&gt;&gt; "$(SolutionDir)..\python.bat"
445+
echo @rem rebuild.&gt;&gt; "$(SolutionDir)..\python.bat"
446+
echo @rem This is only meant as a convenience for developing CPython&gt;&gt; "$(SolutionDir)..\python.bat"
447+
echo @rem and using it outside of that context is ill-advised.&gt;&gt; "$(SolutionDir)..\python.bat"
448+
echo @echo Running $(Configuration)^^^|$(Platform) interpreter...&gt;&gt; "$(SolutionDir)..\python.bat"
449+
echo @"$(OutDir)python$(PyDebugExt).exe" %%*&gt;&gt; "$(SolutionDir)..\python.bat"</Command>
450+
</CustomBuildStep>
451+
<CustomBuildStep>
452+
<Message>Creating convenience batch file for easily invoking the newly built interpreter.</Message>
453+
</CustomBuildStep>
454+
<CustomBuildStep>
455+
<Outputs>$(SolutionDir)..\python.bat</Outputs>
456+
</CustomBuildStep>
457+
<CustomBuildStep>
458+
<Inputs>$(OutDir)python$(PyDebugExt).exe;%(Inputs)</Inputs>
459+
</CustomBuildStep>
319460
</ItemDefinitionGroup>
320461
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'">
321462
<Midl>
@@ -342,6 +483,25 @@
342483
</ImportLibrary>
343484
<TargetMachine>MachineX64</TargetMachine>
344485
</Link>
486+
<CustomBuildStep>
487+
<Command>echo @rem This script invokes the most recently built Python with all arguments&gt; "$(SolutionDir)..\python.bat"
488+
echo @rem passed through to the interpreter. This file is generated by the&gt;&gt; "$(SolutionDir)..\python.bat"
489+
echo @rem build process and any changes *will* be thrown away by the next&gt;&gt; "$(SolutionDir)..\python.bat"
490+
echo @rem rebuild.&gt;&gt; "$(SolutionDir)..\python.bat"
491+
echo @rem This is only meant as a convenience for developing CPython&gt;&gt; "$(SolutionDir)..\python.bat"
492+
echo @rem and using it outside of that context is ill-advised.&gt;&gt; "$(SolutionDir)..\python.bat"
493+
echo @echo Running $(Configuration)^^^|$(Platform) interpreter...&gt;&gt; "$(SolutionDir)..\python.bat"
494+
echo @"$(OutDir)python$(PyDebugExt).exe" %%*&gt;&gt; "$(SolutionDir)..\python.bat"</Command>
495+
</CustomBuildStep>
496+
<CustomBuildStep>
497+
<Message>Creating convenience batch file for easily invoking the newly built interpreter.</Message>
498+
</CustomBuildStep>
499+
<CustomBuildStep>
500+
<Outputs>$(SolutionDir)..\python.bat</Outputs>
501+
</CustomBuildStep>
502+
<CustomBuildStep>
503+
<Inputs>$(OutDir)python$(PyDebugExt).exe;%(Inputs)</Inputs>
504+
</CustomBuildStep>
345505
</ItemDefinitionGroup>
346506
<ItemGroup>
347507
<None Include="..\PC\pycon.ico" />
@@ -361,4 +521,4 @@
361521
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
362522
<ImportGroup Label="ExtensionTargets">
363523
</ImportGroup>
364-
</Project>
524+
</Project>

0 commit comments

Comments
 (0)