Skip to content

Commit e3c5856

Browse files
committed
Cut down on repetitive logic, reorder parameters
1 parent 0354314 commit e3c5856

2 files changed

Lines changed: 44 additions & 126 deletions

File tree

windows-release/azure-pipelines.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ parameters:
4141
displayName: "Signature description"
4242
type: string
4343
default: '(default)'
44+
- name: DoJIT
45+
displayName: "Build the JIT compiler (3.14 and later)"
46+
type: boolean
47+
default: false
4448
- name: DoGPG
4549
displayName: "Include GPG signatures (3.13 and earlier)"
4650
type: boolean
@@ -49,18 +53,6 @@ parameters:
4953
displayName: "Include free-threaded builds (3.13 and later)"
5054
type: boolean
5155
default: true
52-
- name: DoJIT
53-
displayName: "Build the JIT compiler (3.14 and later)"
54-
type: boolean
55-
default: false
56-
- name: DoJITEnabled
57-
displayName: "Enable the JIT compiler by default (not used yet)"
58-
type: boolean
59-
default: false
60-
- name: DoJITFreethreaded
61-
displayName: "Build the JIT compiler for free-threaded builds (not used yet)"
62-
type: boolean
63-
default: false
6456
- name: DoARM64
6557
displayName: "Publish ARM64 build (3.11 and later)"
6658
type: boolean
@@ -111,6 +103,14 @@ parameters:
111103
displayName: "Enable Nuget signing (not recommended right now)"
112104
type: boolean
113105
default: false
106+
- name: DoJITEnabled
107+
displayName: "Enable the JIT compiler by default (not used yet)"
108+
type: boolean
109+
default: false
110+
- name: DoJITFreethreaded
111+
displayName: "Build the JIT compiler for free-threaded builds (not used yet)"
112+
type: boolean
113+
default: false
114114

115115
resources:
116116
pipelines:
@@ -149,13 +149,22 @@ stages:
149149
- template: stage-build.yml
150150
parameters:
151151
DoFreethreaded: ${{ parameters.DoFreethreaded }}
152-
DoJIT: ${{ parameters.DoJIT }}
153-
DoJITEnabled: ${{ parameters.DoJITEnabled }}
154-
DoJITFreethreaded: ${{ parameters.DoJITFreethreaded }}
155152
DoPGO: ${{ parameters.DoPGO }}
156153
DoPGOARM64: ${{ parameters.DoPGOARM64 }}
157154
${{ if and(parameters.SigningCertificate, ne(parameters.SigningCertificate, 'Unsigned')) }}:
158155
ToBeSigned: true
156+
${{ if ne(parameters.DoJIT, 'true') }}:
157+
JITOption: ''
158+
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
159+
JITOption: '--experimental-jit-off'
160+
${{ else }}:
161+
JITOption: '--experimental-jit'
162+
${{ if or(ne(parameters.DoJIT, 'true'), ne(parameters.DoJITFreethreaded, 'true')) }}:
163+
JITOptionFreethreaded: ''
164+
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
165+
JITOptionFreethreaded: '--experimental-jit-off'
166+
${{ else }}:
167+
JITOptionFreethreaded: '--experimental-jit'
159168

160169
- stage: Sign
161170
displayName: Sign binaries

windows-release/stage-build.yml

Lines changed: 20 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ parameters:
44
DoPGOARM64: true
55
DoFreethreaded: false
66
ToBeSigned: false
7-
DoJIT: false
8-
DoJITEnabled: false
9-
DoJITFreethreaded: false
7+
JITOption: ''
8+
JITOptionFreethreaded: ''
109

1110
jobs:
1211
- job: Build_Docs
@@ -55,12 +54,7 @@ jobs:
5554
Platform: x86
5655
Configuration: Release
5756
_HostPython: .\python
58-
${{ if ne(parameters.DoJIT, 'true') }}:
59-
ExtraOptions: ''
60-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
61-
ExtraOptions: '--experimental-jit-off'
62-
${{ else }}:
63-
ExtraOptions: '--experimental-jit'
57+
ExtraOptions: ${{ parameters.JITOption }}
6458
${{ if eq(parameters.ToBeSigned, 'true') }}:
6559
Artifact: unsigned_win32
6660
${{ else }}:
@@ -71,12 +65,7 @@ jobs:
7165
Platform: x86
7266
Configuration: Debug
7367
_HostPython: .\python
74-
${{ if ne(parameters.DoJIT, 'true') }}:
75-
ExtraOptions: ''
76-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
77-
ExtraOptions: '--experimental-jit-off'
78-
${{ else }}:
79-
ExtraOptions: '--experimental-jit'
68+
ExtraOptions: ${{ parameters.JITOption }}
8069
Artifact: bin_win32_d
8170
${{ if ne(parameters.DoPGO, 'true') }}:
8271
amd64:
@@ -85,12 +74,7 @@ jobs:
8574
Platform: x64
8675
Configuration: Release
8776
_HostPython: .\python
88-
${{ if ne(parameters.DoJIT, 'true') }}:
89-
ExtraOptions: ''
90-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
91-
ExtraOptions: '--experimental-jit-off'
92-
${{ else }}:
93-
ExtraOptions: '--experimental-jit'
77+
ExtraOptions: ${{ parameters.JITOption }}
9478
${{ if eq(parameters.ToBeSigned, 'true') }}:
9579
Artifact: unsigned_amd64
9680
${{ else }}:
@@ -101,12 +85,7 @@ jobs:
10185
Platform: x64
10286
Configuration: Debug
10387
_HostPython: .\python
104-
${{ if ne(parameters.DoJIT, 'true') }}:
105-
ExtraOptions: ''
106-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
107-
ExtraOptions: '--experimental-jit-off'
108-
${{ else }}:
109-
ExtraOptions: '--experimental-jit'
88+
ExtraOptions: ${{ parameters.JITOption }}
11089
Artifact: bin_amd64_d
11190
${{ if or(ne(parameters.DoPGO, 'true'), ne(parameters.DoPGOARM64, 'true')) }}:
11291
arm64:
@@ -115,12 +94,7 @@ jobs:
11594
Platform: ARM64
11695
Configuration: Release
11796
_HostPython: python
118-
${{ if ne(parameters.DoJIT, 'true') }}:
119-
ExtraOptions: ''
120-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
121-
ExtraOptions: '--experimental-jit-off'
122-
${{ else }}:
123-
ExtraOptions: '--experimental-jit'
97+
ExtraOptions: ${{ parameters.JITOption }}
12498
${{ if eq(parameters.ToBeSigned, 'true') }}:
12599
Artifact: unsigned_arm64
126100
${{ else }}:
@@ -131,12 +105,7 @@ jobs:
131105
Platform: ARM64
132106
Configuration: Debug
133107
_HostPython: python
134-
${{ if ne(parameters.DoJIT, 'true') }}:
135-
ExtraOptions: ''
136-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
137-
ExtraOptions: '--experimental-jit-off'
138-
${{ else }}:
139-
ExtraOptions: '--experimental-jit'
108+
ExtraOptions: ${{ parameters.JITOption }}
140109
Artifact: bin_arm64_d
141110
${{ if eq(parameters.DoFreethreaded, 'true') }}:
142111
win32_t:
@@ -145,12 +114,7 @@ jobs:
145114
Platform: x86
146115
Configuration: Release
147116
_HostPython: .\python
148-
${{ if or(ne(parameters.DoJIT, 'true'), ne(parameters.DoJITFreethreaded, 'true')) }}:
149-
ExtraOptions: '--disable-gil'
150-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
151-
ExtraOptions: '--disable-gil --experimental-jit-off'
152-
${{ else }}:
153-
ExtraOptions: '--disable-gil --experimental-jit'
117+
ExtraOptions: '--disable-gil ${{ parameters.JITOptionFreethreaded }}'
154118
${{ if eq(parameters.ToBeSigned, 'true') }}:
155119
Artifact: unsigned_win32_t
156120
${{ else }}:
@@ -161,12 +125,7 @@ jobs:
161125
Platform: x86
162126
Configuration: Debug
163127
_HostPython: .\python
164-
${{ if or(ne(parameters.DoJIT, 'true'), ne(parameters.DoJITFreethreaded, 'true')) }}:
165-
ExtraOptions: '--disable-gil'
166-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
167-
ExtraOptions: '--disable-gil --experimental-jit-off'
168-
${{ else }}:
169-
ExtraOptions: '--disable-gil --experimental-jit'
128+
ExtraOptions: '--disable-gil ${{ parameters.JITOptionFreethreaded }}'
170129
Artifact: bin_win32_td
171130
${{ if ne(parameters.DoPGO, 'true') }}:
172131
amd64_t:
@@ -175,12 +134,7 @@ jobs:
175134
Platform: x64
176135
Configuration: Release
177136
_HostPython: .\python
178-
${{ if or(ne(parameters.DoJIT, 'true'), ne(parameters.DoJITFreethreaded, 'true')) }}:
179-
ExtraOptions: '--disable-gil'
180-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
181-
ExtraOptions: '--disable-gil --experimental-jit-off'
182-
${{ else }}:
183-
ExtraOptions: '--disable-gil --experimental-jit'
137+
ExtraOptions: '--disable-gil ${{ parameters.JITOptionFreethreaded }}'
184138
${{ if eq(parameters.ToBeSigned, 'true') }}:
185139
Artifact: unsigned_amd64_t
186140
${{ else }}:
@@ -191,12 +145,7 @@ jobs:
191145
Platform: x64
192146
Configuration: Debug
193147
_HostPython: .\python
194-
${{ if or(ne(parameters.DoJIT, 'true'), ne(parameters.DoJITFreethreaded, 'true')) }}:
195-
ExtraOptions: '--disable-gil'
196-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
197-
ExtraOptions: '--disable-gil --experimental-jit-off'
198-
${{ else }}:
199-
ExtraOptions: '--disable-gil --experimental-jit'
148+
ExtraOptions: '--disable-gil ${{ parameters.JITOptionFreethreaded }}'
200149
Artifact: bin_amd64_td
201150
${{ if or(ne(parameters.DoPGO, 'true'), ne(parameters.DoPGOARM64, 'true')) }}:
202151
arm64_t:
@@ -205,12 +154,7 @@ jobs:
205154
Platform: ARM64
206155
Configuration: Release
207156
_HostPython: python
208-
${{ if or(ne(parameters.DoJIT, 'true'), ne(parameters.DoJITFreethreaded, 'true')) }}:
209-
ExtraOptions: '--disable-gil'
210-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
211-
ExtraOptions: '--disable-gil --experimental-jit-off'
212-
${{ else }}:
213-
ExtraOptions: '--disable-gil --experimental-jit'
157+
ExtraOptions: '--disable-gil ${{ parameters.JITOptionFreethreaded }}'
214158
${{ if eq(parameters.ToBeSigned, 'true') }}:
215159
Artifact: unsigned_arm64_t
216160
${{ else }}:
@@ -221,12 +165,7 @@ jobs:
221165
Platform: ARM64
222166
Configuration: Debug
223167
_HostPython: python
224-
${{ if or(ne(parameters.DoJIT, 'true'), ne(parameters.DoJITFreethreaded, 'true')) }}:
225-
ExtraOptions: '--disable-gil'
226-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
227-
ExtraOptions: '--disable-gil --experimental-jit-off'
228-
${{ else }}:
229-
ExtraOptions: '--disable-gil --experimental-jit'
168+
ExtraOptions: '--disable-gil ${{ parameters.JITOptionFreethreaded }}'
230169
Artifact: bin_arm64_td
231170

232171
steps:
@@ -251,12 +190,7 @@ jobs:
251190
Platform: x64
252191
_HostPython: .\python
253192
PythonExePattern: python.exe
254-
${{ if ne(parameters.DoJIT, 'true') }}:
255-
ExtraOptions: ''
256-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
257-
ExtraOptions: '--experimental-jit-off'
258-
${{ else }}:
259-
ExtraOptions: '--experimental-jit'
193+
ExtraOptions: ${{ parameters.JITOption }}
260194
${{ if eq(parameters.ToBeSigned, 'true') }}:
261195
Artifact: unsigned_amd64
262196
${{ else }}:
@@ -268,12 +202,7 @@ jobs:
268202
Platform: x64
269203
_HostPython: .\python
270204
PythonExePattern: python3*t.exe
271-
${{ if or(ne(parameters.DoJIT, 'true'), ne(parameters.DoJITFreethreaded, 'true')) }}:
272-
ExtraOptions: '--disable-gil'
273-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
274-
ExtraOptions: '--disable-gil --experimental-jit-off'
275-
${{ else }}:
276-
ExtraOptions: '--disable-gil --experimental-jit'
205+
ExtraOptions: '--disable-gil ${{ parameters.JITOptionFreethreaded }}'
277206
${{ if eq(parameters.ToBeSigned, 'true') }}:
278207
Artifact: unsigned_amd64_t
279208
${{ else }}:
@@ -306,12 +235,7 @@ jobs:
306235
arm64:
307236
Name: arm64
308237
PythonExePattern: python.exe
309-
${{ if ne(parameters.DoJIT, 'true') }}:
310-
ExtraOptions: ''
311-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
312-
ExtraOptions: '--experimental-jit-off'
313-
${{ else }}:
314-
ExtraOptions: '--experimental-jit'
238+
ExtraOptions: ${{ parameters.JITOption }}
315239
${{ if eq(parameters.ToBeSigned, 'true') }}:
316240
Artifact: unsigned_arm64
317241
${{ else }}:
@@ -320,12 +244,7 @@ jobs:
320244
arm64_t:
321245
Name: arm64_t
322246
PythonExePattern: python3*t.exe
323-
${{ if or(ne(parameters.DoJIT, 'true'), ne(parameters.DoJITFreethreaded, 'true')) }}:
324-
ExtraOptions: '--disable-gil'
325-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
326-
ExtraOptions: '--disable-gil --experimental-jit-off'
327-
${{ else }}:
328-
ExtraOptions: '--disable-gil --experimental-jit'
247+
ExtraOptions: '--disable-gil ${{ parameters.JITOptionFreethreaded }}'
329248
${{ if eq(parameters.ToBeSigned, 'true') }}:
330249
Artifact: unsigned_arm64_t
331250
${{ else }}:
@@ -396,12 +315,7 @@ jobs:
396315
arm64:
397316
Name: arm64
398317
PythonExePattern: python.exe
399-
${{ if ne(parameters.DoJIT, 'true') }}:
400-
ExtraOptions: ''
401-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
402-
ExtraOptions: '--experimental-jit-off'
403-
${{ else }}:
404-
ExtraOptions: '--experimental-jit'
318+
ExtraOptions: ${{ parameters.JITOption }}
405319
${{ if eq(parameters.ToBeSigned, 'true') }}:
406320
Artifact: unsigned_arm64
407321
${{ else }}:
@@ -410,12 +324,7 @@ jobs:
410324
arm64_t:
411325
Name: arm64_t
412326
PythonExePattern: python3*t.exe
413-
${{ if or(ne(parameters.DoJIT, 'true'), ne(parameters.DoJITFreethreaded, 'true')) }}:
414-
ExtraOptions: '--disable-gil'
415-
${{ elseif ne(parameters.DoJITEnabled, 'true') }}:
416-
ExtraOptions: '--disable-gil --experimental-jit-off'
417-
${{ else }}:
418-
ExtraOptions: '--disable-gil --experimental-jit'
327+
ExtraOptions: '--disable-gil ${{ parameters.JITOptionFreethreaded }}'
419328
${{ if eq(parameters.ToBeSigned, 'true') }}:
420329
Artifact: unsigned_arm64_t
421330
${{ else }}:

0 commit comments

Comments
 (0)