Skip to content

refactor: explicitly define host platform ordering - #2890

Merged
aignas merged 19 commits into
bazel-contrib:mainfrom
rickeylev:refactor.well.defined.host.platform.ordering
May 20, 2025
Merged

refactor: explicitly define host platform ordering#2890
aignas merged 19 commits into
bazel-contrib:mainfrom
rickeylev:refactor.well.defined.host.platform.ordering

Conversation

@rickeylev

@rickeylev rickeylev commented May 16, 2025

Copy link
Copy Markdown
Collaborator

It turns out the unsorted-dict-items disable in versions.bzl is load-bearing: the
precedence of what host-compatible runtime is selected depends on the order of keys.
Hence, the keys are carefully defined such that freethreaded and musl come after the
regular runtimes.

Make this subtle and implicit behavior explicit by having an ordering function that
sorts keys in the order we want.

Work towards #2081

@rickeylev
rickeylev requested a review from aignas as a code owner May 16, 2025 23:20
@rickeylev
rickeylev force-pushed the refactor.well.defined.host.platform.ordering branch from e283fc0 to b31a9a4 Compare May 16, 2025 23:21
@rickeylev
rickeylev force-pushed the refactor.well.defined.host.platform.ordering branch from b31a9a4 to f88fc59 Compare May 17, 2025 18:35

@rickeylev rickeylev left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready for PTAL: Dependent PR merged

Comment thread python/private/toolchains_repo.bzl Outdated
Comment thread python/versions.bzl Outdated
Comment thread python/private/toolchains_repo.bzl Outdated

@rickeylev rickeylev left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ptal

Comment thread python/private/toolchains_repo.bzl Outdated
Comment thread python/private/toolchains_repo.bzl Outdated
Comment thread python/versions.bzl Outdated

@aignas aignas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@aignas
aignas enabled auto-merge May 20, 2025 04:07
@aignas
aignas added this pull request to the merge queue May 20, 2025
Merged via the queue into bazel-contrib:main with commit c678623 May 20, 2025
@rickeylev
rickeylev deleted the refactor.well.defined.host.platform.ordering branch May 20, 2025 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants