From 998ee0294b17de62437aeffb4d5de69ba4847fa2 Mon Sep 17 00:00:00 2001 From: Mike Voronov Date: Thu, 10 Jun 2021 17:08:20 +0300 Subject: [PATCH] Improve error message for %last_error% (#119) --- CHANGELOG.md | 10 +- Cargo.lock | 170 +++++++++---------- crates/air-parser/src/parser/air.rs | 2 +- crates/air-parser/src/parser/lexer/errors.rs | 2 +- 4 files changed, 91 insertions(+), 93 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e833cca0b4..dc683655f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,16 @@ -## Version 0.10.4 (2021-06-10) +## Version 0.10.6 (2021-06-10) + +- fixed the error message for incorrect json path in `%last_error%` ([PR 119](https://github.com/fluencelabs/aquavm/pull/119)) + +## Version 0.10.5 (2021-06-10) - json path applied to scalar values becomes non-joinable ([PR 118](https://github.com/fluencelabs/aquavm/pull/118)) -## Version 0.10.3 (2021-06-09) +## Version 0.10.4 (2021-06-09) - `%last_error%` includes `peer_id` now, that contains id of a peer where an error occurred ([PR 117](https://github.com/fluencelabs/aquavm/pull/117)). -## Version 0.10.2-0.10.1 (2021-06-04) +## Version 0.10.3-0.10.1 (2021-06-04) - improved logger initialization and interface for wasm-bindgen target ([PR 116](https://github.com/fluencelabs/aquavm/pull/116), [PR 115](https://github.com/fluencelabs/aquavm/pull/115)). diff --git a/Cargo.lock b/Cargo.lock index b21036bf1f..2b4d3f7a79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,7 +65,7 @@ dependencies = [ "codespan-reporting", "criterion", "fstrings", - "itertools 0.10.0", + "itertools 0.10.1", "lalrpop", "lalrpop-util", "multimap", @@ -127,9 +127,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "ascii-canvas" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8eb72df928aafb99fe5d37b383f2fe25bd2a765e3e5f7c365916b6f2463a29" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" dependencies = [ "term", ] @@ -165,12 +165,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - [[package]] name = "bincode" version = "1.3.3" @@ -201,17 +195,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -[[package]] -name = "blake2b_simd" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" -dependencies = [ - "arrayref", - "arrayvec", - "constant_time_eq", -] - [[package]] name = "blake3" version = "0.3.8" @@ -430,7 +413,7 @@ dependencies = [ "clap", "criterion-plot", "csv", - "itertools 0.10.0", + "itertools 0.10.1", "lazy_static", "num-traits", "oorandom", @@ -578,10 +561,20 @@ dependencies = [ ] [[package]] -name = "dirs" -version = "1.0.5" +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", @@ -666,9 +659,9 @@ dependencies = [ [[package]] name = "fluence-app-service" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3b1d2c199d6bc140c9ec5ffa323ebd34ac134fb37828bbfd7aeed0339cab78" +checksum = "c0b7c82c9b76dc2f0f00a24fa39fe6ecdb90c7b4596bc70069947f55b83d7ed8" dependencies = [ "fluence-faas", "log", @@ -682,15 +675,16 @@ dependencies = [ [[package]] name = "fluence-faas" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9421599c5540e50f3854a0a48702c31408ac1cfb06314fe391792daa3a9d800b" +checksum = "5d03b12b7b359570eca676f491e5a4350fcc55decb14b1feff76796f5e346659" dependencies = [ "cmd_lib", "fluence", "fluence-sdk-main", "itertools 0.9.0", "log", + "marine-module-interface", "marine-runtime", "marine-utils", "safe-transmute", @@ -728,20 +722,6 @@ dependencies = [ "serde", ] -[[package]] -name = "fluence-sdk-wit" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab3ed39703b72e0e52bce9e1760746c73f65a5694c8da4dec751d3bfdec15b8" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn", - "uuid", -] - [[package]] name = "fstrings" version = "0.2.3" @@ -856,9 +836,9 @@ checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" [[package]] name = "heck" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] @@ -964,9 +944,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" +checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" dependencies = [ "either", ] @@ -1001,16 +981,16 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.19.5" +version = "0.19.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46962a8c71b91c3524b117dfdd70844d4265a173c4c9109f98171aebdcf1195f" +checksum = "b15174f1c529af5bf1283c3bc0058266b483a67156f79589fab2a25e23cf8988" dependencies = [ "ascii-canvas", "atty", "bit-set", "diff", "ena", - "itertools 0.10.0", + "itertools 0.10.1", "lalrpop-util", "petgraph", "pico-args", @@ -1024,9 +1004,9 @@ dependencies = [ [[package]] name = "lalrpop-util" -version = "0.19.5" +version = "0.19.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a708007b751af124d09e9c5d97515257902bc6b486a56b40bcafd939e8ff467" +checksum = "d3e58cce361efcc90ba8a0a5f982c741ff86b603495bb15a998412e957dcd278" dependencies = [ "regex", ] @@ -1058,9 +1038,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.95" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "789da6d93f1b866ffe175afc5322a4d76c038605a1c3319bb57b06967ca98a36" +checksum = "5600b4e6efc5421841a2138a6b082e07fe12f9aaa12783d50e5d13325b26b4fc" [[package]] name = "lock_api" @@ -1097,14 +1077,14 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "marine-it-generator" -version = "0.4.0" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245d4971ee68559236cdd34e6d57ae769dab68c6c9ed4d390f14ae5830880c8f" +checksum = "e62f29b16bbdb0763a04f8561c954624ee9cd9f558af4e67b95eb00880da11ec" dependencies = [ "cargo_toml", - "fluence-sdk-wit", "it-lilo", "marine-it-parser", + "marine-macro-impl", "once_cell", "serde", "serde_json", @@ -1115,9 +1095,9 @@ dependencies = [ [[package]] name = "marine-it-interfaces" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97c533789e72808630cc35b5d14d286382236282525f82ddce8fb47eb9d659e8" +checksum = "f18c137e51fd52ab7a3652233fc4eaa68e25a6a53d609bf9dd0f2e3bf67adee1" dependencies = [ "multimap", "wasmer-interface-types-fl", @@ -1125,12 +1105,14 @@ dependencies = [ [[package]] name = "marine-it-parser" -version = "0.5.0" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e59c7067a18b9e4aebe67bee033638fae97d6fe4fb00f70f9a509eb5d03d1c5d" +checksum = "6be3cfa1905a63ebf925c4efc605cdd121ddfe86809aaec16ec9fe32443b4423" dependencies = [ "anyhow", + "itertools 0.10.1", "marine-it-interfaces", + "marine-module-interface", "nom", "semver 0.11.0", "serde", @@ -1179,11 +1161,29 @@ dependencies = [ "wasmer-runtime-core-fl", ] +[[package]] +name = "marine-module-interface" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4920ea983e51f8f560e09d9d554035cd4ecd7d60940b352637c8c4c9d02f865" +dependencies = [ + "anyhow", + "itertools 0.10.1", + "marine-it-interfaces", + "nom", + "semver 0.11.0", + "serde", + "thiserror", + "walrus", + "wasmer-interface-types-fl", + "wasmer-runtime-core-fl", +] + [[package]] name = "marine-runtime" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8722580724555bf87a1128780f7dd3f700bbc6add690d1efe7e7fc736edf1a1" +checksum = "f4d692a5077c2617cc147419bf65eb73f8eff583726933b2c79e2b3f9db2115b" dependencies = [ "anyhow", "boolinator", @@ -1193,6 +1193,7 @@ dependencies = [ "marine-it-interfaces", "marine-it-parser", "marine-module-info-parser", + "marine-module-interface", "marine-utils", "multimap", "once_cell", @@ -1439,9 +1440,9 @@ dependencies = [ [[package]] name = "pico-args" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d7afeb98c5a10e0bffcc7fc16e105b04d06729fac5fd6384aebf7ff5cb5a67d" +checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" [[package]] name = "plotters" @@ -1591,13 +1592,12 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.3.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ - "getrandom 0.1.16", - "redox_syscall 0.1.57", - "rust-argon2", + "getrandom 0.2.3", + "redox_syscall 0.2.8", ] [[package]] @@ -1623,18 +1623,6 @@ version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" -[[package]] -name = "rust-argon2" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" -dependencies = [ - "base64", - "blake2b_simd", - "constant_time_eq", - "crossbeam-utils", -] - [[package]] name = "rustc_version" version = "0.2.3" @@ -1653,6 +1641,12 @@ dependencies = [ "semver 0.11.0", ] +[[package]] +name = "rustversion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" + [[package]] name = "ryu" version = "1.0.5" @@ -1812,9 +1806,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82" +checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" dependencies = [ "proc-macro2", "quote", @@ -1829,12 +1823,12 @@ checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" [[package]] name = "term" -version = "0.5.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" dependencies = [ - "byteorder", - "dirs", + "dirs-next", + "rustversion", "winapi", ] @@ -2154,7 +2148,7 @@ dependencies = [ "fluence-it-types", "it-lilo", "it-to-bytes", - "itertools 0.10.0", + "itertools 0.10.1", "log", "nom", "safe-transmute", diff --git a/crates/air-parser/src/parser/air.rs b/crates/air-parser/src/parser/air.rs index c48cf8e6ca..53291ebb36 100644 --- a/crates/air-parser/src/parser/air.rs +++ b/crates/air-parser/src/parser/air.rs @@ -1,4 +1,4 @@ -// auto-generated: "lalrpop 0.19.5" +// auto-generated: "lalrpop 0.19.6" // sha3: 829f4457beb3225fd27138a974f7b38a6c5f2b8672caca7dc588d2315ec560 use crate::parser::ast::*; use crate::parser::air_parser::make_flattened_error; diff --git a/crates/air-parser/src/parser/lexer/errors.rs b/crates/air-parser/src/parser/lexer/errors.rs index ec6f8d736b..1d54ab5e96 100644 --- a/crates/air-parser/src/parser/lexer/errors.rs +++ b/crates/air-parser/src/parser/lexer/errors.rs @@ -48,7 +48,7 @@ pub enum LexerError { #[error("{2}")] ParseFloatError(usize, usize, #[source] ParseFloatError), - #[error("{2} is an incorrect path for %last_error%, only .instruction and .msg are allowed")] + #[error("{2} is an incorrect path for %last_error%, only .$.instruction, .$.msg, and .$.peer_id are allowed")] LastErrorPathError(usize, usize, String), #[error("this float is too big, a float could contain less than 12 digits")]