mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 13:48:26 +00:00
Remove unpack zip functionality from unpack_tar_gz
This commit is contained in:
72
Cargo.lock
generated
72
Cargo.lock
generated
@@ -270,27 +270,6 @@ version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70"
|
||||
|
||||
[[package]]
|
||||
name = "bzip2"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0"
|
||||
dependencies = [
|
||||
"bzip2-sys",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bzip2-sys"
|
||||
version = "0.1.11+1.0.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
"pkg-config",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cast"
|
||||
version = "0.3.0"
|
||||
@@ -1278,7 +1257,7 @@ dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"js-sys",
|
||||
"libc",
|
||||
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||
"wasi",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
@@ -1956,7 +1935,7 @@ checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"log",
|
||||
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||
"wasi",
|
||||
"windows-sys 0.42.0",
|
||||
]
|
||||
|
||||
@@ -3317,17 +3296,6 @@ dependencies = [
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.1.44"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"wasi 0.10.0+wasi-snapshot-preview1",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.2.27"
|
||||
@@ -3710,12 +3678,6 @@ dependencies = [
|
||||
"toml",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.10.0+wasi-snapshot-preview1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.11.0+wasi-snapshot-preview1"
|
||||
@@ -4144,7 +4106,7 @@ dependencies = [
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"log",
|
||||
"time 0.2.27",
|
||||
"time",
|
||||
"wasmer",
|
||||
"wasmer-types",
|
||||
]
|
||||
@@ -4231,7 +4193,6 @@ dependencies = [
|
||||
"url",
|
||||
"wapm-toml",
|
||||
"whoami",
|
||||
"zip-extract",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4366,7 +4327,7 @@ dependencies = [
|
||||
"byteorder",
|
||||
"pretty_assertions",
|
||||
"serde",
|
||||
"time 0.2.27",
|
||||
"time",
|
||||
"wasmer",
|
||||
"wasmer-derive",
|
||||
"wasmer-types",
|
||||
@@ -4897,28 +4858,3 @@ name = "yansi"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
|
||||
|
||||
[[package]]
|
||||
name = "zip"
|
||||
version = "0.5.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"bzip2",
|
||||
"crc32fast",
|
||||
"flate2",
|
||||
"thiserror",
|
||||
"time 0.1.44",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zip-extract"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c5cc0309f6e81ab96c2b43d5e935025f8732c886690be8f78f68e06bad1d274"
|
||||
dependencies = [
|
||||
"log",
|
||||
"thiserror",
|
||||
"zip",
|
||||
]
|
||||
|
||||
@@ -1579,6 +1579,17 @@ fn untar(tarball: std::path::PathBuf, target: std::path::PathBuf) -> Result<Vec<
|
||||
.collect())
|
||||
}
|
||||
|
||||
fn get_zig_exe_str() -> &'static str {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
"zig.exe"
|
||||
}
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
"zig"
|
||||
}
|
||||
}
|
||||
|
||||
fn find_zig_binary(path: Option<PathBuf>) -> Result<PathBuf> {
|
||||
use std::env::split_paths;
|
||||
use std::ffi::OsStr;
|
||||
|
||||
@@ -21,5 +21,4 @@ tar = "0.4.38"
|
||||
flate2 = "1.0.24"
|
||||
semver = "1.0.14"
|
||||
lzma-rs = "0.2.0"
|
||||
zip-extract = "0.1.1"
|
||||
tempdir = "0.3.7"
|
||||
@@ -960,16 +960,6 @@ pub fn try_unpack_targz<P: AsRef<Path>>(
|
||||
.map_err(|e| anyhow::anyhow!("failed to open {}: {e}", target_targz_path.display()))
|
||||
};
|
||||
|
||||
let try_decode_zip = || {
|
||||
let file = open_file()?;
|
||||
zip_extract::extract(file, target_targz_path, strip_toplevel).map_err(|e| {
|
||||
anyhow::anyhow!(
|
||||
"could not extract zip file {}: {e}",
|
||||
target_targz_path.display()
|
||||
)
|
||||
})
|
||||
};
|
||||
|
||||
let try_decode_gz = || {
|
||||
let file = open_file()?;
|
||||
let gz_decoded = flate2::read::GzDecoder::new(&file);
|
||||
@@ -1006,9 +996,7 @@ pub fn try_unpack_targz<P: AsRef<Path>>(
|
||||
}
|
||||
};
|
||||
|
||||
try_decode_gz()
|
||||
.or_else(|_| try_decode_xz())
|
||||
.or_else(|_| try_decode_zip())?;
|
||||
try_decode_gz().or_else(|_| try_decode_xz())?;
|
||||
|
||||
Ok(target_targz_path.to_path_buf())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user