Skip to content

Commit

Permalink
Add 32-bit Windows target
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Aug 20, 2024
1 parent 3395d24 commit a521923
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
14 changes: 13 additions & 1 deletion crates/uv-configuration/src/target_triple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ pub enum TargetTriple {
/// An alias for `aarch64-apple-darwin`, the default target for macOS.
Macos,

/// An x86 Windows target.
/// A 64-bit x86 Windows target.
#[cfg_attr(feature = "clap", value(name = "x86_64-pc-windows-msvc"))]
#[cfg_attr(feature = "schemars", schemars(rename = "x86_64-pc-windows-msvc"))]
X8664PcWindowsMsvc,

/// A 32-bit x86 Windows target.
#[cfg_attr(feature = "clap", value(name = "i686-pc-windows-msvc"))]
#[cfg_attr(feature = "schemars", schemars(rename = "i686-pc-windows-msvc"))]
I686PcWindowsMsvc,

/// An x86 Linux target. Equivalent to `x86_64-manylinux_2_17`.
#[cfg_attr(feature = "clap", value(name = "x86_64-unknown-linux-gnu"))]
#[cfg_attr(feature = "schemars", schemars(rename = "x86_64-unknown-linux-gnu"))]
Expand Down Expand Up @@ -112,6 +117,7 @@ impl TargetTriple {
});
Platform::new(Os::Macos { major, minor }, Arch::Aarch64)
}
Self::I686PcWindowsMsvc => Platform::new(Os::Windows, Arch::X86),
Self::X8664AppleDarwin => {
let (major, minor) = macos_deployment_target().map_or((12, 0), |(major, minor)| {
debug!("Found macOS deployment target: {}.{}", major, minor);
Expand Down Expand Up @@ -183,6 +189,7 @@ impl TargetTriple {
Self::Windows | Self::X8664PcWindowsMsvc => "x86_64",
Self::Linux | Self::X8664UnknownLinuxGnu => "x86_64",
Self::Macos | Self::Aarch64AppleDarwin => "arm64",
Self::I686PcWindowsMsvc => "x86",
Self::X8664AppleDarwin => "x86_64",
Self::Aarch64UnknownLinuxGnu => "aarch64",
Self::Aarch64UnknownLinuxMusl => "aarch64",
Expand All @@ -202,6 +209,7 @@ impl TargetTriple {
Self::Windows | Self::X8664PcWindowsMsvc => "Windows",
Self::Linux | Self::X8664UnknownLinuxGnu => "Linux",
Self::Macos | Self::Aarch64AppleDarwin => "Darwin",
Self::I686PcWindowsMsvc => "Windows",
Self::X8664AppleDarwin => "Darwin",
Self::Aarch64UnknownLinuxGnu => "Linux",
Self::Aarch64UnknownLinuxMusl => "Linux",
Expand All @@ -221,6 +229,7 @@ impl TargetTriple {
Self::Windows | Self::X8664PcWindowsMsvc => "",
Self::Linux | Self::X8664UnknownLinuxGnu => "",
Self::Macos | Self::Aarch64AppleDarwin => "",
Self::I686PcWindowsMsvc => "",
Self::X8664AppleDarwin => "",
Self::Aarch64UnknownLinuxGnu => "",
Self::Aarch64UnknownLinuxMusl => "",
Expand All @@ -240,6 +249,7 @@ impl TargetTriple {
Self::Windows | Self::X8664PcWindowsMsvc => "",
Self::Linux | Self::X8664UnknownLinuxGnu => "",
Self::Macos | Self::Aarch64AppleDarwin => "",
Self::I686PcWindowsMsvc => "",
Self::X8664AppleDarwin => "",
Self::Aarch64UnknownLinuxGnu => "",
Self::Aarch64UnknownLinuxMusl => "",
Expand All @@ -259,6 +269,7 @@ impl TargetTriple {
Self::Windows | Self::X8664PcWindowsMsvc => "nt",
Self::Linux | Self::X8664UnknownLinuxGnu => "posix",
Self::Macos | Self::Aarch64AppleDarwin => "posix",
Self::I686PcWindowsMsvc => "nt",
Self::X8664AppleDarwin => "posix",
Self::Aarch64UnknownLinuxGnu => "posix",
Self::Aarch64UnknownLinuxMusl => "posix",
Expand All @@ -278,6 +289,7 @@ impl TargetTriple {
Self::Windows | Self::X8664PcWindowsMsvc => "win32",
Self::Linux | Self::X8664UnknownLinuxGnu => "linux",
Self::Macos | Self::Aarch64AppleDarwin => "darwin",
Self::I686PcWindowsMsvc => "win32",
Self::X8664AppleDarwin => "darwin",
Self::Aarch64UnknownLinuxGnu => "linux",
Self::Aarch64UnknownLinuxMusl => "linux",
Expand Down
16 changes: 12 additions & 4 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,9 @@ uv tree [OPTIONS]

<li><code>macos</code>: An alias for <code>aarch64-apple-darwin</code>, the default target for macOS</li>

<li><code>x86_64-pc-windows-msvc</code>: An x86 Windows target</li>
<li><code>x86_64-pc-windows-msvc</code>: A 64-bit x86 Windows target</li>

<li><code>i686-pc-windows-msvc</code>: A 32-bit x86 Windows target</li>

<li><code>x86_64-unknown-linux-gnu</code>: An x86 Linux target. Equivalent to <code>x86_64-manylinux_2_17</code></li>

Expand Down Expand Up @@ -3808,7 +3810,9 @@ uv pip compile [OPTIONS] <SRC_FILE>...

<li><code>macos</code>: An alias for <code>aarch64-apple-darwin</code>, the default target for macOS</li>

<li><code>x86_64-pc-windows-msvc</code>: An x86 Windows target</li>
<li><code>x86_64-pc-windows-msvc</code>: A 64-bit x86 Windows target</li>

<li><code>i686-pc-windows-msvc</code>: A 32-bit x86 Windows target</li>

<li><code>x86_64-unknown-linux-gnu</code>: An x86 Linux target. Equivalent to <code>x86_64-manylinux_2_17</code></li>

Expand Down Expand Up @@ -4104,7 +4108,9 @@ uv pip sync [OPTIONS] <SRC_FILE>...

<li><code>macos</code>: An alias for <code>aarch64-apple-darwin</code>, the default target for macOS</li>

<li><code>x86_64-pc-windows-msvc</code>: An x86 Windows target</li>
<li><code>x86_64-pc-windows-msvc</code>: A 64-bit x86 Windows target</li>

<li><code>i686-pc-windows-msvc</code>: A 32-bit x86 Windows target</li>

<li><code>x86_64-unknown-linux-gnu</code>: An x86 Linux target. Equivalent to <code>x86_64-manylinux_2_17</code></li>

Expand Down Expand Up @@ -4434,7 +4440,9 @@ uv pip install [OPTIONS] <PACKAGE|--requirement <REQUIREMENT>|--editable <EDITAB

<li><code>macos</code>: An alias for <code>aarch64-apple-darwin</code>, the default target for macOS</li>

<li><code>x86_64-pc-windows-msvc</code>: An x86 Windows target</li>
<li><code>x86_64-pc-windows-msvc</code>: A 64-bit x86 Windows target</li>

<li><code>i686-pc-windows-msvc</code>: A 32-bit x86 Windows target</li>

<li><code>x86_64-unknown-linux-gnu</code>: An x86 Linux target. Equivalent to <code>x86_64-manylinux_2_17</code></li>

Expand Down
9 changes: 8 additions & 1 deletion uv.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a521923

Please sign in to comment.