mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Support x86 windows (#3873)
Add trampolines for x86 windows. Closes https://github.com/astral-sh/uv/issues/3660.
This commit is contained in:
parent
cedd18e4c6
commit
f92447772e
7 changed files with 32 additions and 7 deletions
|
@ -70,7 +70,9 @@ pub enum Error {
|
|||
RecordCsv(#[from] csv::Error),
|
||||
#[error("Broken virtualenv: {0}")]
|
||||
BrokenVenv(String),
|
||||
#[error("Unable to create Windows launcher for {0} (only x64_64 is supported)")]
|
||||
#[error(
|
||||
"Unable to create Windows launcher for: {0} (only x86_64, x86, and arm64 are supported)"
|
||||
)]
|
||||
UnsupportedWindowsArch(&'static str),
|
||||
#[error("Unable to create Windows launcher on non-Windows platform")]
|
||||
NotWindows,
|
||||
|
|
|
@ -23,6 +23,14 @@ use crate::{Error, Layout};
|
|||
|
||||
const LAUNCHER_MAGIC_NUMBER: [u8; 4] = [b'U', b'V', b'U', b'V'];
|
||||
|
||||
#[cfg(all(windows, target_arch = "x86"))]
|
||||
const LAUNCHER_I686_GUI: &[u8] =
|
||||
include_bytes!("../../uv-trampoline/trampolines/uv-trampoline-i686-gui.exe");
|
||||
|
||||
#[cfg(all(windows, target_arch = "x86"))]
|
||||
const LAUNCHER_I686_CONSOLE: &[u8] =
|
||||
include_bytes!("../../uv-trampoline/trampolines/uv-trampoline-i686-console.exe");
|
||||
|
||||
#[cfg(all(windows, target_arch = "x86_64"))]
|
||||
const LAUNCHER_X86_64_GUI: &[u8] =
|
||||
include_bytes!("../../uv-trampoline/trampolines/uv-trampoline-x86_64-gui.exe");
|
||||
|
@ -161,6 +169,14 @@ pub(crate) fn windows_script_launcher(
|
|||
}
|
||||
|
||||
let launcher_bin: &[u8] = match env::consts::ARCH {
|
||||
#[cfg(all(windows, target_arch = "x86"))]
|
||||
"x86" => {
|
||||
if is_gui {
|
||||
LAUNCHER_I686_GUI
|
||||
} else {
|
||||
LAUNCHER_I686_CONSOLE
|
||||
}
|
||||
}
|
||||
#[cfg(all(windows, target_arch = "x86_64"))]
|
||||
"x86_64" => {
|
||||
if is_gui {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue