Skip to content

Commit 807ab8a

Browse files
committed
unix: make host_platforms consistent with values used in build
I'm not convinced this is the right direction to go as I don't like the host platform names we chose over a year ago. But this makes things consistent.
1 parent d2e1934 commit 807ab8a

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

cpython-unix/targets.yml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# This file defines configurations for each supported build target/triple.
22
#
33
# host_platform
4-
# Defines the Python sys.platform value where this configuration
5-
# can be built from.
4+
# Defines the platform name where this configuration can be built from.
65
#
76
# pythons_supported
87
# Python versions we support building.
@@ -51,7 +50,7 @@
5150
# 11.0+.
5251
aarch64-apple-darwin:
5352
host_platforms:
54-
- darwin
53+
- macos
5554
pythons_supported:
5655
- '3.9'
5756
needs_toolchain: true
@@ -92,7 +91,7 @@ aarch64-apple-darwin:
9291

9392
aarch64-apple-ios:
9493
host_platforms:
95-
- darwin
94+
- macos
9695
pythons_supported:
9796
- '3.9'
9897
needs_toolchain: true
@@ -127,7 +126,7 @@ aarch64-apple-ios:
127126

128127
aarch64-unknown-linux-gnu:
129128
host_platforms:
130-
- linux
129+
- linux64
131130
pythons_supported:
132131
- '3.9'
133132
docker_image_suffix: .cross
@@ -157,7 +156,7 @@ aarch64-unknown-linux-gnu:
157156

158157
arm64-apple-tvos:
159158
host_platforms:
160-
- darwin
159+
- macos
161160
pythons_supported:
162161
- '3.9'
163162
needs_toolchain: true
@@ -191,7 +190,7 @@ arm64-apple-tvos:
191190

192191
armv7-unknown-linux-gnueabi:
193192
host_platforms:
194-
- linux
193+
- linux64
195194
pythons_supported:
196195
- '3.9'
197196
docker_image_suffix: .cross
@@ -221,7 +220,7 @@ armv7-unknown-linux-gnueabi:
221220

222221
armv7-unknown-linux-gnueabihf:
223222
host_platforms:
224-
- linux
223+
- linux64
225224
pythons_supported:
226225
- '3.9'
227226
docker_image_suffix: .cross
@@ -251,7 +250,7 @@ armv7-unknown-linux-gnueabihf:
251250

252251
i686-unknown-linux-gnu:
253252
host_platforms:
254-
- linux
253+
- linux64
255254
pythons_supported:
256255
- '3.8'
257256
- '3.9'
@@ -289,7 +288,7 @@ i686-unknown-linux-gnu:
289288

290289
mips-unknown-linux-gnu:
291290
host_platforms:
292-
- linux
291+
- linux64
293292
pythons_supported:
294293
- '3.9'
295294
docker_image_suffix: .cross
@@ -319,7 +318,7 @@ mips-unknown-linux-gnu:
319318

320319
mipsel-unknown-linux-gnu:
321320
host_platforms:
322-
- linux
321+
- linux64
323322
pythons_supported:
324323
- '3.9'
325324
docker_image_suffix: .cross
@@ -349,7 +348,7 @@ mipsel-unknown-linux-gnu:
349348

350349
s390x-unknown-linux-gnu:
351350
host_platforms:
352-
- linux
351+
- linux64
353352
pythons_supported:
354353
- '3.9'
355354
docker_image_suffix: .cross
@@ -379,7 +378,7 @@ s390x-unknown-linux-gnu:
379378

380379
thumb7k-apple-watchos:
381380
host_platforms:
382-
- darwin
381+
- macos
383382
pythons_supported:
384383
- '3.9'
385384
needs_toolchain: true
@@ -417,7 +416,7 @@ thumb7k-apple-watchos:
417416
# machines.
418417
x86_64-apple-darwin:
419418
host_platforms:
420-
- darwin
419+
- macos
421420
pythons_supported:
422421
- '3.8'
423422
- '3.9'
@@ -459,7 +458,7 @@ x86_64-apple-darwin:
459458

460459
x86_64-apple-ios:
461460
host_platforms:
462-
- darwin
461+
- macos
463462
pythons_supported:
464463
- '3.9'
465464
needs_toolchain: true
@@ -494,7 +493,7 @@ x86_64-apple-ios:
494493

495494
x86_64-apple-tvos:
496495
host_platforms:
497-
- darwin
496+
- macos
498497
pythons_supported:
499498
- '3.9'
500499
needs_toolchain: true
@@ -527,7 +526,7 @@ x86_64-apple-tvos:
527526

528527
x86_64-apple-watchos:
529528
host_platforms:
530-
- darwin
529+
- macos
531530
pythons_supported:
532531
- '3.9'
533532
needs_toolchain: true
@@ -561,7 +560,7 @@ x86_64-apple-watchos:
561560

562561
x86_64-unknown-linux-gnu:
563562
host_platforms:
564-
- linux
563+
- linux64
565564
pythons_supported:
566565
- '3.8'
567566
- '3.9'
@@ -594,7 +593,7 @@ x86_64-unknown-linux-gnu:
594593

595594
x86_64-unknown-linux-musl:
596595
host_platforms:
597-
- linux
596+
- linux64
598597
pythons_supported:
599598
- '3.8'
600599
- '3.9'

pythonbuild/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ def supported_targets(yaml_path: pathlib.Path):
3939

4040
for target, settings in get_targets(yaml_path).items():
4141
for platform in settings["host_platforms"]:
42-
if sys.platform == platform:
42+
if sys.platform == "linux" and platform == "linux64":
43+
targets.add(target)
44+
elif sys.platform == "darwin" and platform == "macos":
4345
targets.add(target)
4446

4547
return targets

0 commit comments

Comments
 (0)