Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
zanieb merged 1 commit into
mainfrom
zb/toolchain-dltl
Jun 12, 2024
Merged

Refactor uv-toolchain::platform to use target-lexicon#4236
zanieb merged 1 commit into
mainfrom
zb/toolchain-dltl

Conversation

@zanieb

@zanieb zanieb commented Jun 11, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
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

@konstin konstin left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread crates/uv-toolchain/src/downloads.rs
Comment thread crates/uv-toolchain/src/platform.rs
Comment thread crates/uv-toolchain/src/platform.rs
@zanieb zanieb force-pushed the zb/toolchain-dltl branch from b337590 to b117095 Compare June 11, 2024 17:29
@zanieb zanieb force-pushed the zb/toolchain-dltl branch from b117095 to 8185c16 Compare June 12, 2024 14:04
@zanieb zanieb merged commit f7f55ed into main Jun 12, 2024
@zanieb zanieb deleted the zb/toolchain-dltl branch June 12, 2024 14:11
@zanieb

zanieb commented Jun 12, 2024

Copy link
Copy Markdown
Member Author

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