mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 21:58:20 +00:00
deps: Remove duplicate webc dependencies
These were introduced by an older version of targz-to-pirita depending on an older wasmer-registry
This commit is contained in:
committed by
Michael-F-Bryan
parent
9910220c0a
commit
97136b111c
180
Cargo.lock
generated
180
Cargo.lock
generated
@@ -1356,12 +1356,6 @@ version = "1.3.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
|
checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "fuchsia-cprng"
|
|
||||||
version = "0.1.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures"
|
name = "futures"
|
||||||
version = "0.3.28"
|
version = "0.3.28"
|
||||||
@@ -3078,19 +3072,6 @@ dependencies = [
|
|||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rand"
|
|
||||||
version = "0.4.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"
|
|
||||||
dependencies = [
|
|
||||||
"fuchsia-cprng",
|
|
||||||
"libc",
|
|
||||||
"rand_core 0.3.1",
|
|
||||||
"rdrand",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand"
|
name = "rand"
|
||||||
version = "0.8.5"
|
version = "0.8.5"
|
||||||
@@ -3099,7 +3080,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"rand_chacha",
|
"rand_chacha",
|
||||||
"rand_core 0.6.4",
|
"rand_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3109,24 +3090,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
|
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ppv-lite86",
|
"ppv-lite86",
|
||||||
"rand_core 0.6.4",
|
"rand_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rand_core"
|
|
||||||
version = "0.3.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
|
|
||||||
dependencies = [
|
|
||||||
"rand_core 0.4.2",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rand_core"
|
|
||||||
version = "0.4.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand_core"
|
name = "rand_core"
|
||||||
version = "0.6.4"
|
version = "0.6.4"
|
||||||
@@ -3177,15 +3143,6 @@ dependencies = [
|
|||||||
"num_cpus",
|
"num_cpus",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rdrand"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
|
|
||||||
dependencies = [
|
|
||||||
"rand_core 0.3.1",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "redox_syscall"
|
name = "redox_syscall"
|
||||||
version = "0.1.57"
|
version = "0.1.57"
|
||||||
@@ -3277,15 +3234,6 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "remove_dir_all"
|
|
||||||
version = "0.5.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
|
|
||||||
dependencies = [
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rend"
|
name = "rend"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
@@ -4091,16 +4039,6 @@ version = "0.12.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5"
|
checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tempdir"
|
|
||||||
version = "0.3.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"
|
|
||||||
dependencies = [
|
|
||||||
"rand 0.4.6",
|
|
||||||
"remove_dir_all",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tempfile"
|
name = "tempfile"
|
||||||
version = "3.5.0"
|
version = "3.5.0"
|
||||||
@@ -4795,7 +4733,7 @@ dependencies = [
|
|||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
"typetag",
|
"typetag",
|
||||||
"webc 5.0.0-rc.7",
|
"webc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4957,45 +4895,29 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wapm-targz-to-pirita"
|
name = "wapm-targz-to-pirita"
|
||||||
version = "0.1.10"
|
version = "0.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6b3f2778f5f2431f74ae83607cea3ba9cd33cbfa0c75ff6caff30162668e2ed8"
|
checksum = "1f2daf9fc40607c4a14a89220afe36e62dbb111627cb428b764d322e7c9d4493"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"base64 0.13.1",
|
"base64 0.21.0",
|
||||||
"flate2",
|
"flate2",
|
||||||
|
"indexmap",
|
||||||
"json5",
|
"json5",
|
||||||
"nuke-dir",
|
"nuke-dir",
|
||||||
"rand 0.8.5",
|
"rand",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_cbor",
|
"serde_cbor",
|
||||||
"serde_derive",
|
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2",
|
"sha2",
|
||||||
"tar",
|
"tar",
|
||||||
"toml",
|
"toml",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"url",
|
||||||
"validator",
|
"validator",
|
||||||
"wapm-toml 0.4.0",
|
"wapm-toml",
|
||||||
"wasmer-registry 3.1.1",
|
"wasmer-registry 4.2.0",
|
||||||
"webc 4.1.1",
|
"webc",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wapm-toml"
|
|
||||||
version = "0.2.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a61b6d3b6a2fc171198e6378b3a9b38650e114298775a9e63401613abb6a10b3"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"semver 1.0.17",
|
|
||||||
"serde",
|
|
||||||
"serde_cbor",
|
|
||||||
"serde_derive",
|
|
||||||
"serde_json",
|
|
||||||
"serde_yaml 0.8.26",
|
|
||||||
"thiserror",
|
|
||||||
"toml",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -5308,7 +5230,7 @@ dependencies = [
|
|||||||
"wasmer-middlewares",
|
"wasmer-middlewares",
|
||||||
"wasmer-types",
|
"wasmer-types",
|
||||||
"wasmer-wasix",
|
"wasmer-wasix",
|
||||||
"webc 5.0.0-rc.7",
|
"webc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -5328,7 +5250,7 @@ dependencies = [
|
|||||||
"blake3",
|
"blake3",
|
||||||
"criterion",
|
"criterion",
|
||||||
"hex",
|
"hex",
|
||||||
"rand 0.8.5",
|
"rand",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"wasmer",
|
"wasmer",
|
||||||
@@ -5408,8 +5330,7 @@ dependencies = [
|
|||||||
"wasmer-wasix",
|
"wasmer-wasix",
|
||||||
"wasmer-wasix-experimental-io-devices",
|
"wasmer-wasix-experimental-io-devices",
|
||||||
"wasmer-wast",
|
"wasmer-wast",
|
||||||
"webc 4.1.1",
|
"webc",
|
||||||
"webc 5.0.0-rc.7",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -5588,7 +5509,7 @@ dependencies = [
|
|||||||
"object 0.30.3",
|
"object 0.30.3",
|
||||||
"predicates 2.1.5",
|
"predicates 2.1.5",
|
||||||
"pretty_assertions",
|
"pretty_assertions",
|
||||||
"rand 0.8.5",
|
"rand",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
"tar",
|
"tar",
|
||||||
@@ -5621,11 +5542,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasmer-registry"
|
name = "wasmer-registry"
|
||||||
version = "3.1.1"
|
version = "4.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "982286807bf43d2522a9f6139f9c2570df45d5a32148460226ccbc7edfb3ee13"
|
checksum = "7a2466288c71defce98142c435a11a346222ce863ff7dcd3606da295205bbb55"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
"console",
|
||||||
"dirs",
|
"dirs",
|
||||||
"filetime",
|
"filetime",
|
||||||
"flate2",
|
"flate2",
|
||||||
@@ -5633,6 +5555,8 @@ dependencies = [
|
|||||||
"futures-util",
|
"futures-util",
|
||||||
"graphql_client",
|
"graphql_client",
|
||||||
"hex",
|
"hex",
|
||||||
|
"indicatif",
|
||||||
|
"lazy_static",
|
||||||
"log",
|
"log",
|
||||||
"lzma-rs",
|
"lzma-rs",
|
||||||
"regex",
|
"regex",
|
||||||
@@ -5641,14 +5565,14 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"tar",
|
"tar",
|
||||||
"tempdir",
|
"tempfile",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tldextract",
|
"tldextract",
|
||||||
"tokio",
|
"tokio",
|
||||||
"toml",
|
"toml",
|
||||||
"url",
|
"url",
|
||||||
"wapm-toml 0.2.2",
|
"wasmer-toml",
|
||||||
"webc 3.0.1",
|
"webc",
|
||||||
"whoami",
|
"whoami",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -5671,7 +5595,7 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
"lzma-rs",
|
"lzma-rs",
|
||||||
"minisign",
|
"minisign",
|
||||||
"rand 0.8.5",
|
"rand",
|
||||||
"regex",
|
"regex",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"rpassword",
|
"rpassword",
|
||||||
@@ -5690,7 +5614,7 @@ dependencies = [
|
|||||||
"wasmer-toml",
|
"wasmer-toml",
|
||||||
"wasmer-wasm-interface",
|
"wasmer-wasm-interface",
|
||||||
"wasmparser 0.51.4",
|
"wasmparser 0.51.4",
|
||||||
"webc 5.0.0-rc.7",
|
"webc",
|
||||||
"whoami",
|
"whoami",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -5792,7 +5716,7 @@ dependencies = [
|
|||||||
"linked_hash_set",
|
"linked_hash_set",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
"rand 0.8.5",
|
"rand",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_cbor",
|
"serde_cbor",
|
||||||
@@ -5825,7 +5749,7 @@ dependencies = [
|
|||||||
"wasmer-wasix-types",
|
"wasmer-wasix-types",
|
||||||
"wcgi",
|
"wcgi",
|
||||||
"wcgi-host",
|
"wcgi-host",
|
||||||
"webc 5.0.0-rc.7",
|
"webc",
|
||||||
"weezl",
|
"weezl",
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
@@ -6109,52 +6033,6 @@ dependencies = [
|
|||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "webc"
|
|
||||||
version = "3.0.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ef87e7b955d5d1feaa8697ae129f1a9ce8859e151574ad3baceae9413b48d2f0"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"base64 0.13.1",
|
|
||||||
"indexmap",
|
|
||||||
"leb128",
|
|
||||||
"lexical-sort",
|
|
||||||
"memchr",
|
|
||||||
"memmap2",
|
|
||||||
"path-clean",
|
|
||||||
"rand 0.8.5",
|
|
||||||
"serde",
|
|
||||||
"serde_cbor",
|
|
||||||
"serde_json",
|
|
||||||
"sha2",
|
|
||||||
"url",
|
|
||||||
"walkdir",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "webc"
|
|
||||||
version = "4.1.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e4af0f2f0b6bf2e4366375c3cd6635aef1a2eb66cd02454d79525aa7eecf0751"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"base64 0.13.1",
|
|
||||||
"byteorder",
|
|
||||||
"indexmap",
|
|
||||||
"leb128",
|
|
||||||
"lexical-sort",
|
|
||||||
"memchr",
|
|
||||||
"path-clean",
|
|
||||||
"rand 0.8.5",
|
|
||||||
"serde",
|
|
||||||
"serde_cbor",
|
|
||||||
"serde_json",
|
|
||||||
"sha2",
|
|
||||||
"url",
|
|
||||||
"walkdir",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webc"
|
name = "webc"
|
||||||
version = "5.0.0-rc.7"
|
version = "5.0.0-rc.7"
|
||||||
@@ -6171,7 +6049,7 @@ dependencies = [
|
|||||||
"memmap2",
|
"memmap2",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"path-clean",
|
"path-clean",
|
||||||
"rand 0.8.5",
|
"rand",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_cbor",
|
"serde_cbor",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|||||||
@@ -65,9 +65,6 @@ toml = "0.5.9"
|
|||||||
url = "2.3.1"
|
url = "2.3.1"
|
||||||
libc = { version = "^0.2", default-features = false }
|
libc = { version = "^0.2", default-features = false }
|
||||||
webc = { version = "5.0.0-rc.7" }
|
webc = { version = "5.0.0-rc.7" }
|
||||||
# HACK(Michael-F-Bryan): Remove this once a new version of wapm-targz-to-pirita
|
|
||||||
# is published that doesn't have a public dependency on webc
|
|
||||||
webc_v4 = { version = "4", package = "webc" }
|
|
||||||
isatty = "0.1.9"
|
isatty = "0.1.9"
|
||||||
dialoguer = "0.10.2"
|
dialoguer = "0.10.2"
|
||||||
tldextract = "0.6.0"
|
tldextract = "0.6.0"
|
||||||
@@ -85,7 +82,7 @@ wasm-coredump-builder = { version = "0.1.11" }
|
|||||||
tracing = { version = "0.1" }
|
tracing = { version = "0.1" }
|
||||||
tracing-subscriber = { version = "0.3", features = [ "env-filter", "fmt" ] }
|
tracing-subscriber = { version = "0.3", features = [ "env-filter", "fmt" ] }
|
||||||
clap-verbosity-flag = "1"
|
clap-verbosity-flag = "1"
|
||||||
wapm-targz-to-pirita = "0.1.10"
|
wapm-targz-to-pirita = "0.2.0"
|
||||||
|
|
||||||
[target.'cfg(not(target_arch = "riscv64"))'.dependencies]
|
[target.'cfg(not(target_arch = "riscv64"))'.dependencies]
|
||||||
http_req = { version="^0.8", default-features = false, features = ["rust-tls"] }
|
http_req = { version="^0.8", default-features = false, features = ["rust-tls"] }
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ use wasmer::{
|
|||||||
use wasmer_cache::Cache;
|
use wasmer_cache::Cache;
|
||||||
use wasmer_compiler::ArtifactBuild;
|
use wasmer_compiler::ArtifactBuild;
|
||||||
use wasmer_registry::Package;
|
use wasmer_registry::Package;
|
||||||
use wasmer_wasix::runners::{wcgi::AbortHandle, MappedDirectory, Runner};
|
use wasmer_wasix::runners::wcgi::AbortHandle;
|
||||||
use webc::{metadata::Manifest, Container};
|
use wasmer_wasix::runners::{MappedDirectory, Runner};
|
||||||
use webc_v4::DirOrFile;
|
use webc::{metadata::Manifest, v1::DirOrFile, Container};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
store::StoreOptions,
|
store::StoreOptions,
|
||||||
@@ -72,10 +72,10 @@ impl RunUnstable {
|
|||||||
|
|
||||||
let (mut store, _) = self.store.get_store()?;
|
let (mut store, _) = self.store.get_store()?;
|
||||||
|
|
||||||
let cache = self.wasmer_home.module_cache();
|
let mut cache = self.wasmer_home.module_cache();
|
||||||
let result = match target.load(cache, &store)? {
|
let result = match target.load(&mut cache, &store)? {
|
||||||
ExecutableTarget::WebAssembly(wasm) => self.execute_wasm(&target, &wasm, &mut store),
|
ExecutableTarget::WebAssembly(wasm) => self.execute_wasm(&target, &wasm, &mut store),
|
||||||
ExecutableTarget::Webc(container, cache) => {
|
ExecutableTarget::Webc(container) => {
|
||||||
self.execute_webc(&target, container, cache, &mut store)
|
self.execute_webc(&target, container, cache, &mut store)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -317,7 +317,7 @@ fn compile_directory_to_webc(dir: &Path) -> Result<Vec<u8>, Error> {
|
|||||||
let mut files = BTreeMap::new();
|
let mut files = BTreeMap::new();
|
||||||
load_files_from_disk(&mut files, dir, dir)?;
|
load_files_from_disk(&mut files, dir, dir)?;
|
||||||
|
|
||||||
let wasmer_toml = webc_v4::DirOrFile::File("wasmer.toml".into());
|
let wasmer_toml = DirOrFile::File("wasmer.toml".into());
|
||||||
if let Some(toml_data) = files.remove(&wasmer_toml) {
|
if let Some(toml_data) = files.remove(&wasmer_toml) {
|
||||||
// HACK(Michael-F-Bryan): The version of wapm-targz-to-pirita we are
|
// HACK(Michael-F-Bryan): The version of wapm-targz-to-pirita we are
|
||||||
// using doesn't know we renamed "wapm.toml" to "wasmer.toml", so we
|
// using doesn't know we renamed "wapm.toml" to "wasmer.toml", so we
|
||||||
@@ -343,11 +343,11 @@ fn load_files_from_disk(files: &mut FileMap, dir: &Path, base: &Path) -> Result<
|
|||||||
|
|
||||||
if path.is_dir() {
|
if path.is_dir() {
|
||||||
load_files_from_disk(files, &path, base)?;
|
load_files_from_disk(files, &path, base)?;
|
||||||
files.insert(webc_v4::DirOrFile::Dir(relative_path), Vec::new());
|
files.insert(DirOrFile::Dir(relative_path), Vec::new());
|
||||||
} else if path.is_file() {
|
} else if path.is_file() {
|
||||||
let data = std::fs::read(&path)
|
let data = std::fs::read(&path)
|
||||||
.with_context(|| format!("Unable to read \"{}\"", path.display()))?;
|
.with_context(|| format!("Unable to read \"{}\"", path.display()))?;
|
||||||
files.insert(webc_v4::DirOrFile::File(relative_path), data);
|
files.insert(DirOrFile::File(relative_path), data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -462,12 +462,12 @@ impl TargetOnDisk {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load(&self, mut cache: ModuleCache, store: &Store) -> Result<ExecutableTarget, Error> {
|
fn load(&self, cache: &mut ModuleCache, store: &Store) -> Result<ExecutableTarget, Error> {
|
||||||
match self {
|
match self {
|
||||||
TargetOnDisk::Webc(webc) => {
|
TargetOnDisk::Webc(webc) => {
|
||||||
// As an optimisation, try to use the mmapped version first.
|
// As an optimisation, try to use the mmapped version first.
|
||||||
if let Ok(container) = Container::from_disk(webc.clone()) {
|
if let Ok(container) = Container::from_disk(webc.clone()) {
|
||||||
return Ok(ExecutableTarget::Webc(container, cache));
|
return Ok(ExecutableTarget::Webc(container));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, fall back to the version that reads everything
|
// Otherwise, fall back to the version that reads everything
|
||||||
@@ -476,7 +476,7 @@ impl TargetOnDisk {
|
|||||||
.with_context(|| format!("Unable to read \"{}\"", webc.display()))?;
|
.with_context(|| format!("Unable to read \"{}\"", webc.display()))?;
|
||||||
let container = Container::from_bytes(bytes)?;
|
let container = Container::from_bytes(bytes)?;
|
||||||
|
|
||||||
Ok(ExecutableTarget::Webc(container, cache))
|
Ok(ExecutableTarget::Webc(container))
|
||||||
}
|
}
|
||||||
TargetOnDisk::Directory(dir) => {
|
TargetOnDisk::Directory(dir) => {
|
||||||
// FIXME: Runners should be able to load directories directly
|
// FIXME: Runners should be able to load directories directly
|
||||||
@@ -487,17 +487,13 @@ impl TargetOnDisk {
|
|||||||
let container = Container::from_bytes(webc)
|
let container = Container::from_bytes(webc)
|
||||||
.context("Unable to parse the generated WEBC file")?;
|
.context("Unable to parse the generated WEBC file")?;
|
||||||
|
|
||||||
Ok(ExecutableTarget::Webc(container, cache))
|
Ok(ExecutableTarget::Webc(container))
|
||||||
}
|
}
|
||||||
TargetOnDisk::WebAssemblyBinary(path) => {
|
TargetOnDisk::WebAssemblyBinary(path) => {
|
||||||
let wasm = std::fs::read(path)
|
let wasm = std::fs::read(path)
|
||||||
.with_context(|| format!("Unable to read \"{}\"", path.display()))?;
|
.with_context(|| format!("Unable to read \"{}\"", path.display()))?;
|
||||||
let module = compile_wasm_cached(
|
let module =
|
||||||
path.display().to_string(),
|
compile_wasm_cached(path.display().to_string(), &wasm, cache, store.engine())?;
|
||||||
&wasm,
|
|
||||||
&mut cache,
|
|
||||||
store.engine(),
|
|
||||||
)?;
|
|
||||||
Ok(ExecutableTarget::WebAssembly(module))
|
Ok(ExecutableTarget::WebAssembly(module))
|
||||||
}
|
}
|
||||||
TargetOnDisk::Wat(path) => {
|
TargetOnDisk::Wat(path) => {
|
||||||
@@ -506,12 +502,8 @@ impl TargetOnDisk {
|
|||||||
let wasm =
|
let wasm =
|
||||||
wasmer::wat2wasm(&wat).context("Unable to convert the WAT to WebAssembly")?;
|
wasmer::wat2wasm(&wat).context("Unable to convert the WAT to WebAssembly")?;
|
||||||
|
|
||||||
let module = compile_wasm_cached(
|
let module =
|
||||||
path.display().to_string(),
|
compile_wasm_cached(path.display().to_string(), &wasm, cache, store.engine())?;
|
||||||
&wasm,
|
|
||||||
&mut cache,
|
|
||||||
store.engine(),
|
|
||||||
)?;
|
|
||||||
Ok(ExecutableTarget::WebAssembly(module))
|
Ok(ExecutableTarget::WebAssembly(module))
|
||||||
}
|
}
|
||||||
TargetOnDisk::Artifact(artifact) => {
|
TargetOnDisk::Artifact(artifact) => {
|
||||||
@@ -572,7 +564,7 @@ fn compile_wasm_cached(
|
|||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
enum ExecutableTarget {
|
enum ExecutableTarget {
|
||||||
WebAssembly(Module),
|
WebAssembly(Module),
|
||||||
Webc(Container, ModuleCache),
|
Webc(Container),
|
||||||
}
|
}
|
||||||
|
|
||||||
fn generate_coredump(err: &Error, source: &Path, coredump_path: &Path) -> Result<(), Error> {
|
fn generate_coredump(err: &Error, source: &Path, coredump_path: &Path) -> Result<(), Error> {
|
||||||
|
|||||||
Reference in New Issue
Block a user