@@ -340,8 +340,6 @@ def _python_impl(module_ctx):
340340
341341 host_platforms = {}
342342 for repo_name , (platform_name , platform_info ) in register_result .impl_repos .items ():
343- if "3.13.1" in full_python_version :
344- print ("registered:" , repo_name )
345343 toolchain_impls .append (struct (
346344 # str: The base name to use for the toolchain() target
347345 name = repo_name ,
@@ -713,12 +711,23 @@ def _process_single_version_platform_overrides(*, tag, _fail = fail, default):
713711 if not arch :
714712 arch = "UNKNOWN_CUSTOM_ARCH"
715713
716- default ["platforms" ][tag .platform ] = platform_info (
717- compatible_with = target_compatible_with ,
718- target_settings = tag .target_settings ,
719- os_name = os_name ,
720- arch = arch ,
721- )
714+ # Move the override earlier in the ordering -- the platform key ordering
715+ # becomes the toolchain ordering within the version.
716+ override_first = {
717+ tag .platform : platform_info (
718+ compatible_with = target_compatible_with ,
719+ target_settings = tag .target_settings ,
720+ os_name = os_name ,
721+ arch = arch ,
722+ ),
723+ }
724+ for key , value in default ["platforms" ].items ():
725+ # Don't replace our override with the old value
726+ if key in override_first :
727+ continue
728+ override_first [key ] = value
729+
730+ default ["platforms" ] = override_first
722731
723732def _process_global_overrides (* , tag , default , _fail = fail ):
724733 if tag .available_python_versions :
0 commit comments