mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-28 18:54:10 +00:00
parent
9785266e29
commit
277c15bd66
4 changed files with 57 additions and 11 deletions
55
Cargo.lock
generated
55
Cargo.lock
generated
|
|
@ -94,6 +94,15 @@ version = "1.0.97"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f"
|
||||
|
||||
[[package]]
|
||||
name = "arbitrary"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223"
|
||||
dependencies = [
|
||||
"derive_arbitrary",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "arcstr"
|
||||
version = "1.2.0"
|
||||
|
|
@ -688,7 +697,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"windows-sys 0.48.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -905,6 +914,17 @@ version = "0.1.4"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b"
|
||||
|
||||
[[package]]
|
||||
name = "derive_arbitrary"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "diff"
|
||||
version = "0.1.13"
|
||||
|
|
@ -2100,6 +2120,12 @@ dependencies = [
|
|||
"scopeguard",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lockfree-object-pool"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e"
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.25"
|
||||
|
|
@ -6089,7 +6115,7 @@ version = "0.1.9"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
|
||||
dependencies = [
|
||||
"windows-sys 0.48.0",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -6680,14 +6706,19 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "zip"
|
||||
version = "0.6.6"
|
||||
version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261"
|
||||
checksum = "84e9a772a54b54236b9b744aaaf8d7be01b4d6e99725523cb82cb32d1c81b1d7"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"arbitrary",
|
||||
"crc32fast",
|
||||
"crossbeam-utils",
|
||||
"displaydoc",
|
||||
"flate2",
|
||||
"indexmap",
|
||||
"memchr",
|
||||
"thiserror 2.0.11",
|
||||
"zopfli",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -6696,6 +6727,20 @@ version = "0.4.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b20717f0917c908dc63de2e44e97f1e6b126ca58d0e391cee86d504eb8fbd05"
|
||||
|
||||
[[package]]
|
||||
name = "zopfli"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5019f391bac5cf252e93bbcc53d039ffd62c7bfb7c150414d61369afe57e946"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"crc32fast",
|
||||
"lockfree-object-pool",
|
||||
"log",
|
||||
"once_cell",
|
||||
"simd-adler32",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zstd"
|
||||
version = "0.13.2"
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ windows-sys = { version = "0.59.0", features = ["Win32_Foundation", "Win32_Secur
|
|||
winsafe = { version = "0.0.23", features = ["kernel"] }
|
||||
wiremock = { version = "0.6.2" }
|
||||
xz2 = { version = "0.1.7" }
|
||||
zip = { version = "0.6.6", default-features = false, features = ["deflate"] }
|
||||
zip = { version = "2.2.3", default-features = false, features = ["deflate"] }
|
||||
|
||||
[workspace.metadata.cargo-shear]
|
||||
ignored = ["flate2", "xz2"]
|
||||
|
|
|
|||
|
|
@ -644,7 +644,7 @@ impl ZipDirectoryWriter {
|
|||
) -> Result<Box<dyn Write + 'slf>, Error> {
|
||||
// 644 is the default of the zip crate.
|
||||
let permissions = if executable_bit { 775 } else { 664 };
|
||||
let options = zip::write::FileOptions::default()
|
||||
let options = zip::write::SimpleFileOptions::default()
|
||||
.unix_permissions(permissions)
|
||||
.compression_method(self.compression);
|
||||
self.writer.start_file(path, options)?;
|
||||
|
|
@ -655,7 +655,7 @@ impl ZipDirectoryWriter {
|
|||
impl DirectoryWriter for ZipDirectoryWriter {
|
||||
fn write_bytes(&mut self, path: &str, bytes: &[u8]) -> Result<(), Error> {
|
||||
trace!("Adding {}", path);
|
||||
let options = zip::write::FileOptions::default().compression_method(self.compression);
|
||||
let options = zip::write::SimpleFileOptions::default().compression_method(self.compression);
|
||||
self.writer.start_file(path, options)?;
|
||||
self.writer.write_all(bytes)?;
|
||||
|
||||
|
|
@ -690,7 +690,7 @@ impl DirectoryWriter for ZipDirectoryWriter {
|
|||
|
||||
fn write_directory(&mut self, directory: &str) -> Result<(), Error> {
|
||||
trace!("Adding directory {}", directory);
|
||||
let options = zip::write::FileOptions::default().compression_method(self.compression);
|
||||
let options = zip::write::SimpleFileOptions::default().compression_method(self.compression);
|
||||
Ok(self.writer.add_directory(directory, options)?)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use std::str::Utf8Error;
|
|||
use fs_err::File;
|
||||
use thiserror::Error;
|
||||
use uv_fs::Simplified;
|
||||
use zip::write::FileOptions;
|
||||
use zip::write::SimpleFileOptions;
|
||||
use zip::ZipWriter;
|
||||
|
||||
#[cfg(all(windows, target_arch = "x86"))]
|
||||
|
|
@ -250,7 +250,8 @@ pub fn windows_script_launcher(
|
|||
// We're using the zip writer, but with stored compression
|
||||
// https://github.com/njsmith/posy/blob/04927e657ca97a5e35bb2252d168125de9a3a025/src/trampolines/mod.rs#L75-L82
|
||||
// https://github.com/pypa/distlib/blob/8ed03aab48add854f377ce392efffb79bb4d6091/PC/launcher.c#L259-L271
|
||||
let stored = FileOptions::default().compression_method(zip::CompressionMethod::Stored);
|
||||
let stored =
|
||||
SimpleFileOptions::default().compression_method(zip::CompressionMethod::Stored);
|
||||
let mut archive = ZipWriter::new(Cursor::new(&mut payload));
|
||||
let error_msg = "Writing to Vec<u8> should never fail";
|
||||
archive.start_file("__main__.py", stored).expect(error_msg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue