Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor uv-toolchain::platform to use target-lexicon #4236

Merged
merged 1 commit into from
Jun 12, 2024
Merged

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jun 11, 2024

Closes #3857

Instead of using custom Arch, Os, and Libc types I just use target-lexicon's which enumerate way more variants and implement display and parsing. We use a wrapper type to represent a couple special cases to support the "x86" alias for "i686" and "macos" for "darwin". Alternatively we could try to use our platform-tags types but those capture more information (like operating system versions) that we don't have for downloads.

As discussed in #4160, this is not sufficient for proper libc detection but that work is larger and will be handled separately.

@zanieb zanieb added the internal A refactor or improvement that is not user-facing label Jun 11, 2024
@zanieb zanieb force-pushed the zb/toolchain-dltl branch 2 times, most recently from b25aa0b to b337590 Compare June 11, 2024 16:22
Comment on lines 132 to +133
def normalize_os(os):
return OS_MAP.get(os, os)
return os
Copy link
Member Author

Choose a reason for hiding this comment

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

Just keeping this for consistency for now

@zanieb zanieb requested a review from konstin June 11, 2024 16:24
@zanieb zanieb marked this pull request as ready for review June 11, 2024 16:25
Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

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

Setting the right default libc on linux is critical, the rest looks good

Copy link
Member

Choose a reason for hiding this comment

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

This file is one huge block, do we know if this affects compilation times?

Copy link
Member Author

Choose a reason for hiding this comment

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

No clue, is there a good way to measure?

Copy link
Member

Choose a reason for hiding this comment

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

We could compare compile times with a dummy, but there aren't any good tools around.

crates/uv-toolchain/src/downloads.rs Show resolved Hide resolved
crates/uv-toolchain/src/platform.rs Show resolved Hide resolved
crates/uv-toolchain/src/platform.rs Show resolved Hide resolved
@zanieb zanieb merged commit f7f55ed into main Jun 12, 2024
46 checks passed
@zanieb zanieb deleted the zb/toolchain-dltl branch June 12, 2024 14:11
@zanieb
Copy link
Member Author

zanieb commented Jun 12, 2024

See #4242 for proper musl support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal A refactor or improvement that is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Managed toolchain discovery doesn't reflect ARM v6 vs. v7 differences
2 participants