Skip to content

Commit 242214c

Browse files
zaniebkonstin
andauthored
Add an aarch64-pc-windows-msvc target (#15347)
I needed this and was surprised it didn't exist! --------- Co-authored-by: konsti <[email protected]>
1 parent ceacd27 commit 242214c

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

crates/uv-configuration/src/target_triple.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ pub enum TargetTriple {
2828
#[serde(alias = "x8664-pc-windows-msvc")]
2929
X8664PcWindowsMsvc,
3030

31+
/// An ARM64 Windows target.
32+
#[cfg_attr(feature = "clap", value(name = "aarch64-pc-windows-msvc"))]
33+
#[serde(rename = "aarch64-pc-windows-msvc")]
34+
#[serde(alias = "arm64-pc-windows-msvc")]
35+
Aarch64PcWindowsMsvc,
36+
3137
/// A 32-bit x86 Windows target.
3238
#[cfg_attr(feature = "clap", value(name = "i686-pc-windows-msvc"))]
3339
#[serde(rename = "i686-pc-windows-msvc")]
@@ -237,6 +243,7 @@ impl TargetTriple {
237243
pub fn platform(self) -> Platform {
238244
match self {
239245
Self::Windows | Self::X8664PcWindowsMsvc => Platform::new(Os::Windows, Arch::X86_64),
246+
Self::Aarch64PcWindowsMsvc => Platform::new(Os::Windows, Arch::Aarch64),
240247
Self::Linux | Self::X8664UnknownLinuxGnu => Platform::new(
241248
Os::Manylinux {
242249
major: 2,
@@ -468,6 +475,7 @@ impl TargetTriple {
468475
pub fn platform_machine(self) -> &'static str {
469476
match self {
470477
Self::Windows | Self::X8664PcWindowsMsvc => "x86_64",
478+
Self::Aarch64PcWindowsMsvc => "ARM64",
471479
Self::Linux | Self::X8664UnknownLinuxGnu => "x86_64",
472480
Self::Macos | Self::Aarch64AppleDarwin => "arm64",
473481
Self::I686PcWindowsMsvc => "x86",
@@ -509,6 +517,7 @@ impl TargetTriple {
509517
pub fn platform_system(self) -> &'static str {
510518
match self {
511519
Self::Windows | Self::X8664PcWindowsMsvc => "Windows",
520+
Self::Aarch64PcWindowsMsvc => "Windows",
512521
Self::Linux | Self::X8664UnknownLinuxGnu => "Linux",
513522
Self::Macos | Self::Aarch64AppleDarwin => "Darwin",
514523
Self::I686PcWindowsMsvc => "Windows",
@@ -550,6 +559,7 @@ impl TargetTriple {
550559
pub fn platform_version(self) -> &'static str {
551560
match self {
552561
Self::Windows | Self::X8664PcWindowsMsvc => "",
562+
Self::Aarch64PcWindowsMsvc => "",
553563
Self::Linux | Self::X8664UnknownLinuxGnu => "",
554564
Self::Macos | Self::Aarch64AppleDarwin => "",
555565
Self::I686PcWindowsMsvc => "",
@@ -594,6 +604,7 @@ impl TargetTriple {
594604
pub fn platform_release(self) -> &'static str {
595605
match self {
596606
Self::Windows | Self::X8664PcWindowsMsvc => "",
607+
Self::Aarch64PcWindowsMsvc => "",
597608
Self::Linux | Self::X8664UnknownLinuxGnu => "",
598609
Self::Macos | Self::Aarch64AppleDarwin => "",
599610
Self::I686PcWindowsMsvc => "",
@@ -637,6 +648,7 @@ impl TargetTriple {
637648
pub fn os_name(self) -> &'static str {
638649
match self {
639650
Self::Windows | Self::X8664PcWindowsMsvc => "nt",
651+
Self::Aarch64PcWindowsMsvc => "nt",
640652
Self::Linux | Self::X8664UnknownLinuxGnu => "posix",
641653
Self::Macos | Self::Aarch64AppleDarwin => "posix",
642654
Self::I686PcWindowsMsvc => "nt",
@@ -678,6 +690,7 @@ impl TargetTriple {
678690
pub fn sys_platform(self) -> &'static str {
679691
match self {
680692
Self::Windows | Self::X8664PcWindowsMsvc => "win32",
693+
Self::Aarch64PcWindowsMsvc => "win32",
681694
Self::Linux | Self::X8664UnknownLinuxGnu => "linux",
682695
Self::Macos | Self::Aarch64AppleDarwin => "darwin",
683696
Self::I686PcWindowsMsvc => "win32",
@@ -719,6 +732,7 @@ impl TargetTriple {
719732
pub fn manylinux_compatible(self) -> bool {
720733
match self {
721734
Self::Windows | Self::X8664PcWindowsMsvc => false,
735+
Self::Aarch64PcWindowsMsvc => false,
722736
Self::Linux | Self::X8664UnknownLinuxGnu => true,
723737
Self::Macos | Self::Aarch64AppleDarwin => false,
724738
Self::I686PcWindowsMsvc => false,

docs/reference/cli.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,7 @@ environment in the project.</p>
11811181
<li><code>linux</code>: An alias for <code>x86_64-unknown-linux-gnu</code>, the default target for Linux</li>
11821182
<li><code>macos</code>: An alias for <code>aarch64-apple-darwin</code>, the default target for macOS</li>
11831183
<li><code>x86_64-pc-windows-msvc</code>: A 64-bit x86 Windows target</li>
1184+
<li><code>aarch64-pc-windows-msvc</code>: An ARM64 Windows target</li>
11841185
<li><code>i686-pc-windows-msvc</code>: A 32-bit x86 Windows target</li>
11851186
<li><code>x86_64-unknown-linux-gnu</code>: An x86 Linux target. Equivalent to <code>x86_64-manylinux_2_28</code></li>
11861187
<li><code>aarch64-apple-darwin</code>: An ARM-based macOS target, as seen on Apple Silicon devices</li>
@@ -1778,6 +1779,7 @@ interpreter. Use <code>--universal</code> to display the tree for all platforms,
17781779
<li><code>linux</code>: An alias for <code>x86_64-unknown-linux-gnu</code>, the default target for Linux</li>
17791780
<li><code>macos</code>: An alias for <code>aarch64-apple-darwin</code>, the default target for macOS</li>
17801781
<li><code>x86_64-pc-windows-msvc</code>: A 64-bit x86 Windows target</li>
1782+
<li><code>aarch64-pc-windows-msvc</code>: An ARM64 Windows target</li>
17811783
<li><code>i686-pc-windows-msvc</code>: A 32-bit x86 Windows target</li>
17821784
<li><code>x86_64-unknown-linux-gnu</code>: An x86 Linux target. Equivalent to <code>x86_64-manylinux_2_28</code></li>
17831785
<li><code>aarch64-apple-darwin</code>: An ARM-based macOS target, as seen on Apple Silicon devices</li>
@@ -3557,6 +3559,7 @@ by <code>--python-version</code>.</p>
35573559
<li><code>linux</code>: An alias for <code>x86_64-unknown-linux-gnu</code>, the default target for Linux</li>
35583560
<li><code>macos</code>: An alias for <code>aarch64-apple-darwin</code>, the default target for macOS</li>
35593561
<li><code>x86_64-pc-windows-msvc</code>: A 64-bit x86 Windows target</li>
3562+
<li><code>aarch64-pc-windows-msvc</code>: An ARM64 Windows target</li>
35603563
<li><code>i686-pc-windows-msvc</code>: A 32-bit x86 Windows target</li>
35613564
<li><code>x86_64-unknown-linux-gnu</code>: An x86 Linux target. Equivalent to <code>x86_64-manylinux_2_28</code></li>
35623565
<li><code>aarch64-apple-darwin</code>: An ARM-based macOS target, as seen on Apple Silicon devices</li>
@@ -3826,6 +3829,7 @@ be used with caution, as it can modify the system Python installation.</p>
38263829
<li><code>linux</code>: An alias for <code>x86_64-unknown-linux-gnu</code>, the default target for Linux</li>
38273830
<li><code>macos</code>: An alias for <code>aarch64-apple-darwin</code>, the default target for macOS</li>
38283831
<li><code>x86_64-pc-windows-msvc</code>: A 64-bit x86 Windows target</li>
3832+
<li><code>aarch64-pc-windows-msvc</code>: An ARM64 Windows target</li>
38293833
<li><code>i686-pc-windows-msvc</code>: A 32-bit x86 Windows target</li>
38303834
<li><code>x86_64-unknown-linux-gnu</code>: An x86 Linux target. Equivalent to <code>x86_64-manylinux_2_28</code></li>
38313835
<li><code>aarch64-apple-darwin</code>: An ARM-based macOS target, as seen on Apple Silicon devices</li>
@@ -4113,6 +4117,7 @@ should be used with caution, as it can modify the system Python installation.</p
41134117
<li><code>linux</code>: An alias for <code>x86_64-unknown-linux-gnu</code>, the default target for Linux</li>
41144118
<li><code>macos</code>: An alias for <code>aarch64-apple-darwin</code>, the default target for macOS</li>
41154119
<li><code>x86_64-pc-windows-msvc</code>: A 64-bit x86 Windows target</li>
4120+
<li><code>aarch64-pc-windows-msvc</code>: An ARM64 Windows target</li>
41164121
<li><code>i686-pc-windows-msvc</code>: A 32-bit x86 Windows target</li>
41174122
<li><code>x86_64-unknown-linux-gnu</code>: An x86 Linux target. Equivalent to <code>x86_64-manylinux_2_28</code></li>
41184123
<li><code>aarch64-apple-darwin</code>: An ARM-based macOS target, as seen on Apple Silicon devices</li>

uv.schema.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)