From eebcac8223df06d6d27ec1a3605286c27448bfac Mon Sep 17 00:00:00 2001 From: Valery Antopol Date: Thu, 22 Feb 2024 23:01:40 +0400 Subject: [PATCH] feat!: update to fluence-app-service 0.35.0 (#121) update to fluence-app-service 0.35.0 --- Cargo.lock | 78 +++++++++++++------ Cargo.toml | 2 +- crates/marine-test-macro-impl/Cargo.toml | 2 +- .../service_generation_utils.rs | 7 -- .../generation_tests/empty_func/expanded.rs | 5 -- .../mounted_binary/expanded.rs | 5 -- .../multi-service-empty_mod/expanded.rs | 7 +- .../multi-service-multiple/expanded.rs | 12 --- .../multi-service-single/expanded.rs | 6 -- .../multiple_modules/expanded.rs | 5 -- 10 files changed, 59 insertions(+), 70 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ee517d..a6ff937 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -670,15 +670,15 @@ dependencies = [ [[package]] name = "fluence-app-service" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e95950035a16589b5ed736ee920839e475b864965b4e4061e2bc1faaf58f1f2" +checksum = "53f1b1edfa366551382890ecf2b18d8b9675b3a105bf2d90c444446cc081115d" dependencies = [ "log", "maplit", "marine-min-it-version", "marine-runtime", - "marine-wasm-backend-traits", + "marine-wasm-backend-traits 0.6.0", "marine-wasmtime-backend", "serde", "serde_derive", @@ -1222,9 +1222,9 @@ dependencies = [ [[package]] name = "marine-core" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81f40fac4650a022a2ce8d7b6df5614062fc32cb25fb44e61027997e90a3aff6" +checksum = "2989c1670a82d69724804c7af5d8e4c35231083338806c49485d983f27dd440f" dependencies = [ "anyhow", "bytesize", @@ -1233,12 +1233,12 @@ dependencies = [ "log", "marine-it-generator", "marine-it-interfaces", - "marine-it-parser", + "marine-it-parser 0.16.0", "marine-min-it-version", "marine-module-info-parser", "marine-module-interface", "marine-utils", - "marine-wasm-backend-traits", + "marine-wasm-backend-traits 0.6.0", "marine-wasmtime-backend", "multimap", "once_cell", @@ -1251,12 +1251,12 @@ dependencies = [ [[package]] name = "marine-it-generator" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23bdd0119dc71f98e2f0a4bef305e43b9a4d9b9adbead12bc05b0fac1d5a247c" +checksum = "993c33c6df3ae978022058dfd63a33b52de1307adec59e0c3f3367dd06bdf342" dependencies = [ "it-lilo", - "marine-it-parser", + "marine-it-parser 0.16.0", "marine-macro-impl 0.14.0", "once_cell", "serde", @@ -1286,7 +1286,26 @@ dependencies = [ "itertools", "marine-it-interfaces", "marine-module-interface", - "marine-wasm-backend-traits", + "marine-wasm-backend-traits 0.5.1", + "nom", + "semver", + "serde", + "thiserror", + "walrus", + "wasmer-interface-types-fl", +] + +[[package]] +name = "marine-it-parser" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fa9ba677486e1f1bf2bfd3e34b259255df277887fa90d5c22acb258bdedc34e" +dependencies = [ + "anyhow", + "itertools", + "marine-it-interfaces", + "marine-module-interface", + "marine-wasm-backend-traits 0.6.0", "nom", "semver", "serde", @@ -1410,15 +1429,15 @@ dependencies = [ [[package]] name = "marine-module-info-parser" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b312830884d07fc495a43e867d9641163897f0b0b047842cf1172cc61f57075" +checksum = "1db5fe45b6f0f397ecce757c23a3d0c4a08c2e9ffa6e7f642cb89e1ec777b16d" dependencies = [ "anyhow", "chrono", "derivative", "marine-rs-sdk-main 0.14.0", - "marine-wasm-backend-traits", + "marine-wasm-backend-traits 0.6.0", "semver", "serde", "thiserror", @@ -1510,9 +1529,9 @@ dependencies = [ [[package]] name = "marine-runtime" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c599c7c13e976170a1211e31fe2fb4557e0479cbdba331b19a5a9e87f145f52" +checksum = "00e428f8066ed3cbd6def39a818ffe949d7ab15559666927b25401068ce2655d" dependencies = [ "bytesize", "it-json-serde", @@ -1527,7 +1546,7 @@ dependencies = [ "marine-rs-sdk", "marine-rs-sdk-main 0.14.0", "marine-utils", - "marine-wasm-backend-traits", + "marine-wasm-backend-traits 0.6.0", "marine-wasmtime-backend", "parking_lot", "safe-transmute", @@ -1558,7 +1577,7 @@ dependencies = [ "darling", "fluence-app-service", "itertools", - "marine-it-parser", + "marine-it-parser 0.15.1", "marine-macro-testing-utils", "proc-macro-error", "proc-macro2", @@ -1600,15 +1619,30 @@ dependencies = [ ] [[package]] -name = "marine-wasmtime-backend" -version = "0.5.1" +name = "marine-wasm-backend-traits" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa0dc5a7da0e3334f3ce5b341ba4354341af9a1f9efae24884a1b931efdf23e" +checksum = "50ba17135a13735abfc8fbbb221cd27fb8c607482ec72d7cd8f37315c9fdf6c5" +dependencies = [ + "anyhow", + "it-memory-traits", + "multimap", + "paste", + "thiserror", + "wasmer-interface-types-fl", + "wasmparser 0.101.1", +] + +[[package]] +name = "marine-wasmtime-backend" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7a74c532073142ced94fdeaf7a3e84f92ec5ebef5751fbd5516185ae3cf211" dependencies = [ "anyhow", "it-memory-traits", "log", - "marine-wasm-backend-traits", + "marine-wasm-backend-traits 0.6.0", "multimap", "paste", "wasmer-interface-types-fl", diff --git a/Cargo.toml b/Cargo.toml index 886a64e..197fb2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ trybuild = "1.0" [dependencies] marine-test-macro = { path = "crates/marine-test-macro", version = "=0.15.0" } marine-build-rs-generator = { path = "crates/marine-build-rs-generator", version = "=0.15.0" } -fluence-app-service = { version = "0.34.0", features = ["raw-module-api"] } +fluence-app-service = { version = "0.35.0", features = ["raw-module-api"] } serde = { version = "1.0.162", features = ["derive"] } serde_json = "1.0.96" diff --git a/crates/marine-test-macro-impl/Cargo.toml b/crates/marine-test-macro-impl/Cargo.toml index 7a02062..e8458c1 100644 --- a/crates/marine-test-macro-impl/Cargo.toml +++ b/crates/marine-test-macro-impl/Cargo.toml @@ -14,7 +14,7 @@ license = "Apache-2.0" all-features = true [dependencies] -fluence-app-service = { version = "0.34.0", features = ["raw-module-api"] } +fluence-app-service = { version = "0.35.0", features = ["raw-module-api"] } marine-it-parser = "0.15.0" itertools = "0.10.5" darling = "0.20.1" diff --git a/crates/marine-test-macro-impl/src/marine_test/token_stream_generator/service_generation_utils.rs b/crates/marine-test-macro-impl/src/marine_test/token_stream_generator/service_generation_utils.rs index 9cc6699..4bc2c26 100644 --- a/crates/marine-test-macro-impl/src/marine_test/token_stream_generator/service_generation_utils.rs +++ b/crates/marine-test-macro-impl/src/marine_test/token_stream_generator/service_generation_utils.rs @@ -21,13 +21,7 @@ pub(crate) fn generate_app_service_ctor( .ok_or_else(|| TestGeneratorError::InvalidUTF8Path(test_file_path.to_path_buf()))?; let service_ctor = quote! { - let tmp_dir = std::env::temp_dir(); let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string(); - - let tmp_dir = tmp_dir.join(&service_id); - let tmp_dir = tmp_dir.to_string_lossy().to_string(); - std::fs::create_dir(&tmp_dir).expect("can't create a directory for service in tmp"); - let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); let mut file_path = std::path::Path::new(#test_file_path).components(); @@ -59,7 +53,6 @@ pub(crate) fn generate_app_service_ctor( .unwrap_or_else(|e| { panic!("app service config located at `{:?}` can't be loaded: {}", config_path, e) } ); - __m_generated_marine_config.service_base_dir = Some(tmp_dir); __m_generated_marine_config.toml_marine_config.base_path = config_path .parent() .map(std::path::PathBuf::from) diff --git a/crates/marine-test-macro-impl/tests/generation_tests/empty_func/expanded.rs b/crates/marine-test-macro-impl/tests/generation_tests/empty_func/expanded.rs index 87f963b..79adff0 100644 --- a/crates/marine-test-macro-impl/tests/generation_tests/empty_func/expanded.rs +++ b/crates/marine-test-macro-impl/tests/generation_tests/empty_func/expanded.rs @@ -74,11 +74,7 @@ fn empty_string() { impl ModuleInterface {} } } - let tmp_dir = std::env::temp_dir(); let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string(); - let tmp_dir = tmp_dir.join(&service_id); - let tmp_dir = tmp_dir.to_string_lossy().to_string(); - std::fs::create_dir(&tmp_dir).expect("can't create a directory for service in tmp"); let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); let mut file_path = std::path::Path::new("tests/generation_tests/empty_func").components(); let mut truncated_file_path = Vec::new(); @@ -111,7 +107,6 @@ fn empty_string() { config_path, e ) }); - __m_generated_marine_config.service_base_dir = Some(tmp_dir); __m_generated_marine_config.toml_marine_config.base_path = config_path .parent() .map(std::path::PathBuf::from) diff --git a/crates/marine-test-macro-impl/tests/generation_tests/mounted_binary/expanded.rs b/crates/marine-test-macro-impl/tests/generation_tests/mounted_binary/expanded.rs index 6592db8..318f30b 100644 --- a/crates/marine-test-macro-impl/tests/generation_tests/mounted_binary/expanded.rs +++ b/crates/marine-test-macro-impl/tests/generation_tests/mounted_binary/expanded.rs @@ -105,11 +105,7 @@ fn test() { } } } - let tmp_dir = std::env::temp_dir(); let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string(); - let tmp_dir = tmp_dir.join(&service_id); - let tmp_dir = tmp_dir.to_string_lossy().to_string(); - std::fs::create_dir(&tmp_dir).expect("can't create a directory for service in tmp"); let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); let mut file_path = std::path::Path::new("tests/generation_tests/mounted_binary").components(); let mut truncated_file_path = Vec::new(); @@ -142,7 +138,6 @@ fn test() { config_path, e ) }); - __m_generated_marine_config.service_base_dir = Some(tmp_dir); __m_generated_marine_config.toml_marine_config.base_path = config_path .parent() .map(std::path::PathBuf::from) diff --git a/crates/marine-test-macro-impl/tests/generation_tests/multi-service-empty_mod/expanded.rs b/crates/marine-test-macro-impl/tests/generation_tests/multi-service-empty_mod/expanded.rs index e725745..6c063f6 100644 --- a/crates/marine-test-macro-impl/tests/generation_tests/multi-service-empty_mod/expanded.rs +++ b/crates/marine-test-macro-impl/tests/generation_tests/multi-service-empty_mod/expanded.rs @@ -173,12 +173,7 @@ pub mod tests { } impl ServiceInterface { pub fn new() -> Self { - let tmp_dir = std::env::temp_dir(); let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string(); - let tmp_dir = tmp_dir.join(&service_id); - let tmp_dir = tmp_dir.to_string_lossy().to_string(); - std::fs::create_dir(&tmp_dir) - .expect("can't create a directory for service in tmp"); let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); let mut file_path = std::path::Path::new("tests/generation_tests/multi-service-empty_mod") @@ -213,7 +208,7 @@ pub mod tests { config_path, e ) }); - __m_generated_marine_config.service_base_dir = Some(tmp_dir); + __m_generated_marine_config.toml_marine_config.base_path = config_path .parent() .map(std::path::PathBuf::from) diff --git a/crates/marine-test-macro-impl/tests/generation_tests/multi-service-multiple/expanded.rs b/crates/marine-test-macro-impl/tests/generation_tests/multi-service-multiple/expanded.rs index d2cf948..1bc045c 100644 --- a/crates/marine-test-macro-impl/tests/generation_tests/multi-service-multiple/expanded.rs +++ b/crates/marine-test-macro-impl/tests/generation_tests/multi-service-multiple/expanded.rs @@ -173,12 +173,7 @@ fn test() { } impl ServiceInterface { pub fn new() -> Self { - let tmp_dir = std::env::temp_dir(); let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string(); - let tmp_dir = tmp_dir.join(&service_id); - let tmp_dir = tmp_dir.to_string_lossy().to_string(); - std::fs::create_dir(&tmp_dir) - .expect("can't create a directory for service in tmp"); let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); let mut file_path = std::path::Path::new("tests/generation_tests/multi-service-multiple") @@ -213,7 +208,6 @@ fn test() { config_path, e ) }); - __m_generated_marine_config.service_base_dir = Some(tmp_dir); __m_generated_marine_config.toml_marine_config.base_path = config_path .parent() .map(std::path::PathBuf::from) @@ -416,12 +410,7 @@ fn test() { } impl ServiceInterface { pub fn new() -> Self { - let tmp_dir = std::env::temp_dir(); let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string(); - let tmp_dir = tmp_dir.join(&service_id); - let tmp_dir = tmp_dir.to_string_lossy().to_string(); - std::fs::create_dir(&tmp_dir) - .expect("can't create a directory for service in tmp"); let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); let mut file_path = std::path::Path::new("tests/generation_tests/multi-service-multiple") @@ -456,7 +445,6 @@ fn test() { config_path, e ) }); - __m_generated_marine_config.service_base_dir = Some(tmp_dir); __m_generated_marine_config.toml_marine_config.base_path = config_path .parent() .map(std::path::PathBuf::from) diff --git a/crates/marine-test-macro-impl/tests/generation_tests/multi-service-single/expanded.rs b/crates/marine-test-macro-impl/tests/generation_tests/multi-service-single/expanded.rs index fe95035..4da956d 100644 --- a/crates/marine-test-macro-impl/tests/generation_tests/multi-service-single/expanded.rs +++ b/crates/marine-test-macro-impl/tests/generation_tests/multi-service-single/expanded.rs @@ -173,12 +173,7 @@ fn empty_test() { } impl ServiceInterface { pub fn new() -> Self { - let tmp_dir = std::env::temp_dir(); let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string(); - let tmp_dir = tmp_dir.join(&service_id); - let tmp_dir = tmp_dir.to_string_lossy().to_string(); - std::fs::create_dir(&tmp_dir) - .expect("can't create a directory for service in tmp"); let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); let mut file_path = std::path::Path::new("tests/generation_tests/multi-service-single") @@ -213,7 +208,6 @@ fn empty_test() { config_path, e ) }); - __m_generated_marine_config.service_base_dir = Some(tmp_dir); __m_generated_marine_config.toml_marine_config.base_path = config_path .parent() .map(std::path::PathBuf::from) diff --git a/crates/marine-test-macro-impl/tests/generation_tests/multiple_modules/expanded.rs b/crates/marine-test-macro-impl/tests/generation_tests/multiple_modules/expanded.rs index 48882e4..1deaf96 100644 --- a/crates/marine-test-macro-impl/tests/generation_tests/multiple_modules/expanded.rs +++ b/crates/marine-test-macro-impl/tests/generation_tests/multiple_modules/expanded.rs @@ -225,11 +225,7 @@ fn empty_string() { } } } - let tmp_dir = std::env::temp_dir(); let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string(); - let tmp_dir = tmp_dir.join(&service_id); - let tmp_dir = tmp_dir.to_string_lossy().to_string(); - std::fs::create_dir(&tmp_dir).expect("can't create a directory for service in tmp"); let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); let mut file_path = std::path::Path::new("tests/generation_tests/multiple_modules").components(); @@ -263,7 +259,6 @@ fn empty_string() { config_path, e ) }); - __m_generated_marine_config.service_base_dir = Some(tmp_dir); __m_generated_marine_config.toml_marine_config.base_path = config_path .parent() .map(std::path::PathBuf::from)