8000 gh-115700: Add target `_RegenCases` in Windows build for cases regene… · python/cpython@a2bb8ad · GitHub
[go: up one dir, main page]

Skip to content

Commit a2bb8ad

Browse files
authored
gh-115700: Add target _RegenCases in Windows build for cases regeneration. (GH-115708)
1 parent 626c414 commit a2bb8ad

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The regen-cases build stage now works on Windows.

PCbuild/regen.targets

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@
3131
<!-- Taken from _Target._compute_digest in Tools\jit\_targets.py: -->
3232
<_JITSources Include="$(PySourcePath)Python\executor_cases.c.h;$(GeneratedPyConfigDir)pyconfig.h;$(PySourcePath)Tools\jit\**"/>
3333
<_JITOutputs Include="$(GeneratedPyConfigDir)jit_stencils.h"/>
34+
<_CasesSources Include="$(PySourcePath)Python\bytecodes.c;$(PySourcePath)Python\tier2_redundancy_eliminator_bytecodes.c;"/>
35+
<_CasesOutputs Include="$(PySourcePath)Python\generated_cases.c.h;$(PySourcePath)Include\opcode_ids.h;$(PySourcePath)Include\internal\pycore_uop_ids.h;$(PySourcePath)Python\opcode_targets.h;$(PySourcePath)Include\internal\pycore_opcode_metadata.h;$(PySourcePath)Include\internal\pycore_uop_metadata.h;$(PySourcePath)Python\tier2_redundancy_eliminator_cases.c.h;$(PySourcePath)Lib\_opcode_metadata.py"/>
3436
</ItemGroup>
3537

3638
<Target Name="_TouchRegenSources" Condition="$(ForceRegen) == 'true'">
3739
<Message Text="Touching source files to force regeneration" Importance="high" />
38-
<Touch Files="@(_PegenSources);@(_ASTSources);@(_TokenSources);@(_KeywordOutputs)"
40+
<Touch Files="@(_PegenSources);@(_ASTSources);@(_TokenSources);@(_KeywordOutputs);@(_CasesSources)"
3941
AlwaysCreate="False" />
4042
</Target>
4143

@@ -79,7 +81,31 @@
7981
<Exec Command="$(PythonForBuild) Tools\build\generate_global_objects.py"
8082
WorkingDirectory="$(PySourcePath)" />
8183
</Target>
82-
84+
85+
<Target Name="_RegenCases"
86+
Inputs="@(_CasesSources)" Outputs="@(_CasesOutputs)"
87+
DependsOnTargets="FindPythonForBuild">
88+
<Message Text="Regenerate cases" Importance="high" />
89+
<Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\opcode_id_generator.py $(PySourcePath)Python\bytecodes.c"
90+
WorkingDirectory="$(PySourcePath)" />
91+
<Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\target_generator.py $(PySourcePath)Python\bytecodes.c"
92+
WorkingDirectory="$(PySourcePath)" />
93+
<Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\uop_id_generator.py $(PySourcePath)Python\bytecodes.c"
94+
WorkingDirectory="$(PySourcePath)" />
95+
<Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\py_metadata_generator.py $(PySourcePath)Python\bytecodes.c"
96+
WorkingDirectory="$(PySourcePath)" />
97+
<Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\tier1_generator.py $(PySourcePath)Python\bytecodes.c"
98+
WorkingDirectory="$(PySourcePath)" />
99+
<Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\tier2_generator.py $(PySourcePath)Python\bytecodes.c"
100+
WorkingDirectory="$(PySourcePath)" />
101+
<Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\tier2_abstract_generator.py $(PySourcePath)Python\tier2_redundancy_eliminator_bytecodes.c $(PySourcePath)Python\bytecodes.c"
102+
WorkingDirectory="$(PySourcePath)" />
103+
<Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\opcode_metadata_generator.py $(PySourcePath)Python\bytecodes.c"
104+
WorkingDirectory="$(PySourcePath)" />
105+
<Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\uop_metadata_generator.py $(PySourcePath)Python\bytecodes.c"
106+
WorkingDirectory="$(PySourcePath)" />
107+
</Target>
108+
83109
<Target Name="_RegenJIT"
84110
Condition="'$(UseJIT)' == 'true'"
85111
DependsOnTargets="_UpdatePyconfig;FindPythonForBuild"
@@ -100,7 +126,7 @@
100126
DependsOnTargets="_TouchRegenSources;_RegenPegen;_RegenAST_H;_RegenTokens;_RegenKeywords;_RegenGlobalObjects">
101127
</Target>
102128

103-
<Target Name="Regen" DependsOnTargets="_RegenNoPGUpdate;_RegenJIT">
129+
<Target Name="Regen" DependsOnTargets="_RegenNoPGUpdate;_RegenJIT;_RegenCases">
104130
<Message Text="Generated sources are up to date" Importance="high" />
105131
</Target>
106132

0 commit comments

Comments
 (0)
0