From f14b79f8cf798273736447ccc232f42b7cfa0891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grabarz?= Date: Wed, 14 Aug 2024 01:16:55 +0200 Subject: [PATCH] Rust bump, reduce dependencices (#10803) Updated rust version, removed some unnecessary or problematic dependencies. Ported some changes from bazel branch. --- Cargo.lock | 1663 +++++++---------- Cargo.toml | 35 +- build/base/Cargo.toml | 5 +- build/base/src/extensions.rs | 3 - build/base/src/extensions/from_string.rs | 41 - build/base/src/extensions/future.rs | 51 +- build/base/src/extensions/iterator.rs | 66 - build/base/src/extensions/path.rs | 34 +- build/base/src/extensions/result.rs | 79 - build/base/src/extensions/str.rs | 34 - build/base/src/fs.rs | 12 +- build/base/src/fs/wrappers.rs | 24 +- build/base/src/lib.rs | 11 +- build/build/Cargo.toml | 6 +- build/build/src/aws/s3.rs | 12 +- build/build/src/ci_gen.rs | 6 +- build/build/src/config.rs | 4 +- build/build/src/context.rs | 6 +- build/build/src/engine.rs | 2 +- build/build/src/engine/context.rs | 18 +- build/build/src/ide/web.rs | 8 +- build/build/src/ide/web/fonts.rs | 10 +- build/build/src/ide/web/google_font.rs | 8 +- build/build/src/lib.rs | 11 +- build/build/src/paths.rs | 19 +- build/build/src/postgres.rs | 2 +- build/build/src/project.rs | 19 +- build/build/src/project/backend.rs | 18 +- build/build/src/project/gui.rs | 5 +- build/build/src/project/ide.rs | 10 +- build/build/src/project/runtime.rs | 3 +- build/build/src/project_manager.rs | 24 +- build/build/src/source.rs | 23 +- build/build/src/sqlserver.rs | 2 +- build/build/src/version.rs | 13 +- build/build/src/version/nightly.rs | 10 +- build/ci_utils/Cargo.toml | 13 +- .../ci_utils/src/actions/artifacts/context.rs | 20 +- build/ci_utils/src/actions/artifacts/raw.rs | 2 +- .../ci_utils/src/actions/artifacts/upload.rs | 43 +- .../src/actions/workflow/definition.rs | 2 +- build/ci_utils/src/archive/tar.rs | 5 +- build/ci_utils/src/archive/zip.rs | 2 +- build/ci_utils/src/cache/download.rs | 5 +- build/ci_utils/src/cache/goodie/graalpy.rs | 4 +- build/ci_utils/src/cache/goodie/graalvm.rs | 3 +- build/ci_utils/src/cache/goodie/sbt.rs | 2 +- build/ci_utils/src/env/accessor.rs | 12 +- .../src/env/known/electron_builder.rs | 2 +- build/ci_utils/src/extensions.rs | 1 - build/ci_utils/src/extensions/child.rs | 2 +- build/ci_utils/src/extensions/os.rs | 75 - build/ci_utils/src/fs.rs | 21 +- build/ci_utils/src/fs/tokio.rs | 8 +- build/ci_utils/src/fs/wrappers/tokio.rs | 16 +- build/ci_utils/src/future.rs | 52 +- build/ci_utils/src/github.rs | 10 +- build/ci_utils/src/github/release.rs | 13 +- build/ci_utils/src/github/repo.rs | 12 +- build/ci_utils/src/global.rs | 10 +- build/ci_utils/src/io.rs | 2 +- build/ci_utils/src/lib.rs | 11 +- build/ci_utils/src/os/target.rs | 252 +-- build/ci_utils/src/program.rs | 4 +- build/ci_utils/src/program/command.rs | 4 +- build/ci_utils/src/program/version.rs | 2 +- build/ci_utils/src/programs/cmd.rs | 4 +- build/ci_utils/src/programs/docker.rs | 6 +- build/ci_utils/src/programs/git.rs | 6 +- build/ci_utils/src/programs/git/ref.rs | 4 +- build/ci_utils/src/programs/java.rs | 4 +- build/ci_utils/src/programs/robocopy.rs | 2 +- build/ci_utils/src/programs/wasm_opt.rs | 8 +- build/ci_utils/src/serde.rs | 10 +- build/cli/Cargo.toml | 10 +- build/cli/src/arg.rs | 32 +- build/cli/src/arg/ide.rs | 5 +- build/cli/src/lib.rs | 45 +- build/enso-formatter/src/lib.rs | 3 +- build/install/Cargo.toml | 11 +- build/install/installer/Cargo.toml | 2 +- build/install/installer/src/lib.rs | 3 - build/install/installer/src/win/logic.rs | 8 +- build/install/src/lib.rs | 5 - build/install/uninstaller/Cargo.toml | 2 +- build/macros/lib/Cargo.toml | 2 +- build/macros/lib/src/lib.rs | 24 - build/macros/lib/src/paths.rs | 98 +- build/macros/lib/src/program_args.rs | 214 --- build/macros/proc-macro/Cargo.toml | 20 - build/macros/proc-macro/src/lib.rs | 23 - build/macros/proc-macro/tests/paths.rs | 24 - build/macros/proc-macro/tests/plain.rs | 39 - build/macros/proc-macro/tests/with_arg.rs | 32 - build/macros/proc-macro/tests/with_attr.rs | 23 - lib/rust/data-structures/Cargo.toml | 24 - lib/rust/data-structures/README.md | 3 - lib/rust/data-structures/src/lib.rs | 15 - lib/rust/macro-utils/Cargo.toml | 2 +- lib/rust/macro-utils/src/lib.rs | 1 - lib/rust/metamodel/Cargo.toml | 3 +- lib/rust/metamodel/lexpr/Cargo.toml | 5 +- lib/rust/metamodel/lexpr/src/lib.rs | 7 +- lib/rust/metamodel/src/data_structures.rs | 10 +- lib/rust/metamodel/src/java/bincode.rs | 13 +- lib/rust/metamodel/src/java/implementation.rs | 4 +- lib/rust/parser/Cargo.toml | 5 +- lib/rust/parser/debug/Cargo.toml | 2 +- lib/rust/parser/debug/tests/parse.rs | 2 +- lib/rust/parser/doc-parser/Cargo.toml | 3 +- .../parser/doc-parser/src/doc_sections.rs | 2 +- lib/rust/parser/doc-parser/src/lib.rs | 22 +- lib/rust/parser/generate-java/Cargo.toml | 4 +- lib/rust/parser/schema/Cargo.toml | 4 +- .../src/im_list.rs | 27 +- lib/rust/parser/src/lib.rs | 1 + lib/rust/parser/src/macros.rs | 8 +- lib/rust/parser/src/macros/pattern.rs | 2 +- lib/rust/parser/src/macros/resolver.rs | 2 +- lib/rust/parser/src/source/code.rs | 2 +- lib/rust/parser/src/syntax/token.rs | 2 +- lib/rust/parser/src/syntax/tree.rs | 2 +- .../parser/src/syntax/tree/visitor/Cargo.toml | 4 +- lib/rust/prelude/Cargo.toml | 2 +- lib/rust/prelude/macros/Cargo.toml | 7 +- lib/rust/prelude/macros/src/tagged_enum.rs | 19 +- lib/rust/prelude/src/lib.rs | 2 +- lib/rust/prelude/src/vec.rs | 39 +- lib/rust/reflect/Cargo.toml | 2 +- lib/rust/reflect/macros/Cargo.toml | 2 +- lib/rust/reflect/macros/src/analyze.rs | 117 +- lib/rust/reflect/macros/src/lib.rs | 3 +- rust-toolchain.toml | 2 +- rustfmt.toml | 2 +- 134 files changed, 1153 insertions(+), 2801 deletions(-) delete mode 100644 build/base/src/extensions/from_string.rs delete mode 100644 build/base/src/extensions/iterator.rs delete mode 100644 build/base/src/extensions/str.rs delete mode 100644 build/ci_utils/src/extensions/os.rs delete mode 100644 build/macros/lib/src/program_args.rs delete mode 100644 build/macros/proc-macro/Cargo.toml delete mode 100644 build/macros/proc-macro/src/lib.rs delete mode 100644 build/macros/proc-macro/tests/paths.rs delete mode 100644 build/macros/proc-macro/tests/plain.rs delete mode 100644 build/macros/proc-macro/tests/with_arg.rs delete mode 100644 build/macros/proc-macro/tests/with_attr.rs delete mode 100644 lib/rust/data-structures/Cargo.toml delete mode 100644 lib/rust/data-structures/README.md delete mode 100644 lib/rust/data-structures/src/lib.rs rename lib/rust/{data-structures => parser}/src/im_list.rs (92%) diff --git a/Cargo.lock b/Cargo.lock index c188bbcd865..1900d63e1f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,21 +2,11 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - [[package]] name = "addr2line" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -39,17 +29,6 @@ dependencies = [ "xdg", ] -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.8", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.11" @@ -64,9 +43,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -94,47 +73,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -142,15 +122,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.68" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arc-swap" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "arrayvec" @@ -170,9 +150,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", "event-listener", @@ -194,13 +174,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.78" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.74", ] [[package]] @@ -216,9 +196,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-config" @@ -436,7 +416,7 @@ dependencies = [ "http-body", "md-5", "pin-project-lite", - "sha1 0.10.5", + "sha1 0.10.6", "sha2", "tracing", ] @@ -538,7 +518,7 @@ version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b02e06ea63498c43bc0217ea4d16605d4e58d85c12fc23f6572ff6d0a840c61" dependencies = [ - "itoa 1.0.5", + "itoa", "num-integer", "ryu", "time", @@ -571,15 +551,15 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide 0.6.2", + "miniz_oxide", "object", "rustc-demangle", ] @@ -592,9 +572,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "beef" @@ -619,15 +599,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] @@ -638,95 +618,17 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" -[[package]] -name = "borsh" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" -dependencies = [ - "borsh-derive", - "hashbrown 0.12.3", -] - -[[package]] -name = "borsh-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" -dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", - "proc-macro-crate", - "proc-macro2", - "syn 1.0.107", -] - -[[package]] -name = "borsh-derive-internal" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "borsh-schema-derive-internal" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - [[package]] name = "bumpalo" -version = "3.12.2" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" - -[[package]] -name = "byte-unit" -version = "5.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ac19bdf0b2665407c39d82dbc937e951e7e2001609f0fb32edd0af45a2d63e" -dependencies = [ - "rust_decimal", - "serde", - "utf8-width", -] - -[[package]] -name = "bytecheck" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" -dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -736,19 +638,25 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "bytes-utils" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47d3a8076e283f3acd27400535992edb3ba4b5bb72f8891ad8fbe7932a7d4b9" +checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" dependencies = [ "bytes", "either", ] [[package]] -name = "cc" -version = "1.0.79" +name = "bytesize" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" + +[[package]] +name = "cc" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e8aabfac534be767c909e0690571677d49f41bd8465ae876fe043d52ba5292" [[package]] name = "cesu8" @@ -764,9 +672,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -774,7 +682,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -786,7 +694,7 @@ dependencies = [ "atty", "bitflags 1.3.2", "clap_lex 0.2.4", - "indexmap 1.9.2", + "indexmap 1.9.3", "once_cell", "strsim 0.10.0", "termcolor", @@ -795,9 +703,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "11d8838454fda655dafd3accb2b6e2bea645b9e4078abe84a22ceb947235c5cc" dependencies = [ "clap_builder", "clap_derive", @@ -805,27 +713,27 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstream", "anstyle", - "clap_lex 0.7.0", - "strsim 0.11.0", + "clap_lex 0.7.2", + "strsim 0.11.1", "terminal_size", ] [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.74", ] [[package]] @@ -839,31 +747,21 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" - -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "memchr", @@ -871,41 +769,36 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.1.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] [[package]] name = "console" -version = "0.15.5" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.42.0", + "windows-sys 0.52.0", ] [[package]] name = "console_error_panic_hook" version = "0.1.7" -source = "git+https://github.com/enso-org/console_error_panic_hook#cdd73b81709475104b9ebfe6271c6914ff71b7b2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ "cfg-if", "wasm-bindgen", ] -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "convert_case" version = "0.6.0" @@ -917,9 +810,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -927,33 +820,33 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crc32c" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89254598aa9b9fa608de44b3ae54c810f0f06d755e24c50177f1f8f31ff50ce2" +checksum = "3a47af21622d091a8f0fb295b88bc886ac74efcc613efc19f5d0b21de5c89e47" dependencies = [ "rustc_version", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -973,9 +866,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -1010,9 +903,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -1024,50 +917,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "cxx" -version = "1.0.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322296e2f2e5af4270b54df9e85a02ff037e271af20ba3e7fe1575515dc840b8" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "017a1385b05d631e7875b1f151c9f012d37b53491e2a87f65bff5c262b2111d8" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn 1.0.107", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c26bbb078acf09bc1ecda02d4223f03bdd28bd4874edcb0379138efc499ce971" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357f40d1f06a24b60ae1fe122542c1fb05d28d32acb2aed064e84bc2ad1e252e" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - [[package]] name = "darling" version = "0.14.4" @@ -1089,7 +938,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -1100,14 +949,14 @@ checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "dataview" @@ -1133,9 +982,9 @@ dependencies = [ [[package]] name = "deadpool-runtime" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaa37046cc0f6c3cc6090fbdbf73ef0b8ef4cfcc37f6befc0020f63e8cf121e1" +checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" [[package]] name = "defer-drop" @@ -1154,7 +1003,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a183e141d0e543fe8abc96e0f06da25e3294284239260e50f63847f549d807a" dependencies = [ "anyhow", - "clap 4.5.4", + "clap 4.5.15", "crossbeam", "crossbeam-channel", "dataview", @@ -1174,14 +1023,12 @@ dependencies = [ ] [[package]] -name = "derivative" -version = "2.2.0" +name = "deranged" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", + "powerfmt", ] [[package]] @@ -1192,7 +1039,7 @@ checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.74", ] [[package]] @@ -1213,7 +1060,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -1223,20 +1070,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ "derive_builder_core", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "derive_more" -version = "0.99.17" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "convert_case 0.4.0", "proc-macro2", "quote", - "rustc_version", - "syn 1.0.107", + "syn 2.0.74", + "unicode-xid", ] [[package]] @@ -1245,12 +1100,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2ea6706d74fca54e15f1d40b5cf7fe7f764aaec61352a9fcec58fe27e042fc8" -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - [[package]] name = "digest" version = "0.10.7" @@ -1311,20 +1160,20 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "either" -version = "1.8.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "embed-resource" -version = "2.4.2" +version = "2.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6985554d0688b687c5cb73898a34fbe3ad6c24c58c238a4d91d5e840670ee9d" +checksum = "4edcacde9351c33139a41e3c97eb2334351a81a2791bebb0b243df837128f602" dependencies = [ "cc", "memchr", "rustc_version", - "toml 0.8.12", + "toml 0.8.19", "vswhom", "winreg 0.52.0", ] @@ -1337,9 +1186,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -1355,8 +1204,8 @@ dependencies = [ "base64 0.13.1", "bytes", "chrono", - "clap 4.5.4", - "derivative", + "clap 4.5.15", + "derive-where", "derive_more", "dirs", "enso-build-base", @@ -1405,7 +1254,6 @@ dependencies = [ "futures-util", "serde", "serde_json", - "serde_yaml", "tracing", ] @@ -1424,8 +1272,8 @@ name = "enso-build-cli" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.4", - "derivative", + "clap 4.5.15", + "derive-where", "enso-build", "enso-build-base", "enso-formatter", @@ -1436,22 +1284,11 @@ dependencies = [ "tracing", ] -[[package]] -name = "enso-build-macros" -version = "0.1.0" -dependencies = [ - "enso-build-base", - "enso-build-macros-lib", - "itertools", - "proc-macro2", - "syn 1.0.107", -] - [[package]] name = "enso-build-macros-lib" version = "0.1.0" dependencies = [ - "convert_case 0.6.0", + "convert_case", "derive_more", "enso-build-base", "itertools", @@ -1460,16 +1297,7 @@ dependencies = [ "quote", "regex", "serde_yaml", - "syn 1.0.107", -] - -[[package]] -name = "enso-data-structures" -version = "0.2.0" -dependencies = [ - "enso-prelude", - "failure", - "serde", + "syn 2.0.74", ] [[package]] @@ -1482,7 +1310,6 @@ dependencies = [ "enso-prelude", "enso-reflect", "lexpr", - "pretty_assertions", "serde", ] @@ -1517,6 +1344,7 @@ name = "enso-install" version = "0.1.0" dependencies = [ "chrono", + "derive_more", "dirs", "embed-resource", "enso-install-config", @@ -1529,7 +1357,7 @@ dependencies = [ "sysinfo", "tracing", "tracing-subscriber", - "windows 0.53.0", + "windows 0.52.0", "winreg 0.52.0", ] @@ -1551,7 +1379,7 @@ name = "enso-installer" version = "0.1.0" dependencies = [ "anyhow", - "byte-unit", + "bytesize", "chrono", "embed-resource", "enso-install", @@ -1570,18 +1398,18 @@ version = "0.2.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.74", ] [[package]] name = "enso-macros" version = "0.2.7" dependencies = [ - "Inflector", + "convert_case", "enso-macro-utils", "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.74", ] [[package]] @@ -1589,7 +1417,6 @@ name = "enso-metamodel" version = "0.1.0" dependencies = [ "bincode", - "derivative", "derive-where", "derive_more", "enso-zst", @@ -1600,7 +1427,7 @@ name = "enso-metamodel-lexpr" version = "0.1.0" dependencies = [ "bincode", - "derivative", + "derive-where", "enso-metamodel", "enso-reflect", "lexpr", @@ -1612,7 +1439,8 @@ name = "enso-parser" version = "0.1.0" dependencies = [ "bincode", - "enso-data-structures", + "derive-where", + "derive_more", "enso-metamodel", "enso-parser-syntax-tree-visitor", "enso-prelude", @@ -1631,7 +1459,7 @@ dependencies = [ name = "enso-parser-debug" version = "0.1.0" dependencies = [ - "clap 4.5.4", + "clap 4.5.15", "enso-metamodel", "enso-metamodel-lexpr", "enso-parser", @@ -1653,7 +1481,7 @@ dependencies = [ name = "enso-parser-generate-java" version = "0.1.0" dependencies = [ - "derivative", + "derive-where", "enso-metamodel", "enso-parser", "enso-prelude", @@ -1687,7 +1515,7 @@ dependencies = [ "enso-macro-utils", "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.74", ] [[package]] @@ -1695,7 +1523,7 @@ name = "enso-prelude" version = "0.2.7" dependencies = [ "boolinator", - "derivative", + "derive-where", "derive_more", "enso-macros", "enso-reflect", @@ -1717,7 +1545,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.74", ] [[package]] @@ -1762,9 +1590,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1776,28 +1604,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", - "synstructure", -] - [[package]] name = "fastrand" version = "1.9.0" @@ -1809,30 +1615,30 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "filetime" -version = "0.2.19" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" +checksum = "bf401df4a4e3872c4fe8151134cf483738e74b67fc934d6532c882b3d24a4550" dependencies = [ "cfg-if", "libc", - "redox_syscall", - "windows-sys 0.42.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" dependencies = [ "crc32fast", - "miniz_oxide 0.7.2", + "miniz_oxide", ] [[package]] @@ -1845,18 +1651,18 @@ dependencies = [ "futures-sink", "nanorand", "pin-project", - "spin 0.9.4", + "spin 0.9.8", ] [[package]] name = "fn-error-context" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "236b4e4ae2b8be5f7a5652f6108c4a0f2627c569db4e7923333d31c7dbfed0fb" +checksum = "2cd66269887534af4b0c3e3337404591daa8dc8b9b2b3db71f9523beb4bafb41" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.74", ] [[package]] @@ -1892,9 +1698,12 @@ dependencies = [ [[package]] name = "fs-err" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] [[package]] name = "fs_extra" @@ -1904,9 +1713,9 @@ checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" [[package]] name = "futures" -version = "0.3.26" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1935,9 +1744,9 @@ checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.26" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1952,9 +1761,9 @@ checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ "fastrand 1.9.0", "futures-core", @@ -1973,7 +1782,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.74", ] [[package]] @@ -1990,9 +1799,9 @@ checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" @@ -2023,9 +1832,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -2053,9 +1862,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -2066,9 +1875,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "glob" @@ -2099,7 +1908,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.6", + "indexmap 2.3.0", "slab", "tokio", "tokio-util", @@ -2108,9 +1917,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.3.6" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "035ef95d03713f2c347a72547b7cd38cbc9af7cd51e6099fb62d586d4a6dee3a" +checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" dependencies = [ "log", "pest", @@ -2125,34 +1934,30 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.11", + "ahash", "allocator-api2", ] [[package]] name = "headers" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", + "base64 0.21.7", "bytes", "headers-core", "http", "httpdate", "mime", - "sha1 0.10.5", + "sha1 0.10.6", ] [[package]] @@ -2187,12 +1992,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -2211,20 +2013,20 @@ dependencies = [ [[package]] name = "http" -version = "0.2.8" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", - "itoa 1.0.5", + "itoa", ] [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -2233,9 +2035,9 @@ dependencies = [ [[package]] name = "http-serde" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e272971f774ba29341db2f686255ff8a979365a26fb9e4277f6b6d9ec0cdd5e" +checksum = "6f560b665ad9f1572cfcaf034f7fb84338a7ce945216d64a90fd81f046a3caee" dependencies = [ "http", "serde", @@ -2264,15 +2066,15 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -2282,9 +2084,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -2295,9 +2097,9 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.5", + "itoa", "pin-project-lite", - "socket2 0.4.7", + "socket2", "tokio", "tower-service", "tracing", @@ -2328,7 +2130,7 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.10", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] @@ -2351,26 +2153,25 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows-core 0.52.0", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] @@ -2380,15 +2181,14 @@ dependencies = [ "anyhow", "async-compression", "async-trait", - "base64 0.21.0", + "base64 0.21.7", "bincode", - "byte-unit", "bytes", "chrono", - "clap 4.5.4", + "clap 4.5.15", "data-encoding", "dependency_runner", - "derivative", + "derive-where", "derive_more", "dirs", "enso-build-base", @@ -2412,7 +2212,6 @@ dependencies = [ "path-absolutize", "path-slash", "pathdiff", - "platforms", "portpicker", "regex", "reqwest", @@ -2435,7 +2234,6 @@ dependencies = [ "url", "uuid", "walkdir", - "warp", "which", "wiremock", "zip", @@ -2460,9 +2258,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", @@ -2470,12 +2268,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -2500,18 +2298,24 @@ checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] [[package]] name = "ipnet" -version = "2.7.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -2524,15 +2328,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jni" @@ -2567,11 +2365,11 @@ dependencies = [ [[package]] name = "jsonwebtoken" -version = "8.2.0" +version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f4f04699947111ec1733e71778d763555737579e44b85844cae8e1940a1828" +checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "base64 0.13.1", + "base64 0.21.7", "pem", "ring 0.16.20", "serde", @@ -2591,38 +2389,36 @@ version = "0.1.0" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lexpr" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceee0b80e0043f17bf81130471e1b0975179af75fe657af45577d80e2698fe3b" +checksum = "6a84de6a9df442363b08f5dbf0cd5b92edc70097b89c4ce4bfea4679fe48bc67" dependencies = [ - "itoa 0.4.8", + "itoa", "lexpr-macros", - "proc-macro-hack", "ryu", ] [[package]] name = "lexpr-macros" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd627fb38e19c00d8d068618259205f7a91c91aeade5c15bc35dbca037bb1c35" +checksum = "36b5cb8bb985c81a8ac1a0f8b5c4865214f574ddd64397ef7a99c236e21f35bb" dependencies = [ - "proc-macro-hack", "proc-macro2", "quote", ] [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libm" @@ -2632,30 +2428,32 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] name = "libm" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] -name = "link-cplusplus" -version = "1.0.8" +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "cc", + "bitflags 2.6.0", + "libc", + "redox_syscall", ] [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2663,15 +2461,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "logstat" version = "0.1.0" dependencies = [ - "clap 4.5.4", + "clap 4.5.15", "enso-prelude", "lazy_static", "regex", @@ -2686,7 +2484,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -2697,18 +2495,19 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if", "digest", ] [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memoffset" @@ -2721,47 +2520,29 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" - -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - -[[package]] -name = "miniz_oxide" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi 0.3.9", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2821,16 +2602,15 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.15", ] [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -2860,9 +2640,9 @@ dependencies = [ [[package]] name = "new_mime_guess" -version = "4.0.1" +version = "4.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d684d1b59e0dc07b37e2203ef576987473288f530082512aff850585c61b1f" +checksum = "02a2dfb3559d53e90b709376af1c379462f7fb3085a0177deb73e6ea0d99eff4" dependencies = [ "mime", "unicase", @@ -2910,9 +2690,9 @@ checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" [[package]] name = "ntapi" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc51db7b362b205941f71232e56c625156eb9a929f8cf74a428fd5bc094a4afc" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" dependencies = [ "winapi", ] @@ -2929,42 +2709,46 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", ] [[package]] -name = "num-integer" -version = "0.1.45" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm 0.2.6", + "libm 0.2.8", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.9", "libc", ] @@ -2976,9 +2760,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.30.3" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "memchr", ] @@ -3018,7 +2802,7 @@ version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -3029,13 +2813,13 @@ dependencies = [ [[package]] name = "openssl-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.74", ] [[package]] @@ -3064,9 +2848,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "os_str_bytes" -version = "6.4.1" +version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" [[package]] name = "overload" @@ -3085,15 +2869,15 @@ dependencies = [ [[package]] name = "parking" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -3101,22 +2885,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.6" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys 0.42.0", + "windows-targets 0.52.6", ] [[package]] name = "paste" -version = "1.0.11" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "path-absolutize" @@ -3184,19 +2968,20 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pest" -version = "2.5.4" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.5.4" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf026e2d0581559db66d837fe5242320f525d85c76283c61f4d51a1238d65ea" +checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" dependencies = [ "pest", "pest_generator", @@ -3204,22 +2989,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.5.4" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b27bd18aa01d91c8ed2b61ea23406a676b42d82609c6e2581fba42f0c15f17f" +checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.74", ] [[package]] name = "pest_meta" -version = "2.5.4" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02b677c1859756359fc9983c2e56a0237f18624a3789528804406b7e915e5d" +checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" dependencies = [ "once_cell", "pest", @@ -3228,22 +3013,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.74", ] [[package]] @@ -3260,9 +3045,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plain" @@ -3270,20 +3055,11 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" -[[package]] -name = "platforms" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" -dependencies = [ - "serde", -] - [[package]] name = "plotters" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" dependencies = [ "num-traits", "plotters-backend", @@ -3293,9 +3069,9 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" +checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" [[package]] name = "port_check" @@ -3305,9 +3081,9 @@ checksum = "f6519412c9e0d4be579b9f0618364d19cb434b324fc6ddb1b27b1e682c7105ed" [[package]] name = "portable-atomic" -version = "1.3.3" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767eb9f07d4a5ebcb39bbf2d452058a93c011373abf6832e24194a1c3f004794" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" [[package]] name = "portpicker" @@ -3318,73 +3094,37 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "pretty_assertions" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "diff", - "yansi", + "zerocopy", ] -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml 0.5.11", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", -] - [[package]] name = "pulldown-cmark" -version = "0.9.2" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d9cc634bc78768157b5cbfe988ffcd1dcba95cd2b2f03a88316c08c6d00ed63" +checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "getopts", "memchr", "unicase", @@ -3392,9 +3132,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -3458,7 +3198,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.15", ] [[package]] @@ -3482,9 +3222,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -3502,33 +3242,34 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom 0.2.8", - "redox_syscall", + "getrandom 0.2.15", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.7.1" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -3537,23 +3278,31 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", ] [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] -name = "rend" -version = "0.4.2" +name = "regex-syntax" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" -dependencies = [ - "bytecheck", -] +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" @@ -3561,7 +3310,7 @@ version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "base64 0.21.0", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -3578,8 +3327,8 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.10", - "rustls-pemfile 1.0.2", + "rustls 0.21.12", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", @@ -3621,41 +3370,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.3" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "getrandom 0.2.8", + "cfg-if", + "getrandom 0.2.15", "libc", - "spin 0.9.4", + "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", -] - -[[package]] -name = "rkyv" -version = "0.7.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c30f1d45d9aa61cbc8cd1eb87705470892289bb2d01943e7803b873a57404dc3" -dependencies = [ - "bytecheck", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff26ed6c7c4dfc2aa9480b86a60e3c7233543a270a680e10758a507c5a4ce476" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", + "windows-sys 0.52.0", ] [[package]] @@ -3678,29 +3403,11 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "rust_decimal" -version = "1.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0446843641c69436765a35a5a77088e28c2e6a12da93e84aa3ab1cd4aa5a042" -dependencies = [ - "arrayvec", - "borsh", - "bytecheck", - "byteorder", - "bytes", - "num-traits", - "rand 0.8.5", - "rkyv", - "serde", - "serde_json", -] - [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" @@ -3713,11 +3420,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -3738,12 +3445,12 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.3", + "ring 0.17.8", "rustls-webpki", "sct", ] @@ -3755,27 +3462,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.2", + "rustls-pemfile", "schannel", "security-framework", ] [[package]] name = "rustls-pemfile" -version = "0.2.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.13.1", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" -dependencies = [ - "base64 0.21.0", + "base64 0.21.7", ] [[package]] @@ -3784,21 +3482,21 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.3", + "ring 0.17.8", "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -3811,11 +3509,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.42.0", + "windows-sys 0.52.0", ] [[package]] @@ -3826,15 +3524,9 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "scratch" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scroll" @@ -3853,25 +3545,19 @@ checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.74", ] [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.8", + "untrusted 0.9.0", ] -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - [[package]] name = "secrecy" version = "0.8.0" @@ -3883,11 +3569,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -3896,9 +3582,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -3906,9 +3592,9 @@ dependencies = [ [[package]] name = "self-replace" -version = "1.3.7" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525db198616b2bcd0f245daf7bfd8130222f7ee6af9ff9984c19a61bf1160c55" +checksum = "f7828a58998685d8bf5a3c5e7a3379a5867289c20828c3ee436280b44b598515" dependencies = [ "fastrand 1.9.0", "tempfile", @@ -3917,50 +3603,52 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.152" +version = "1.0.206" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "5b3e4cd94123dd520a128bcd11e34d9e9e423e7e3e50425cb1b4b1e3549d0284" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.206" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "fabfb6138d2383ea8208cf98ccf69cdfb1aff4088460681d84189aa259762f97" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.74", ] [[package]] name = "serde_json" -version = "1.0.91" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" +checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d" dependencies = [ - "itoa 1.0.5", + "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_path_to_error" -version = "0.1.9" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b04f22b563c91331a10074bda3dd5492e3cc39d56bd557e91c0af42b6c7341" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ + "itoa", "serde", ] @@ -3977,9 +3665,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -3991,19 +3679,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.5", + "itoa", "ryu", "serde", ] [[package]] name = "serde_yaml" -version = "0.9.17" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb06d4b6cdaef0e0c51fa881acb721bed3c924cfaa71d9c94a3b771dfdf6567" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 1.9.2", - "itoa 1.0.5", + "indexmap 2.3.0", + "itoa", "ryu", "serde", "unsafe-libyaml", @@ -4020,9 +3708,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -4031,9 +3719,9 @@ dependencies = [ [[package]] name = "sha1_smol" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] name = "sha2" @@ -4048,9 +3736,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -4063,19 +3751,13 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - [[package]] name = "simple_asn1" version = "0.6.2" @@ -4119,9 +3801,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -4134,9 +3816,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "snafu" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0656e7e3ffb70f6c39b3c2a86332bb74aa3c679da781642590f3c1118c5045" +checksum = "e4de37ad025c587a29e8f3f5605c00f70b98715ef90b9061a815b9e59e9042d6" dependencies = [ "backtrace", "doc-comment", @@ -4145,31 +3827,21 @@ dependencies = [ [[package]] name = "snafu-derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475b3bbe5245c26f2d8a6f62d67c1f30eb9fffeccee721c45d162c3ebbdf81b2" +checksum = "990079665f075b699031e9c08fd3ab99be5029b96f3b78dc0709e8f77e4efebf" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "socket2" -version = "0.4.7" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4183,9 +3855,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin" -version = "0.9.4" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ "lock_api", ] @@ -4208,30 +3880,30 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.53", + "syn 2.0.74", ] [[package]] @@ -4242,9 +3914,9 @@ checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -4253,9 +3925,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.53" +version = "2.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" +checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" dependencies = [ "proc-macro2", "quote", @@ -4268,23 +3940,11 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.107", - "unicode-xid", -] - [[package]] name = "sysinfo" -version = "0.30.7" +version = "0.30.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c385888ef380a852a16209afc8cfad22795dd8873d69c9a14d2e2088f118d18" +checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" dependencies = [ "cfg-if", "core-foundation-sys", @@ -4318,9 +3978,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" dependencies = [ "filetime", "libc", @@ -4329,14 +3989,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", - "fastrand 2.0.2", + "fastrand 2.1.0", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4352,9 +4013,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -4371,46 +4032,50 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.74", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ + "cfg-if", "once_cell", ] [[package]] name = "time" -version = "0.3.17" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ - "itoa 1.0.5", + "deranged", + "itoa", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -4418,16 +4083,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.6" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -4442,55 +4108,54 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.6", + "socket2", "tokio-macros", "tracing", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.74", ] [[package]] name = "tokio-native-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", @@ -4513,7 +4178,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls 0.21.12", "tokio", ] @@ -4530,20 +4195,19 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-io", "futures-sink", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "pin-project-lite", "slab", "tokio", - "tracing", ] [[package]] @@ -4557,9 +4221,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", @@ -4569,20 +4233,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.9" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.3.0", "serde", "serde_spanned", "toml_datetime", @@ -4637,7 +4301,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.74", ] [[package]] @@ -4681,9 +4345,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "ttf-parser" @@ -4707,15 +4371,15 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "unicase" @@ -4728,36 +4392,36 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.10" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -4797,29 +4461,23 @@ dependencies = [ [[package]] name = "urlencoding" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9" - -[[package]] -name = "utf8-width" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.2.2" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.15", "serde", ] @@ -4837,9 +4495,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vswhom" @@ -4874,9 +4532,9 @@ dependencies = [ [[package]] name = "vte_generate_state_changes" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" +checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e" dependencies = [ "proc-macro2", "quote", @@ -4884,9 +4542,9 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" @@ -4900,43 +4558,13 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] -[[package]] -name = "warp" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed7b8be92646fc3d18b06147664ebc5f48d222686cb11a8755e561a735aacc6d" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "headers", - "http", - "hyper", - "log", - "mime", - "mime_guess", - "percent-encoding", - "pin-project", - "rustls-pemfile 0.2.1", - "scoped-tls", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-stream", - "tokio-util", - "tower-service", - "tracing", -] - [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -4970,7 +4598,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.74", "wasm-bindgen-shared", ] @@ -5004,7 +4632,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.74", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5017,9 +4645,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-bindgen-test" -version = "0.3.34" +version = "0.3.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db36fc0f9fb209e88fb3642590ae0205bb5a56216dabd963ba15879fe53a30b" +checksum = "d9bf62a58e0780af3e852044583deee40983e5886da43a271dd772379987667b" dependencies = [ "console_error_panic_hook", "js-sys", @@ -5031,12 +4659,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.34" +version = "0.3.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0734759ae6b3b1717d661fe4f016efcfb9828f5edb4520c18eaee05af3b43be9" +checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" dependencies = [ "proc-macro2", "quote", + "syn 2.0.74", ] [[package]] @@ -5068,7 +4697,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.3", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -5148,11 +4777,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -5168,7 +4797,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core 0.52.0", - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -5178,7 +4807,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efc5cf48f83140dcaab716eeaea345f9e93d0018fb81162753a3f76c3397b538" dependencies = [ "windows-core 0.53.0", - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -5187,7 +4816,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -5197,31 +4826,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" dependencies = [ "windows-result", - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] name = "windows-result" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" dependencies = [ - "windows-targets 0.52.4", -] - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.52.6", ] [[package]] @@ -5248,7 +4862,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -5283,17 +4906,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -5310,9 +4934,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -5328,9 +4952,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -5346,9 +4970,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -5364,9 +4994,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -5382,9 +5012,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -5400,9 +5030,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -5418,15 +5048,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.6" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -5453,13 +5083,13 @@ dependencies = [ [[package]] name = "wiremock" -version = "0.5.17" +version = "0.5.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12316b50eb725e22b2f6b9c4cbede5b7b89984274d113a7440c86e5c3fc6f99b" +checksum = "13a3a53eaf34f390dd30d7b1b078287dd05df2aa2e21a589ccb80f5c7253c2e9" dependencies = [ "assert-json-diff", "async-trait", - "base64 0.13.1", + "base64 0.21.7", "deadpool", "futures", "futures-timer", @@ -5478,7 +5108,7 @@ name = "wstest" version = "0.1.0" dependencies = [ "base64 0.13.1", - "clap 4.5.4", + "clap 4.5.15", "either", "enso-prelude", "futures", @@ -5513,43 +5143,38 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.74", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" [[package]] name = "zip" -version = "0.6.3" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537ce7411d25e54e8ae21a7ce0b15840e7bfcff15b51d697ec3266cc76bdf080" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ "byteorder", "crc32fast", diff --git a/Cargo.toml b/Cargo.toml index 3184943284a..e3dbac6a697 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,6 @@ resolver = "2" members = [ "app/rust-ffi", "build/cli", - "build/macros/proc-macro", "build/ci-gen", "build/cli", "build/install", @@ -28,12 +27,6 @@ members = [ "tools/language-server/wstest", ] -# We are using a version with extended functionality. The changes have been PR'd upstream: -# https://github.com/rustwasm/console_error_panic_hook/pull/24 -# Remove this patch when the issue is resolved. -[patch.crates-io] -console_error_panic_hook = { git = 'https://github.com/enso-org/console_error_panic_hook' } - [profile.dev] opt-level = 0 lto = false @@ -73,7 +66,6 @@ opt-level = 2 inherits = "dev" opt-level = 1 lto = false -debug = "line-tables-only" debug-assertions = true [workspace.lints.rust] @@ -106,6 +98,8 @@ directories = { version = "5.0.1" } dirs = { version = "5.0.1" } flate2 = { version = "1.0.28" } indicatif = { version = "0.17.7", features = ["tokio"] } +mime = "0.3.16" +new_mime_guess = "4.0.1" multimap = { version = "0.9.1" } native-windows-gui = { version = "1.0.13" } nix = { version = "0.27.1" } @@ -113,10 +107,9 @@ octocrab = { git = "https://github.com/enso-org/octocrab", default-features = fa "rustls", ] } path-absolutize = "3.1.1" -platforms = { version = "3.2.0", features = ["serde"] } portpicker = { version = "0.1.1" } regex = { version = "1.6.0" } -serde = { version = "1.0.130", features = ["derive", "rc"] } +serde = { version = "1", features = ["derive", "rc"] } serde_yaml = { version = "0.9.16" } sha2 = { version = "0.10.8" } sysinfo = { version = "0.30.7" } @@ -127,26 +120,22 @@ tokio-util = { version = "0.7.10", features = ["full"] } tracing = { version = "0.1.40" } tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } walkdir = { version = "2.5.0" } -wasm-bindgen = { version = "0.2.92", features = [] } +wasm-bindgen = { version = "0.2.92", default-features = false } wasm-bindgen-test = { version = "0.3.34" } -windows = { version = "0.52.0", features = ["Win32", "Win32_UI", "Win32_UI_Shell", "Win32_System", "Win32_System_LibraryLoader", "Win32_Foundation", "Win32_System_Com"] } +windows = { version = "0.52.0", features = ["Win32_UI", "Win32_UI_Shell", "Win32_System_LibraryLoader", "Win32_System_Com"] } winreg = { version = "0.52.0" } anyhow = { version = "1.0.66" } -failure = { version = "0.1.8" } -derive_more = { version = "0.99" } +derive_more = { version = "1.0", features = ["index", "index_mut", "deref", "deref_mut", "display", "from", "into", "as_ref", "add", "add_assign"] } boolinator = { version = "2.4.0" } -derivative = { version = "2.2" } -futures = { version = "0.3" } +futures = { version = "0.3", default-features = false, features = ["std", "executor"]} +futures-util = { version = "0.3", default-features = false } itertools = { version = "0.12.1" } lazy_static = { version = "1.4" } serde_json = { version = "1.0", features = ["raw_value"] } owned_ttf_parser = { version = "0.15.1" } convert_case = { version = "0.6.0" } -rustybuzz = { version = "0.5.1" } bincode = { version = "2.0.0-rc.1" } -byte-unit = { version = "5.1.4", features = ["serde"] } bytes = { version = "1.1.0" } -matches = { version = "0.1" } console_error_panic_hook = { version = "0.1.6" } reqwest = { version = "0.11.27", default-features = false, features = [ "rustls-tls", @@ -161,14 +150,6 @@ syn = { version = "2.0", features = [ "visit", "visit-mut", ] } -syn_1 = { package = "syn", version = "1.0", features = [ - "full", - "extra-traits", - "printing", - "parsing", - "visit", - "visit-mut", -] } quote = { version = "1.0.23" } semver = { version = "1.0.0", features = ["serde"] } strum = { version = "0.26.2", features = ["derive"] } diff --git a/build/base/Cargo.toml b/build/base/Cargo.toml index 95b461d6368..06bab2af6a0 100644 --- a/build/base/Cargo.toml +++ b/build/base/Cargo.toml @@ -7,11 +7,10 @@ edition = "2021" [dependencies] anyhow = { workspace = true } fn-error-context = "0.2.0" -futures-util = "0.3.24" +futures-util = { workspace = true } futures = { workspace = true } -serde = "1.0.145" +serde = { workspace = true } serde_json = { workspace = true } -serde_yaml = { workspace = true } tracing = { workspace = true } [lints] diff --git a/build/base/src/extensions.rs b/build/base/src/extensions.rs index edd44706371..f719772fd8a 100644 --- a/build/base/src/extensions.rs +++ b/build/base/src/extensions.rs @@ -5,13 +5,10 @@ // === Export === // ============== -pub mod from_string; pub mod future; -pub mod iterator; pub mod maps; pub mod option; pub mod os_str; pub mod path; pub mod pathbuf; pub mod result; -pub mod str; diff --git a/build/base/src/extensions/from_string.rs b/build/base/src/extensions/from_string.rs deleted file mode 100644 index 3422e35fdf9..00000000000 --- a/build/base/src/extensions/from_string.rs +++ /dev/null @@ -1,41 +0,0 @@ -//!Module with utilities for converting string-like values into other types. - -use crate::prelude::*; - -use anyhow::Context; -use std::any::type_name; - - - -/// An equivalent of standard's library `std::str::FromStr` trait, but with nice error messages. -pub trait FromString: Sized { - /// Parse a string into a value of this type. See: [`std::str::FromStr::from_str`]. - fn from_str(s: &str) -> Result; - - /// Parse a string into a value of this type and then convert it to `R`. - fn parse_into(text: impl AsRef) -> Result - where - Self: TryInto, - >::Error: Into, { - let value = Self::from_str(text.as_ref())?; - value.try_into().anyhow_err().context(format!( - "Failed to convert {} => {}.", - type_name::(), - type_name::(), - )) - } -} - -impl FromString for T -where - T: std::str::FromStr, - T::Err: Into, -{ - fn from_str(text: &str) -> Result { - text.parse::().anyhow_err().context(format!( - r#"Failed to parse "{}" as {}."#, - text, - type_name::() - )) - } -} diff --git a/build/base/src/extensions/future.rs b/build/base/src/extensions/future.rs index 648ad3be404..07da34b6431 100644 --- a/build/base/src/extensions/future.rs +++ b/build/base/src/extensions/future.rs @@ -2,30 +2,17 @@ use crate::prelude::*; -use futures_util::future::ErrInto; -use futures_util::future::Map; -use futures_util::future::MapErr; use futures_util::future::MapOk; -use futures_util::stream; use futures_util::FutureExt as _; use futures_util::TryFutureExt as _; /// Extension methods for [`Future`]. -pub trait FutureExt: Future { - /// Discard the result of this future. - fn void(self) -> Map ()> - where Self: Sized { - self.map(drop) - } -} +pub trait FutureExt: Future {} impl FutureExt for T where T: Future {} -type FlattenResultFn = - fn(std::result::Result, E>) -> std::result::Result; - /// Extension methods for [`TryFuture`], i.e. the Result-yielding [`Future`] pub trait TryFutureExt: TryFuture { /// Discard the result of successful future. @@ -55,42 +42,6 @@ pub trait TryFutureExt: TryFuture { C: Display + Send + Sync + 'static, { self.into_future().map(|res| res.with_context(context)).boxed() } - - /// Convert the error type of this future to [`anyhow::Error`]. - fn anyhow_err(self) -> MapErr anyhow::Error> - where - Self: Sized, - // TODO: we should rely on `into` rather than `from` - anyhow::Error: From, { - self.map_err(anyhow::Error::from) - } - - /// If the future is successful, apply the function to the result and return the new future. - fn and_then_sync( - self, - f: F, - ) -> Map, F>, FlattenResultFn> - where - Self: Sized, - F: FnOnce(Self::Ok) -> std::result::Result, - Self::Error: Into, - { - self.err_into().map_ok(f).map(std::result::Result::flatten) - } } impl TryFutureExt for T where T: TryFuture {} - -/// Extension methods for [`TryStream`], i.e. a [`Stream`] that produces [`Result`]s. -pub trait TryStreamExt: TryStream { - /// Wrap all the errors into [`anyhow::Error`]. - fn anyhow_err(self) -> stream::MapErr anyhow::Error> - where - Self: Sized, - // TODO: we should rely on `into` rather than `from` - anyhow::Error: From, { - self.map_err(anyhow::Error::from) - } -} - -impl TryStreamExt for T where T: TryStream {} diff --git a/build/base/src/extensions/iterator.rs b/build/base/src/extensions/iterator.rs deleted file mode 100644 index 38cbc198769..00000000000 --- a/build/base/src/extensions/iterator.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! Extension methods for `Iterator` and `Iterator`-like types. - -use crate::prelude::*; - -use std::iter::Rev; -use std::iter::Take; - - - -/// Extension methods for `Iterator` and `Iterator`-like types. -pub trait IteratorExt: Iterator { - /// try_filter - /// Transforms an [Iterator]'s items into `Result`s, and filters out the `Err` variants. - fn try_filter(mut self, mut f: impl FnMut(&Self::Item) -> Result) -> Result - where - Self: Sized, - R: Default + Extend + Sized, { - self.try_fold(default(), |mut acc: R, item| { - acc.extend(f(&item)?.then_some(item)); - Ok(acc) - }) - } - - /// Transforms an [Iterator]'s items into `Result`s, and filters out the `Err` variants. - fn try_map(mut self, mut f: impl FnMut(Self::Item) -> Result) -> Result - where - Self: Sized, - R: Default + Extend + Sized, { - self.try_fold(default(), |mut acc: R, item| { - acc.extend_one(f(item)?); - Ok(acc) - }) - } -} - -impl IteratorExt for I {} - -/// Extension methods for `Iterator` and `Iterator`-like types.s -pub trait TryIteratorExt: Iterator { - /// The result of successful iteration. - type Ok; - - /// Collects the results of the iterator into a `Result>`. - fn try_collect_vec(self) -> Result>; -} - -impl TryIteratorExt for T -where - T: Iterator>, - E: Into, -{ - type Ok = U; - fn try_collect_vec(self) -> Result> { - self.map(|i| i.anyhow_err()).collect::>>() - } -} - -#[allow(missing_docs)] -pub trait ExactDoubleEndedIteratorExt: ExactSizeIterator + DoubleEndedIterator + Sized { - /// Take the last n elements of the iterator. - fn take_last_n(self, n: usize) -> Rev>> { - self.rev().take(n).rev() - } -} - -impl ExactDoubleEndedIteratorExt for T where T: ExactSizeIterator + DoubleEndedIterator {} diff --git a/build/base/src/extensions/path.rs b/build/base/src/extensions/path.rs index 3b2e8eab41f..307f877b9b3 100644 --- a/build/base/src/extensions/path.rs +++ b/build/base/src/extensions/path.rs @@ -62,20 +62,7 @@ pub trait PathExt: AsRef { fn write_as_json(&self, value: &T) -> Result { trace!("Writing JSON to {}.", self.as_ref().display()); let file = crate::fs::create(self)?; - serde_json::to_writer(file, value).anyhow_err() - } - - /// Parse this file's contents as a YAML-serialized value. - fn read_to_yaml(&self) -> Result { - let content = crate::fs::read_to_string(self)?; - serde_yaml::from_str(&content).anyhow_err() - } - - /// Write this file with a YAML-serialized value. - fn write_as_yaml(&self, value: &T) -> Result { - trace!("Writing YAML to {}.", self.as_ref().display()); - let file = crate::fs::create(self)?; - serde_yaml::to_writer(file, value).anyhow_err() + Ok(serde_json::to_writer(file, value)?) } /// Get the path as `str`. @@ -163,25 +150,6 @@ pub trait PathExt: AsRef { impl> PathExt for T {} -/// A method that outputs a path to a formatter using [`Path::display`]. -/// -/// This is useful in combination with macros like `Derivative`, as demonstrated in the example -/// below. -/// -/// # Example -/// ```ignore -/// #[derive(Derivative)] -/// #[derivative(Debug)] -/// pub struct Foo { -/// #[derivative(Debug(format_with = "display_fmt"))] -/// path: PathBuf, -/// } -/// ``` -pub fn display_fmt(path: &Path, f: &mut Formatter) -> std::fmt::Result { - Display::fmt(&path.display(), f) -} - - /// A result of splitting a path into its filename components. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct SplitFilename<'a> { diff --git a/build/base/src/extensions/result.rs b/build/base/src/extensions/result.rs index 3718dd4f520..e4f8040a5f2 100644 --- a/build/base/src/extensions/result.rs +++ b/build/base/src/extensions/result.rs @@ -9,19 +9,6 @@ use std::future::Ready; /// Extension methods for [`Result`]. pub trait ResultExt: Sized { - /// Maps the value and wraps it as a [`Future`]. - #[allow(clippy::type_complexity)] - fn map_async<'a, T2, F, Fut>( - self, - f: F, - ) -> Either< - futures::future::Map std::result::Result>, - Ready>, - > - where - F: FnOnce(T) -> Fut, - Fut: Future + 'a; - /// Maps the `Ok` value to a [`Future`] value. If the result is `Err`, the error is returned /// as a [`std::future::Ready`] future. fn and_then_async<'a, T2, E2, F, Fut>( @@ -35,63 +22,12 @@ pub trait ResultExt: Sized { T2: Send + 'a, E2: Send + 'a; - - /// Executes another future if this is an error. The error value is passed to a closure to - /// create this subsequent future. - fn or_else_async(self, f: F) -> Either, futures::future::IntoFuture> - where - F: FnOnce(E) -> Fut, - Fut: TryFuture; - - /// Convert the error type to [`anyhow::Error`]. - /// - /// If there are additional context-specific information, use [`context`] instead. - fn anyhow_err(self) -> Result - where E: Into; - - /// Convert the `[Result]<[Future]>` to `Future`. - fn flatten_fut( - self, - ) -> Either>, futures::future::IntoFuture> - where T: TryFuture>; - /// Checks if the result is `Ok` and contains the given value. fn contains(&self, x: &U) -> bool where U: PartialEq; } impl ResultExt for std::result::Result { - fn map_async<'a, T2, F, Fut>( - self, - f: F, - ) -> Either< - futures::future::Map std::result::Result>, - Ready>, - > - where - F: FnOnce(T) -> Fut, - Fut: Future + 'a, - { - match self { - Ok(v) => f(v).map(Ok as fn(T2) -> std::result::Result).left_future(), - Err(e) => ready(Err(e)).right_future(), - } - } - - fn or_else_async<'a, F, Fut>( - self, - f: F, - ) -> Either, futures::future::IntoFuture> - where - F: FnOnce(E) -> Fut, - Fut: TryFuture, - { - match self { - Ok(v) => ready(Ok(v)).left_future(), - Err(e) => f(e).into_future().right_future(), - } - } - fn and_then_async<'a, T2, E2, F, Fut>( self, f: F, @@ -109,21 +45,6 @@ impl ResultExt for std::result::Result { } } - fn anyhow_err(self) -> Result - where E: Into { - self.map_err(E::into) - } - - fn flatten_fut( - self, - ) -> Either>, futures::future::IntoFuture> - where T: TryFuture> { - match self { - Ok(fut) => fut.into_future().right_future(), - Err(e) => ready(Err(T::Error::from(e))).left_future(), - } - } - fn contains(&self, x: &U) -> bool where U: PartialEq { match self { diff --git a/build/base/src/extensions/str.rs b/build/base/src/extensions/str.rs deleted file mode 100644 index 8c600649e51..00000000000 --- a/build/base/src/extensions/str.rs +++ /dev/null @@ -1,34 +0,0 @@ -//! Extensions fot string-like types. - -use crate::prelude::*; - - - -/// Extension methods for strings and similar types. -pub trait StrLikeExt { - /// Convenience variant of `FromString::from_str`. - /// - /// Should be preferred over [`str::parse`] due to better error messages. - // FIXME: This needs better name! However, we cannot use `parse` as it conflicts with - // `str::parse`. As a method on `str`, it would take priority over an extension trait. - fn parse2(&self) -> Result; - - /// Convenience variant of `FromString::parse_into`. - fn parse_through(&self) -> Result - where - T: FromString + TryInto, - >::Error: Into; -} - -impl> StrLikeExt for S { - fn parse2(&self) -> Result { - U::from_str(self.as_ref()) - } - - fn parse_through(&self) -> Result - where - T: FromString + TryInto, - >::Error: Into, { - T::parse_into(self.as_ref()) - } -} diff --git a/build/base/src/fs.rs b/build/base/src/fs.rs index 7ce42ddb50f..758442721b5 100644 --- a/build/base/src/fs.rs +++ b/build/base/src/fs.rs @@ -49,12 +49,6 @@ pub fn create(path: impl AsRef) -> Result { wrappers::create(&path) } -/// Read the file content and parse it using [`FromString`]. -#[context("Failed to read the file: {}", path.as_ref().display())] -pub fn read_string_into(path: impl AsRef) -> Result { - read_to_string(&path)?.parse2() -} - /// Create a directory (and all missing parent directories), /// /// Does not fail when a directory already exists. @@ -63,7 +57,7 @@ pub fn create_dir_if_missing(path: impl AsRef) -> Result { let result = std::fs::create_dir_all(&path); match result { Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => Ok(()), - result => result.anyhow_err(), + result => Ok(result?), } } @@ -89,7 +83,7 @@ pub fn remove_dir_if_exists(path: impl AsRef) -> Result { let result = std::fs::remove_dir_all(&path); match result { Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()), - result => result.anyhow_err(), + result => Ok(result?), } } @@ -102,7 +96,7 @@ pub fn remove_file_if_exists(path: impl AsRef) -> Result<()> { let result = std::fs::remove_file(&path); match result { Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()), - result => result.anyhow_err(), + result => Ok(result?), } } diff --git a/build/base/src/fs/wrappers.rs b/build/base/src/fs/wrappers.rs index 5f9794c2ed4..83c7ef55dad 100644 --- a/build/base/src/fs/wrappers.rs +++ b/build/base/src/fs/wrappers.rs @@ -18,31 +18,31 @@ use std::fs::Metadata; /// See [std::fs::metadata]. #[context("Failed to obtain metadata for file: {}", path.as_ref().display())] pub fn metadata>(path: P) -> Result { - std::fs::metadata(&path).anyhow_err() + Ok(std::fs::metadata(&path)?) } /// See [std::fs::symlink_metadata]. #[context("Failed to obtain symlink metadata for file: {}", path.as_ref().display())] pub fn symlink_metadata>(path: P) -> Result { - std::fs::symlink_metadata(&path).anyhow_err() + Ok(std::fs::symlink_metadata(&path)?) } /// See [std::fs::copy]. #[context("Failed to copy file from {} to {}", from.as_ref().display(), to.as_ref().display())] pub fn copy(from: impl AsRef, to: impl AsRef) -> Result { - std::fs::copy(&from, &to).anyhow_err() + Ok(std::fs::copy(&from, &to)?) } /// See [std::fs::rename]. #[context("Failed to rename file from {} to {}", from.as_ref().display(), to.as_ref().display())] pub fn rename(from: impl AsRef, to: impl AsRef) -> Result { - std::fs::rename(&from, &to).anyhow_err() + Ok(std::fs::rename(&from, &to)?) } /// See [std::fs::read]. #[context("Failed to read the file: {}", path.as_ref().display())] pub fn read(path: impl AsRef) -> Result> { - std::fs::read(&path).anyhow_err() + Ok(std::fs::read(&path)?) } /// See [std::fs::read_dir]. @@ -60,41 +60,41 @@ pub fn read_dir(path: impl AsRef) -> Result) -> Result { - std::fs::read_to_string(&path).anyhow_err() + Ok(std::fs::read_to_string(&path)?) } /// See [std::fs::write]. #[context("Failed to write path: {}", path.as_ref().display())] pub fn write(path: impl AsRef, contents: impl AsRef<[u8]>) -> Result { - std::fs::write(&path, contents).anyhow_err() + Ok(std::fs::write(&path, contents)?) } /// See [std::fs::File::open]. #[context("Failed to open path for reading: {}", path.as_ref().display())] pub fn open(path: impl AsRef) -> Result { - File::open(&path).anyhow_err() + Ok(File::open(&path)?) } /// See [std::fs::File::create]. #[context("Failed to open path for writing: {}", path.as_ref().display())] pub fn create(path: impl AsRef) -> Result { - File::create(&path).anyhow_err() + Ok(File::create(&path)?) } /// See [std::fs::canonicalize]. #[context("Failed to canonicalize path: {}", path.as_ref().display())] pub fn canonicalize(path: impl AsRef) -> Result { - std::fs::canonicalize(&path).anyhow_err() + Ok(std::fs::canonicalize(&path)?) } /// See [std::fs::create_dir_all]. #[context("Failed to create missing directories no path: {}", path.as_ref().display())] pub fn create_dir_all(path: impl AsRef) -> Result { - std::fs::create_dir_all(&path).anyhow_err() + Ok(std::fs::create_dir_all(&path)?) } /// See [std::fs::set_permissions]. #[context("Failed to permissions on file: {}", path.as_ref().display())] pub fn set_permissions(path: impl AsRef, perm: std::fs::Permissions) -> Result { - std::fs::set_permissions(&path, perm).anyhow_err() + Ok(std::fs::set_permissions(&path, perm)?) } diff --git a/build/base/src/lib.rs b/build/base/src/lib.rs index c92d73e5fbf..559fede1564 100644 --- a/build/base/src/lib.rs +++ b/build/base/src/lib.rs @@ -3,10 +3,6 @@ //! //! Currently it is employed by the native build scripts code. -// === Features === -#![feature(result_flattening)] -#![feature(associated_type_bounds)] -#![feature(extend_one)] // === Non-Standard Linter Configuration === #![warn(missing_docs)] @@ -54,19 +50,17 @@ pub mod prelude { pub use std::path::PathBuf; pub use std::pin::pin; pub use std::pin::Pin; + pub use std::str::FromStr; pub use std::sync::Arc; - pub use crate::extensions::from_string::FromString; + // pub use crate::extensions::from_string::FromString; pub use crate::extensions::future::FutureExt as _; pub use crate::extensions::future::TryFutureExt as _; - pub use crate::extensions::iterator::IteratorExt as _; - pub use crate::extensions::iterator::TryIteratorExt as _; pub use crate::extensions::option::OptionExt as _; pub use crate::extensions::os_str::OsStrExt as _; pub use crate::extensions::path::PathExt as _; pub use crate::extensions::pathbuf::PathBufExt as _; pub use crate::extensions::result::ResultExt as _; - pub use crate::extensions::str::StrLikeExt as _; pub use anyhow::anyhow; pub use anyhow::bail; @@ -77,7 +71,6 @@ pub mod prelude { pub use futures_util::select; pub use futures_util::stream::BoxStream; pub use futures_util::try_join; - pub use futures_util::AsyncWrite; pub use futures_util::FutureExt as _; pub use futures_util::Stream; pub use futures_util::StreamExt as _; diff --git a/build/build/Cargo.toml b/build/build/Cargo.toml index cc09f7e709c..419daabbaff 100644 --- a/build/build/Cargo.toml +++ b/build/build/Cargo.toml @@ -13,7 +13,7 @@ base64 = "0.13.0" bytes = { workspace = true } chrono = { workspace = true } clap = { workspace = true } -derivative = { workspace = true } +derive-where = { workspace = true } derive_more = { workspace = true } dirs = { workspace = true } futures = { workspace = true } @@ -25,8 +25,8 @@ enso-enso-font = { path = "../../lib/rust/enso-font" } enso-font = { path = "../../lib/rust/font" } enso-install-config = { path = "../install/config" } ide-ci = { path = "../ci_utils" } -mime = "0.3.16" -new_mime_guess = "4.0.1" +mime = { workspace = true } +new_mime_guess = { workspace = true } octocrab = { workspace = true } path-slash = "0.2.1" port_check = "0.1.5" diff --git a/build/build/src/aws/s3.rs b/build/build/src/aws/s3.rs index ea2be5002cd..31bb5440307 100644 --- a/build/build/src/aws/s3.rs +++ b/build/build/src/aws/s3.rs @@ -25,10 +25,10 @@ pub async fn client_from_env() -> aws_sdk_s3::Client { } /// Everything we need to get/put files to S3. -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone)] +#[derive_where(Debug)] pub struct BucketContext { - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub client: aws_sdk_s3::Client, pub bucket: String, pub upload_acl: ObjectCannedAcl, @@ -127,7 +127,7 @@ impl BucketContext { pub async fn get_yaml(&self, path: &str) -> Result { let text = self.get(path).await?.collect().await?; - serde_yaml::from_reader(text.reader()).anyhow_err() + Ok(serde_yaml::from_reader(text.reader())?) } pub async fn put_yaml(&self, path: &str, data: &impl Serialize) -> Result { @@ -226,8 +226,8 @@ mod tests { assert_eq!(headers.content_type.to_string().as_str(), expected_type); } - case("wasm_imports.js.gz", Some("gzip"), "application/javascript"); - case("index.js", None, "application/javascript"); + case("wasm_imports.js.gz", Some("gzip"), "text/javascript"); + case("index.js", None, "text/javascript"); case("style.css", None, "text/css"); case("ide.wasm", None, "application/wasm"); case("ide.wasm.gz", Some("gzip"), "application/wasm"); diff --git a/build/build/src/ci_gen.rs b/build/build/src/ci_gen.rs index 9a5e63ea374..8cc3c639a9c 100644 --- a/build/build/src/ci_gen.rs +++ b/build/build/src/ci_gen.rs @@ -234,8 +234,7 @@ pub fn cleaning_step( } /// Data needed to generate a typical sequence of CI steps invoking `./run` script. -#[derive(Derivative)] -#[derivative(Debug)] +#[derive_where(Debug)] pub struct RunStepsBuilder { /// The command passed to `./run` script. pub run_command: String, @@ -244,7 +243,7 @@ pub struct RunStepsBuilder { /// Customize the step that runs the command. /// /// Allows replacing the run step with one or more custom steps. - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub customize: Option Vec>>, } @@ -339,7 +338,6 @@ pub fn runs_on(os: OS, runner_type: RunnerType) -> Vec { (OS::Linux, RunnerType::GitHubHosted) => vec![RunnerLabel::LinuxLatest], (OS::MacOS, RunnerType::SelfHosted) => vec![RunnerLabel::SelfHosted, RunnerLabel::MacOS], (OS::MacOS, RunnerType::GitHubHosted) => vec![RunnerLabel::MacOSLatest], - _ => panic!("Unsupported OS and runner type combination: {os} {runner_type}."), } } diff --git a/build/build/src/config.rs b/build/build/src/config.rs index 7e110a95e70..9c85195557d 100644 --- a/build/build/src/config.rs +++ b/build/build/src/config.rs @@ -82,8 +82,8 @@ impl TryFrom for Config { let mut required_versions = HashMap::new(); for (program, version_req) in value.required_versions { required_versions.insert( - ::from_str(&program)?, - ::from_str(&version_req)?, + RecognizedProgram::from_str(&program)?, + VersionReq::from_str(&version_req)?, ); } diff --git a/build/build/src/context.rs b/build/build/src/context.rs index ca1e86055ba..4730c2e303e 100644 --- a/build/build/src/context.rs +++ b/build/build/src/context.rs @@ -2,7 +2,6 @@ use crate::prelude::*; use crate::paths::TargetTriple; -use derivative::Derivative; use ide_ci::github; use octocrab::models::repos::Release; use octocrab::models::ReleaseId; @@ -10,8 +9,7 @@ use octocrab::models::ReleaseId; /// The basic, common information available in this application. -#[derive(Clone, Derivative, derive_more::Deref)] -#[derivative(Debug)] +#[derive(Clone, Debug, derive_more::Deref)] pub struct BuildContext { #[deref] pub inner: crate::project::Context, @@ -51,7 +49,7 @@ impl BuildContext { let repository = self.remote_repo_handle(); let designator_cp = designator.clone(); async move { - let release = if let Ok(id) = designator.parse2::() { + let release = if let Ok(id) = designator.parse::() { repository.find_release_by_id(id).await? } else { match designator.as_str() { diff --git a/build/build/src/engine.rs b/build/build/src/engine.rs index 1fe5564ebce..4586bc2ee56 100644 --- a/build/build/src/engine.rs +++ b/build/build/src/engine.rs @@ -74,7 +74,7 @@ pub async fn download_project_templates(client: reqwest::Client, enso_root: Path } } - let _result = ide_ci::future::try_join_all(futures, AsyncPolicy::FutureParallelism).await?; + let _result = futures::future::try_join_all(futures).await?; debug!("Completed downloading templates"); Ok(()) } diff --git a/build/build/src/engine/context.rs b/build/build/src/engine/context.rs index 84a1f684b8f..61d3c104240 100644 --- a/build/build/src/engine/context.rs +++ b/build/build/src/engine/context.rs @@ -49,8 +49,8 @@ pub fn format_option_variant(value: &Option, f: &mut Formatter) -> std::fm } } -#[derive(derive_more::Deref, derive_more::DerefMut, derivative::Derivative)] -#[derivative(Debug)] +#[derive(derive_more::Deref, derive_more::DerefMut)] +#[derive_where(Debug)] pub struct RunContext { #[deref] #[deref_mut] @@ -59,7 +59,7 @@ pub struct RunContext { pub paths: Paths, /// If set, the engine package (used for creating bundles) will be obtained through this /// provider rather than built from source along the other Engine components. - #[derivative(Debug(format_with = "format_option_variant"))] + #[derive_where(skip)] pub external_runtime: Option>, } @@ -354,16 +354,14 @@ impl RunContext { for package in ret.packages() { let package_dir = package.dir(); let binary_extensions = [EXE_EXTENSION, DLL_EXTENSION]; - let binaries = binary_extensions + let binaries: Vec = binary_extensions .into_iter() - .map(|extension| { + .flat_map(|extension| { let pattern = package_dir.join_iter(["**", "*"]).with_extension(extension); - glob::glob(pattern.as_str())?.try_collect_vec() + glob::glob(pattern.as_str()).expect("Incorrect glob pattern") }) - .try_collect_vec()? - .into_iter() - .flatten() - .collect_vec(); + .map(|p| p.map(|p| p.to_owned())) + .try_collect()?; debug!(?binaries, "Found executables in the package."); for binary in binaries { diff --git a/build/build/src/ide/web.rs b/build/build/src/ide/web.rs index e2d67451409..6997dbf12e9 100644 --- a/build/build/src/ide/web.rs +++ b/build/build/src/ide/web.rs @@ -17,7 +17,6 @@ use sha2::Digest; use std::process::Stdio; use tempfile::TempDir; - // ============== // === Export === // ============== @@ -176,7 +175,6 @@ pub fn target_os_flag(os: OS) -> Result<&'static str> { OS::Windows => Ok("--win"), OS::Linux => Ok("--linux"), OS::MacOS => Ok("--mac"), - _ => bail!("Not supported target for Electron client: {os}."), } } @@ -210,12 +208,12 @@ impl FallibleManipulator for ProjectManagerInfo { } } -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone)] +#[derive_where(Debug)] pub struct IdeDesktop { pub build_sbt: generated::RepoRootBuildSbt, pub repo_root: generated::RepoRoot, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub octocrab: Octocrab, pub cache: ide_ci::cache::Cache, } diff --git a/build/build/src/ide/web/fonts.rs b/build/build/src/ide/web/fonts.rs index 12d56a73834..1340bd91cfa 100644 --- a/build/build/src/ide/web/fonts.rs +++ b/build/build/src/ide/web/fonts.rs @@ -28,17 +28,17 @@ pub async fn install_html_fonts( /// [`font-style`]: https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-style #[derive(Debug, Display, Copy, Clone)] pub enum FontStyle { - #[display(fmt = "normal")] + #[display("normal")] Normal, - #[display(fmt = "italic")] + #[display("italic")] Italic, - #[display(fmt = "oblique")] + #[display("oblique")] Oblique, /// Angle is in degrees, between -90 and 90. - #[display(fmt = "oblique {_0}deg")] + #[display("oblique {_0}deg")] ObliqueWithAngle(f64), /// Angles are in degrees, between -90 and 90. - #[display(fmt = "oblique {_0}deg {_1}deg")] + #[display("oblique {_0}deg {_1}deg")] ObliqueWithAngleRange(f64, f64), } diff --git a/build/build/src/ide/web/google_font.rs b/build/build/src/ide/web/google_font.rs index d481c7059f3..4706eac688b 100644 --- a/build/build/src/ide/web/google_font.rs +++ b/build/build/src/ide/web/google_font.rs @@ -63,12 +63,12 @@ impl Family { // ==================== /// Description of the job to download the fonts. -#[derive(Derivative, Clone)] -#[derivative(Debug)] +#[derive(Clone)] +#[derive_where(Debug)] pub struct DownloadFont { pub family: Family, /// Possible authentication to GitHub (to get bigger rate limit). - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub octocrab: Octocrab, } @@ -121,7 +121,7 @@ impl Storable for DownloadFont { ) -> BoxFuture<'static, Result> { async move { for font in &mut metadata { - *font = cache.join(&font); + *font = cache.join(&*font); } Ok(metadata) } diff --git a/build/build/src/lib.rs b/build/build/src/lib.rs index a347320b35f..2f396719ee5 100644 --- a/build/build/src/lib.rs +++ b/build/build/src/lib.rs @@ -1,13 +1,10 @@ // === Features === -#![feature(try_blocks)] #![feature(hash_set_entry)] #![feature(type_alias_impl_trait)] #![feature(trait_alias)] #![feature(let_chains)] #![feature(exit_status_error)] #![feature(async_closure)] -#![feature(associated_type_bounds)] -#![feature(result_flattening)] #![feature(associated_type_defaults)] #![feature(duration_constants)] #![feature(slice_take)] @@ -67,7 +64,7 @@ pub fn get_enso_version(build_sbt_contents: &str) -> Result { // The `expect` below will not fail due to the regex definition, as is ensured by unit test. .expect("Missing subcapture #1 with version despite matching the regex.") .as_str(); - Version::parse(version_string).anyhow_err() + Ok(Version::parse(version_string)?) } pub fn get_string_assignment_value( @@ -91,17 +88,17 @@ pub fn get_string_assignment_value( /// Get version of Enso from the `build.sbt` file contents. pub fn get_graal_version(build_sbt_contents: &str) -> Result { - get_string_assignment_value(build_sbt_contents, "graalVersion")?.parse2() + Ok(get_string_assignment_value(build_sbt_contents, "graalVersion")?.parse()?) } /// Get version of GraalVM packages from the `build.sbt` file contents. pub fn get_graal_packages_version(build_sbt_contents: &str) -> Result { - get_string_assignment_value(build_sbt_contents, "graalMavenPackagesVersion")?.parse2() + Ok(get_string_assignment_value(build_sbt_contents, "graalMavenPackagesVersion")?.parse()?) } /// Get version of GraalVM packages from the `build.sbt` file contents. pub fn get_flatbuffers_version(build_sbt_contents: &str) -> Result { - get_string_assignment_value(build_sbt_contents, "flatbuffersVersion")?.parse2() + Ok(get_string_assignment_value(build_sbt_contents, "flatbuffersVersion")?.parse()?) } #[cfg(test)] diff --git a/build/build/src/paths.rs b/build/build/src/paths.rs index 53e32b5d8c8..2ec8057ce85 100644 --- a/build/build/src/paths.rs +++ b/build/build/src/paths.rs @@ -49,7 +49,7 @@ pub fn discover_standard_library_tests(repo_root: &generated::RepoRoot) -> Resul glob::glob(glob_pattern.as_str())? // Package manifest path -> Parent directory. .map(|package_path_result| Result::Ok(package_path_result?.try_parent()?.to_path_buf())) - .try_collect_vec() + .try_collect() } pub fn new_repo_root(repo_root: impl Into, triple: &TargetTriple) -> generated::RepoRoot { @@ -62,15 +62,7 @@ pub fn new_repo_root(repo_root: impl Into, triple: &TargetTriple) -> ge ) } -pub fn pretty_print_arch(arch: Arch) -> &'static str { - match arch { - Arch::X86_64 => "amd64", - Arch::AArch64 => "aarch64", - _ => panic!("Unrecognized architecture {arch}"), - } -} - -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] +#[derive(Clone, Debug, Serialize, PartialEq, Eq)] pub struct TargetTriple { pub os: OS, pub arch: Arch, @@ -90,16 +82,11 @@ impl TargetTriple { pub fn engine(&self) -> Self { self.clone() } - - /// Pretty prints architecture for our packages. Conform to GraalVM scheme as well. - pub fn arch(&self) -> &'static str { - pretty_print_arch(self.arch) - } } impl Display for TargetTriple { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - write!(f, "{}-{}-{}", self.versions.version, self.os, self.arch()) + write!(f, "{}-{}-{}", self.versions.version, self.os, self.arch) } } diff --git a/build/build/src/postgres.rs b/build/build/src/postgres.rs index 24941f19808..8f1db7b1db3 100644 --- a/build/build/src/postgres.rs +++ b/build/build/src/postgres.rs @@ -186,7 +186,7 @@ impl Postgresql { let mut cmd = Docker.run_cmd(&opts)?; cmd.stderr(Stdio::piped()); cmd.kill_on_drop(true); - let mut child = cmd.spawn().anyhow_err()?; + let mut child = cmd.spawn()?; let stderr = child .stderr .ok_or_else(|| anyhow!("Failed to access standard output of the spawned process!"))?; diff --git a/build/build/src/project.rs b/build/build/src/project.rs index 8e80c13df61..d316b9c1252 100644 --- a/build/build/src/project.rs +++ b/build/build/src/project.rs @@ -11,7 +11,6 @@ use crate::source::Source; use crate::source::WatchTargetJob; use crate::source::WithDestination; -use derivative::Derivative; use ide_ci::actions::artifacts; use ide_ci::cache; use ide_ci::cache::Cache; @@ -46,13 +45,13 @@ pub fn path_to_extract() -> Option { pub trait IsArtifact: Clone + AsRef + Debug + Sized + Send + Sync + 'static {} /// Plain artifact is just a folder with... things. -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone)] +#[derive_where(Debug)] pub struct PlainArtifact { /// Directory path. pub path: PathBuf, /// Phantom, so we can tell artifacts of different projects apart. - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub phantom: PhantomData, } @@ -71,24 +70,25 @@ impl PlainArtifact { } /// State available to all project-related operations. -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone)] +#[derive_where(Debug)] pub struct Context { /// GitHub API client. /// /// If authenticated, it will count API rate limits against our identity and allow operations /// like managing releases or downloading CI run artifacts. - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub octocrab: Octocrab, /// Stores things like downloaded release assets to save time. + #[derive_where(skip)] pub cache: Cache, /// Directory being an `enso` repository's working copy. /// /// The directory is not required to be a git repository. It is allowed to use source tarballs /// as well. - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] + #[derive_where(skip)] pub repo_root: crate::paths::generated::RepoRoot, } @@ -314,7 +314,8 @@ pub trait ProcessWrapper { ide_ci::extensions::child::ChildExt::wait_ok(self.inner()).boxed() } fn kill(&mut self) -> BoxFuture { - self.inner().kill().anyhow_err().boxed() + let f = self.inner().kill(); + async { Ok(f.await?) }.boxed() } } diff --git a/build/build/src/project/backend.rs b/build/build/src/project/backend.rs index a67436d0ecb..6245891ba5e 100644 --- a/build/build/src/project/backend.rs +++ b/build/build/src/project/backend.rs @@ -1,7 +1,6 @@ use crate::prelude::*; use crate::engine::BuildConfigurationFlags; -use crate::paths::pretty_print_arch; use crate::paths::TargetTriple; use crate::project::Context; use crate::project::IsArtifact; @@ -9,18 +8,16 @@ use crate::project::IsTarget; use crate::source::WithDestination; use crate::version::Versions; -use derivative::Derivative; use ide_ci::archive::is_archive_name; -use ide_ci::extensions::os::OsExt; use octocrab::models::repos::Asset; -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone)] +#[derive_where(Debug)] pub struct BuildInput { pub versions: Versions, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub external_runtime: Option>, } @@ -40,11 +37,9 @@ impl BuildInput { } } -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone, Debug)] pub struct Artifact { /// Location of the Project Manager distribution. - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] pub path: crate::paths::generated::ProjectManagerBundle, /// Versions of Engine that are bundled in this Project Manager distribution. /// @@ -54,7 +49,6 @@ pub struct Artifact { /// /// Artifacts built with [`ProjectManager::build`] will have exactly one engine /// bundled. - #[derivative(Debug(format_with = "ide_ci::fmt::display_list"))] pub engine_versions: Vec, } @@ -88,7 +82,7 @@ pub async fn bundled_engine_versions( let mut dir_reader = ide_ci::fs::tokio::read_dir(&project_manager_bundle.dist).await?; while let Some(entry) = dir_reader.try_next().await? { - if ide_ci::fs::tokio::metadata(&entry.path()).await?.is_dir() { + if ide_ci::fs::tokio::metadata(entry.path()).await?.is_dir() { ret.push(Version::from_str(entry.file_name().as_str())?); } } @@ -104,7 +98,7 @@ impl Backend { pub fn matches_platform(&self, name: &str) -> bool { // Sample name: "project-manager-bundle-2022.1.1-nightly.2022-04-16-linux-amd64.tar.gz" let os_matches = name.contains(self.target_os.as_str()); - let arch_matches = name.contains(pretty_print_arch(TARGET_ARCH)); + let arch_matches = name.contains(TARGET_ARCH.as_str()); os_matches && arch_matches } } diff --git a/build/build/src/project/gui.rs b/build/build/src/project/gui.rs index 95ef70b1aad..d7bfdc4adc5 100644 --- a/build/build/src/project/gui.rs +++ b/build/build/src/project/gui.rs @@ -106,14 +106,11 @@ impl IsTarget for Gui { // ================= // === BuildInfo === // ================= -#[derive(Clone, Derivative, Serialize, Deserialize)] -#[derivative(Debug)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct BuildInfo { pub commit: String, - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] pub version: Version, - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] pub engine_version: Version, pub name: String, } diff --git a/build/build/src/project/ide.rs b/build/build/src/project/ide.rs index a9c072ff50d..58e1d9b980e 100644 --- a/build/build/src/project/ide.rs +++ b/build/build/src/project/ide.rs @@ -34,7 +34,6 @@ impl Artifact { OS::Linux => "enso", OS::MacOS => "Enso.app", OS::Windows => "Enso.exe", - _ => todo!("{target_os}-{target_arch} combination is not supported"), } .into(); @@ -79,14 +78,12 @@ impl Artifact { } } -#[derive(derivative::Derivative)] -#[derivative(Debug)] +#[derive_where(Debug)] pub struct BuildInput { - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] pub version: Version, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub project_manager: BoxFuture<'static, Result>, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub gui: BoxFuture<'static, Result>, pub electron_target: Option, /// The name base used to generate CI run artifact names. @@ -141,6 +138,5 @@ pub fn electron_image_filename(target_os: OS, target_arch: Arch, version: &Versi OS::Linux => format!("enso-linux-{arch_string}-{version}.AppImage"), OS::MacOS => format!("enso-mac-{arch_string}-{version}.dmg"), OS::Windows => format!("enso-win-{arch_string}-{version}.exe"), - _ => todo!("{target_os}-{target_arch} combination is not supported"), } } diff --git a/build/build/src/project/runtime.rs b/build/build/src/project/runtime.rs index 45a6952a9d6..da253ed072d 100644 --- a/build/build/src/project/runtime.rs +++ b/build/build/src/project/runtime.rs @@ -16,8 +16,7 @@ use crate::version::Versions; const ARTIFACT_NAME: &str = "runtime"; -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone, Debug)] pub struct BuildInput { pub versions: Versions, } diff --git a/build/build/src/project_manager.rs b/build/build/src/project_manager.rs index e91f25839bc..134c7bb8256 100644 --- a/build/build/src/project_manager.rs +++ b/build/build/src/project_manager.rs @@ -13,27 +13,5 @@ pub fn url(target: &TargetTriple) -> Result { asset = format!("project-manager-bundle-{target}"), ext = ide_ci::github::release::archive_extension(), ); - Url::parse(&url_text).anyhow_err() -} - -pub async fn ensure_present(dist_path: impl AsRef, target: &TargetTriple) -> Result { - // Check if already done - let build_info_file = dist_path.as_ref().join("installed-enso-version"); - let old_info = dbg!(build_info_file.read_to_json::()); - if old_info.contains(target) { - debug!( - "Project Manager in version {target} is already installed, according to {info}.", - info = build_info_file.display() - ); - } else { - // We remove the build info file to avoid misinformation if the build is interrupted during - // the call to `download_project_manager`. - ide_ci::fs::remove_if_exists(&build_info_file)?; - - let url = url(target)?; - ide_ci::io::download_and_extract(url, &dist_path).await?; - ide_ci::fs::allow_owner_execute(crate::paths::project_manager(&dist_path))?; - build_info_file.write_as_json(&target)?; - } - Ok(()) + Ok(Url::parse(&url_text)?) } diff --git a/build/build/src/source.rs b/build/build/src/source.rs index d87d950f2a4..9b66c10d2fe 100644 --- a/build/build/src/source.rs +++ b/build/build/src/source.rs @@ -3,7 +3,6 @@ use crate::prelude::*; use crate::project::IsTarget; use crate::project::IsWatchable; -use derivative::Derivative; use ide_ci::github::Repo; use octocrab::models::AssetId; use octocrab::models::RunId; @@ -11,16 +10,11 @@ use octocrab::models::RunId; /// Denotes an external source from which a target artifact can be obtained. -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone, Debug)] pub enum ExternalSource { - #[derivative(Debug = "transparent")] OngoingCiRun(OngoingCiRunSource), - #[derivative(Debug = "transparent")] CiRun(CiRunSource), - #[derivative(Debug = "transparent")] LocalFile(PathBuf), - #[derivative(Debug = "transparent")] Release(ReleaseSource), } @@ -40,14 +34,11 @@ pub struct BuildSource { } /// Describes how to get a target. -#[derive(Derivative)] -#[derivative(Debug)] +#[derive(Debug)] pub enum Source { /// Build the target locally from the sources. - #[derivative(Debug = "transparent")] BuildLocally(BuildSource), /// Download the target from an external source. - #[derivative(Debug = "transparent")] External(ExternalSource), } @@ -56,22 +47,16 @@ pub struct OngoingCiRunSource { pub artifact_name: String, } -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone, Debug)] pub struct CiRunSource { - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] pub repository: Repo, - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] pub run_id: RunId, pub artifact_name: String, } -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone, Debug)] pub struct ReleaseSource { - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] pub repository: Repo, - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] pub asset_id: AssetId, } diff --git a/build/build/src/sqlserver.rs b/build/build/src/sqlserver.rs index 6a10d19fc42..144e7036dea 100644 --- a/build/build/src/sqlserver.rs +++ b/build/build/src/sqlserver.rs @@ -185,7 +185,7 @@ impl SQLServer { let mut cmd = Docker.run_cmd(&opts)?; cmd.stdout(Stdio::piped()); cmd.kill_on_drop(true); - let mut child = cmd.spawn().anyhow_err()?; + let mut child = cmd.spawn()?; let stdout = child .stdout .take() diff --git a/build/build/src/version.rs b/build/build/src/version.rs index b376670b8be..1116c3cccb6 100644 --- a/build/build/src/version.rs +++ b/build/build/src/version.rs @@ -8,7 +8,6 @@ use crate::prelude::*; use anyhow::Context; use chrono::Datelike; -use derivative::Derivative; use ide_ci::define_env_var; use ide_ci::env::accessor::TypedVariable; use ide_ci::github; @@ -51,7 +50,7 @@ pub const RC_BUILD_PREFIX: &str = "rc"; /// Check if the given GitHub release matches the provided kind. pub fn is_release_of_kind(release: &Release, kind: Kind) -> bool { - matches!(release.tag_name.parse2(), Ok(version) if kind.matches(&version)) + matches!(release.tag_name.parse(), Ok(version) if kind.matches(&version)) } /// List all releases in the GitHub repository that are of a given kind. @@ -76,14 +75,12 @@ pub async fn latest_nightly_release(repo: &github::repo::Handle) -> /// Keeps the version of Enso, edition name and whether this version should be treated as a release. /// /// Basically this is everything that is needed to define the version of the build. -#[derive(Clone, Derivative, Serialize, Deserialize, Deref, PartialEq, Eq)] -#[derivative(Debug)] +#[derive(Clone, Serialize, Deserialize, Deref, PartialEq, Eq, Debug)] pub struct Versions { /// The version of Enso. /// /// Currently it also doubles as the edition name. In future we might want to separate them. #[deref] - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] pub version: Version, /// Whether this version should be treated as a release. @@ -117,7 +114,7 @@ impl Versions { } pub fn local_prerelease() -> Result { - Prerelease::new(LOCAL_BUILD_PREFIX).anyhow_err() + Ok(Prerelease::new(LOCAL_BUILD_PREFIX)?) } /// Get a git tag that should be applied to a commit released as this version. @@ -202,7 +199,7 @@ pub fn increment_rc_version(version: &Version) -> Result { ensure!(Kind::Rc.matches(version), "Version is not an RC version: {}.", version); match version.pre.split('.').collect_vec().as_slice() { [RC_BUILD_PREFIX, index] => { - let index = index.parse2::().context("Parsing RC index.")?; + let index = index.parse::().context("Parsing RC index.")?; let pre = generate_rc_prerelease(index + 1)?; Ok(Version { pre, ..version.clone() }) } @@ -233,7 +230,7 @@ pub fn same_core_version(a: &Version, b: &Version) -> bool { } pub fn generate_rc_prerelease(index: u32) -> Result { - Prerelease::from_str(&format!("{RC_BUILD_PREFIX}.{index}")) + Ok(Prerelease::from_str(&format!("{RC_BUILD_PREFIX}.{index}"))?) } #[instrument(ret)] diff --git a/build/build/src/version/nightly.rs b/build/build/src/version/nightly.rs index 8c7f6575e9d..447c5d35932 100644 --- a/build/build/src/version/nightly.rs +++ b/build/build/src/version/nightly.rs @@ -53,12 +53,12 @@ impl TryFrom<&Prerelease> for NightlyPrerelease { "Not a nightly build." ); ensure!(identifiers.len() == 4 || identifiers.len() == 5, "Wrong number of identifiers."); - let year = identifiers.get(1).context("Missing year")?.parse2().context("Invalid year")?; + let year = identifiers.get(1).context("Missing year")?.parse().context("Invalid year")?; let month = - identifiers.get(2).context("Missing month")?.parse2().context("Invalid month")?; - let day = identifiers.get(3).context("Missing day")?.parse2().context("Invalid day")?; + identifiers.get(2).context("Missing month")?.parse().context("Invalid month")?; + let day = identifiers.get(3).context("Missing day")?.parse().context("Invalid day")?; let index = - identifiers.get(4).map(|index| index.parse2()).transpose().context("Invalid index")?; + identifiers.get(4).map(|index| index.parse()).transpose().context("Invalid index")?; let date = chrono::NaiveDate::from_ymd_opt(year, month, day) .with_context(|| format!("Invalid date: {year}-{month}-{day}"))?; Ok(Self::new(date, index)) @@ -88,7 +88,7 @@ impl TryInto for NightlyPrerelease { fn try_into(self) -> std::result::Result { let as_string = self.to_string(); - Prerelease::from_str(&as_string) + Ok(Prerelease::from_str(&as_string)?) } } diff --git a/build/ci_utils/Cargo.toml b/build/ci_utils/Cargo.toml index ef7bc0a39c4..fcf7bc7e8f1 100644 --- a/build/ci_utils/Cargo.toml +++ b/build/ci_utils/Cargo.toml @@ -9,13 +9,12 @@ anyhow = { workspace = true } async-compression = { version = "0.3.12", features = ["tokio", "gzip"] } async-trait = "0.1.78" bincode = "1.3.3" -byte-unit = { workspace = true } bytes = { workspace = true } chrono = { workspace = true } clap = { workspace = true } data-encoding = "2.3.2" dependency_runner = "1.1.0" -derivative = { workspace = true } +derive-where = { workspace = true } derive_more = { workspace = true } dirs = { workspace = true } enso-build-base = { path = "../base" } @@ -24,7 +23,7 @@ flate2 = { workspace = true } flume = "0.10.10" fs_extra = "1.3.0" futures = { workspace = true } -futures-util = "0.3.17" +futures-util = { workspace = true } glob = "0.3.0" headers = "0.3.7" heck = "0.4.0" @@ -32,14 +31,13 @@ http-serde = "1.1.0" indicatif = { workspace = true } itertools = { workspace = true } lazy_static = { workspace = true } -mime = "0.3.16" +mime = { workspace = true } multimap = { workspace = true } -new_mime_guess = "4.0.0" +new_mime_guess = { workspace = true } octocrab = { workspace = true } path-absolutize = { workspace = true } pathdiff = "0.2.1" path-slash = "0.2.1" -platforms = { workspace = true } portpicker = { workspace = true } regex = { workspace = true } reqwest = { workspace = true } @@ -47,7 +45,7 @@ semver = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } serde_yaml = { workspace = true } -sha2 = "0.10.2" +sha2 = { workspace = true } strum = { workspace = true } symlink = "0.1.0" sysinfo = { workspace = true } @@ -67,7 +65,6 @@ zip = { version = "0.6.2", default-features = false, features = ["deflate"] } base64 = "0.21.0" [dev-dependencies] -warp = { version = "0.3.2", default-features = false } wiremock = "0.5.10" [lints] diff --git a/build/ci_utils/src/actions/artifacts/context.rs b/build/ci_utils/src/actions/artifacts/context.rs index 56d884490cd..1ced87aad43 100644 --- a/build/ci_utils/src/actions/artifacts/context.rs +++ b/build/ci_utils/src/actions/artifacts/context.rs @@ -35,7 +35,7 @@ impl Context { let url_text = format!( "{runtime_url}_apis/pipelines/workflows/{run_id}/artifacts?api-version={api_version}" ); - Url::parse(&url_text).anyhow_err() + Ok(Url::parse(&url_text)?) } pub fn prepare_client(&self, accept_mime: Mime) -> Result { @@ -53,10 +53,10 @@ impl Context { } pub fn json_client(&self) -> Result { - self.prepare_client(mime::APPLICATION_JSON)? + Ok(self + .prepare_client(mime::APPLICATION_JSON)? .default_content_type(mime::APPLICATION_JSON) - .build() - .anyhow_err() + .build()?) } pub fn upload_client(&self) -> Result { @@ -65,19 +65,19 @@ impl Context { let mut headers = HeaderMap::new(); headers.insert(reqwest::header::CONNECTION, HeaderValue::from_static("Keep-Alive")); headers.insert("Keep-Alive", keep_alive_seconds.into()); - self.prepare_client(mime::APPLICATION_OCTET_STREAM)? + Ok(self + .prepare_client(mime::APPLICATION_OCTET_STREAM)? .default_content_type(mime::APPLICATION_JSON) .default_headers(headers) - .build() - .anyhow_err() + .build()?) } pub fn download_client(&self) -> Result { - self.prepare_client(mime::APPLICATION_OCTET_STREAM)? + Ok(self + .prepare_client(mime::APPLICATION_OCTET_STREAM)? .default_content_type(mime::APPLICATION_JSON) .keep_alive(10) .default_header(ACCEPT_ENCODING, HeaderValue::try_from("gzip").unwrap()) - .build() - .anyhow_err() + .build()?) } } diff --git a/build/ci_utils/src/actions/artifacts/raw.rs b/build/ci_utils/src/actions/artifacts/raw.rs index d85a8b06ecc..5cfbfe1a423 100644 --- a/build/ci_utils/src/actions/artifacts/raw.rs +++ b/build/ci_utils/src/actions/artifacts/raw.rs @@ -95,7 +95,7 @@ pub mod endpoints { .json::() .await?; debug!("{}", serde_json::to_string_pretty(&body)?); - serde_json::from_value(body).anyhow_err() + Ok(serde_json::from_value(body)?) } #[context("Failed to finalize upload of the artifact `{}`.", artifact_name.as_ref())] diff --git a/build/ci_utils/src/actions/artifacts/upload.rs b/build/ci_utils/src/actions/artifacts/upload.rs index 732dd4c328d..640bd1c7a12 100644 --- a/build/ci_utils/src/actions/artifacts/upload.rs +++ b/build/ci_utils/src/actions/artifacts/upload.rs @@ -169,12 +169,10 @@ pub async fn upload_worker( debug!("Upload worker finished."); } -#[derive(Derivative)] -#[derivative(Debug)] +#[derive_where(Debug)] pub struct FileUploader { - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] pub url: Url, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub client: Client, pub artifact_name: PathBuf, pub chunk_size: usize, @@ -275,40 +273,3 @@ pub struct UploadResult { pub successful_upload_size: usize, pub total_size: usize, } - -#[cfg(test)] -mod tests { - use super::*; - use crate::actions::artifacts; - use crate::actions::artifacts::models::CreateArtifactResponse; - - #[tokio::test] - #[ignore] - async fn test_upload() -> Result { - use warp::Filter; - setup_logging().ok(); - - let response1 = CreateArtifactResponse { - name: "test-artifact".to_string(), - url: "http://localhost:8080/artifacts/test-artifact".try_into()?, - container_id: 1, - size: 0, - file_container_resource_url: "http://localhost:8080/artifacts/test-artifact/files" - .try_into()?, - r#type: "file".to_string(), - expires_on: default(), - signed_content: None, - }; - - let routes = warp::any().map(move || serde_json::to_string(&response1).unwrap()); - tokio::spawn(warp::serve(routes).run(([127, 0, 0, 1], 8080))); - - debug!("Hello!"); - crate::env::set_var("ACTIONS_RUNTIME_URL", "http://localhost:8080"); - crate::env::set_var("ACTIONS_RUNTIME_TOKEN", "test-token"); - crate::env::set_var("GITHUB_RUN_ID", "123"); - let result = artifacts::upload_single_file("file", "name").await; - dbg!(result)?; - Ok(()) - } -} diff --git a/build/ci_utils/src/actions/workflow/definition.rs b/build/ci_utils/src/actions/workflow/definition.rs index 7e0028a1e01..b838992a178 100644 --- a/build/ci_utils/src/actions/workflow/definition.rs +++ b/build/ci_utils/src/actions/workflow/definition.rs @@ -803,7 +803,7 @@ impl Strategy { name: impl Into, values: impl IntoIterator, ) -> Result<&mut Self> { - let values = values.into_iter().map(serde_json::to_value).try_collect_vec()?; + let values = values.into_iter().map(serde_json::to_value).try_collect()?; self.matrix.insert(name.into(), serde_json::Value::Array(values)); Ok(self) } diff --git a/build/ci_utils/src/archive/tar.rs b/build/ci_utils/src/archive/tar.rs index 4f9f8514fc0..fea24ce5656 100644 --- a/build/ci_utils/src/archive/tar.rs +++ b/build/ci_utils/src/archive/tar.rs @@ -43,12 +43,11 @@ pub fn extract_files_sync( // =============== /// A `tar` archive. -#[derive(Derivative)] -#[derivative(Debug)] +#[derive_where(Debug)] pub struct Archive { /// The path that the `file` originated from. This is stored for error reporting. path: Box, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] file: tar::Archive>, } diff --git a/build/ci_utils/src/archive/zip.rs b/build/ci_utils/src/archive/zip.rs index 5dd5fd4f106..e91bfdb5e13 100644 --- a/build/ci_utils/src/archive/zip.rs +++ b/build/ci_utils/src/archive/zip.rs @@ -11,7 +11,7 @@ use zip::read::ZipFile; pub use ::zip::*; pub fn open(path: impl AsRef) -> Result> { - ZipArchive::new(crate::fs::open(path)?).anyhow_err() + Ok(ZipArchive::new(crate::fs::open(path)?)?) } #[context("Failed to extract in-memory archive to {}.", output_dir.as_ref().display())] diff --git a/build/ci_utils/src/cache/download.rs b/build/ci_utils/src/cache/download.rs index ed1a8211a27..b1e1e5e4df1 100644 --- a/build/ci_utils/src/cache/download.rs +++ b/build/ci_utils/src/cache/download.rs @@ -7,7 +7,6 @@ use crate::io::web::filename_from_response; use crate::io::web::handle_error_response; use crate::io::web::stream_response_to_file; -use derivative::Derivative; use headers::HeaderMap; use reqwest::Client; use reqwest::ClientBuilder; @@ -16,10 +15,8 @@ use reqwest::Response; -#[derive(Clone, Derivative, Serialize, Deserialize)] -#[derivative(Debug)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct Key { - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] pub url: Url, /// We keep this as part of the key, as some GitHub API endpoints change their meaning based on diff --git a/build/ci_utils/src/cache/goodie/graalpy.rs b/build/ci_utils/src/cache/goodie/graalpy.rs index 39bdc4e573a..6f45afea5a6 100644 --- a/build/ci_utils/src/cache/goodie/graalpy.rs +++ b/build/ci_utils/src/cache/goodie/graalpy.rs @@ -96,9 +96,9 @@ impl GraalPy { mod tests { use crate::cache::goodie::graalpy::graalpy_version_from_str; use crate::cache::goodie::graalpy::GraalPy; + use crate::Arch; + use crate::OS; use octocrab::Octocrab; - use platforms::Arch; - use platforms::OS; use semver::Version; #[test] diff --git a/build/ci_utils/src/cache/goodie/graalvm.rs b/build/ci_utils/src/cache/goodie/graalvm.rs index 6a74591cb14..389ad28eede 100644 --- a/build/ci_utils/src/cache/goodie/graalvm.rs +++ b/build/ci_utils/src/cache/goodie/graalvm.rs @@ -33,7 +33,7 @@ pub enum Edition { Enterprise, } -impl std::str::FromStr for Edition { +impl FromStr for Edition { type Err = anyhow::Error; fn from_str(s: &str) -> Result { @@ -177,7 +177,6 @@ impl GraalVM { OS::Linux => "linux", OS::Windows => "windows", OS::MacOS => "macos", - other_os => unimplemented!("System `{}` is not supported!", other_os), }; let arch_name = match self.arch { Arch::X86_64 => "x64", diff --git a/build/ci_utils/src/cache/goodie/sbt.rs b/build/ci_utils/src/cache/goodie/sbt.rs index 0bf375efb4e..908a1b02ad2 100644 --- a/build/ci_utils/src/cache/goodie/sbt.rs +++ b/build/ci_utils/src/cache/goodie/sbt.rs @@ -18,7 +18,7 @@ pub struct Sbt; impl Goodie for Sbt { fn get(&self, cache: &Cache) -> BoxFuture<'static, Result> { - goodie::download_try_url(Url::from_str(DOWNLOAD_URL_TEXT), cache) + goodie::download_try_url(Url::from_str(DOWNLOAD_URL_TEXT).map_err(Into::into), cache) } fn is_active(&self) -> BoxFuture<'static, Result> { diff --git a/build/ci_utils/src/env/accessor.rs b/build/ci_utils/src/env/accessor.rs index a4cebe837b2..70530d53902 100644 --- a/build/ci_utils/src/env/accessor.rs +++ b/build/ci_utils/src/env/accessor.rs @@ -98,7 +98,7 @@ impl> FallibleManipula #[derive(Clone, Copy, Debug, Display, Ord, PartialOrd, Eq, PartialEq)] pub struct PathBufVariable(pub &'static str); -impl const From<&'static str> for PathBufVariable { +impl From<&'static str> for PathBufVariable { fn from(value: &'static str) -> Self { PathBufVariable(value) } @@ -120,7 +120,7 @@ impl TypedVariable for PathBufVariable { type Value = PathBuf; type Borrowed = Path; fn parse(&self, value: &str) -> Result { - PathBuf::from_str(value) + Ok(PathBuf::from_str(value)?) } fn generate(&self, value: &Self::Borrowed) -> Result { value @@ -144,7 +144,7 @@ impl From<&'static str> for SimpleVariable const AsRef for SimpleVariable { +impl AsRef for SimpleVariable { fn as_ref(&self) -> &str { self.name } @@ -180,13 +180,13 @@ impl RawVariable for SimpleVariable { } } -impl TypedVariable - for SimpleVariable +impl TypedVariable for SimpleVariable +where Value::Err: Into { type Value = Value; type Borrowed = Borrowed; fn parse(&self, value: &str) -> Result { - Value::from_str(value) + Value::from_str(value).map_err(Into::into) } fn generate(&self, value: &Self::Borrowed) -> Result { Ok(Borrowed::to_string(value)) diff --git a/build/ci_utils/src/env/known/electron_builder.rs b/build/ci_utils/src/env/known/electron_builder.rs index 169fbf6f8ed..0732ed730be 100644 --- a/build/ci_utils/src/env/known/electron_builder.rs +++ b/build/ci_utils/src/env/known/electron_builder.rs @@ -72,7 +72,7 @@ pub enum CscLink { Data(Vec), } -impl std::str::FromStr for CscLink { +impl FromStr for CscLink { type Err = anyhow::Error; #[context("Failed to parse CSC link from '{csc_link}'.")] diff --git a/build/ci_utils/src/extensions.rs b/build/ci_utils/src/extensions.rs index 60f627d24cd..9ee3eda6a0a 100644 --- a/build/ci_utils/src/extensions.rs +++ b/build/ci_utils/src/extensions.rs @@ -6,7 +6,6 @@ pub mod child; pub mod clap; pub mod command; pub mod octocrab; -pub mod os; pub mod output; pub mod reqwest; pub mod version; diff --git a/build/ci_utils/src/extensions/child.rs b/build/ci_utils/src/extensions/child.rs index f058b8bd774..c1a1072f502 100644 --- a/build/ci_utils/src/extensions/child.rs +++ b/build/ci_utils/src/extensions/child.rs @@ -17,7 +17,7 @@ pub trait ChildExt { impl ChildExt for tokio::process::Child { fn wait_ok(&mut self) -> BoxFuture { - async move { self.wait().await?.exit_ok().anyhow_err() }.boxed() + async move { Ok(self.wait().await?.exit_ok()?) }.boxed() } fn kill_subtree(&self) { diff --git a/build/ci_utils/src/extensions/os.rs b/build/ci_utils/src/extensions/os.rs deleted file mode 100644 index 73457c950f2..00000000000 --- a/build/ci_utils/src/extensions/os.rs +++ /dev/null @@ -1,75 +0,0 @@ -use crate::prelude::*; - - - -/// A bunch of constant literals associated with a given OS. Follows the convention of constants -/// defined in [`std::env::consts`] module. -#[const_trait] -pub trait OsExt: Copy { - fn exe_suffix(self) -> &'static str; - fn exe_extension(self) -> &'static str; - fn dll_prefix(self) -> &'static str; - fn dll_extension(self) -> &'static str; - fn dll_suffix(self) -> &'static str; -} - -impl const OsExt for OS { - fn exe_suffix(self) -> &'static str { - match self { - OS::Windows => ".exe", - OS::Linux => "", - OS::MacOS => "", - _ => todo!(), - } - } - - fn exe_extension(self) -> &'static str { - match self { - OS::Windows => "exe", - OS::Linux => "", - OS::MacOS => "", - _ => todo!(), - } - } - - fn dll_prefix(self) -> &'static str { - match self { - OS::Windows => "", - OS::Linux => "lib", - OS::MacOS => "lib", - _ => todo!(), - } - } - - fn dll_extension(self) -> &'static str { - match self { - OS::Windows => "dll", - OS::Linux => "so", - OS::MacOS => "dylib", - _ => todo!(), - } - } - - fn dll_suffix(self) -> &'static str { - match self { - OS::Windows => ".dll", - OS::Linux => ".so", - OS::MacOS => ".dylib", - _ => todo!(), - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn same_on_target() { - assert_eq!(std::env::consts::DLL_EXTENSION, TARGET_OS.dll_extension()); - assert_eq!(std::env::consts::DLL_PREFIX, TARGET_OS.dll_prefix()); - assert_eq!(std::env::consts::DLL_SUFFIX, TARGET_OS.dll_suffix()); - assert_eq!(std::env::consts::EXE_EXTENSION, TARGET_OS.exe_extension()); - assert_eq!(std::env::consts::EXE_SUFFIX, TARGET_OS.exe_suffix()); - } -} diff --git a/build/ci_utils/src/fs.rs b/build/ci_utils/src/fs.rs index a0dd8292558..c049adc5dd0 100644 --- a/build/ci_utils/src/fs.rs +++ b/build/ci_utils/src/fs.rs @@ -3,8 +3,6 @@ use crate::prelude::*; -use async_compression::tokio::bufread::GzipEncoder; -use async_compression::Level; use fs_extra::dir::CopyOptions; use fs_extra::error::ErrorKind; @@ -82,19 +80,6 @@ pub async fn mirror_directory(source: impl AsRef, destination: impl AsRef< } } - -/// Get the size of a file after gzip compression. -pub async fn compressed_size(path: impl AsRef) -> Result { - // Read the file in chunks of 4MB. Our wasm files are usually way bigger than that, so this - // buffer gives very significant speedup over the default 8KB chunks. - const READER_CAPACITY: usize = 4096 * 1024; - - let file = tokio::open(&path).await?; - let buf_file = ::tokio::io::BufReader::with_capacity(READER_CAPACITY, file); - let encoded_stream = GzipEncoder::with_quality(buf_file, Level::Best); - crate::io::read_length(encoded_stream).await.map(into) -} - /// Copy the file to the destination path, unless the file already exists and has the same content. /// /// If the directory is passed as the source, it will be copied recursively. @@ -108,7 +93,7 @@ pub async fn copy_if_different(source: impl AsRef, target: impl AsRef = walkdir.into_iter().try_collect()?; for entry in entries.into_iter().filter(|e| e.file_type().is_file()) { let entry_path = entry.path(); let relative_path = pathdiff::diff_paths(entry_path, &source) @@ -125,7 +110,7 @@ pub async fn copy_if_different(source: impl AsRef, target: impl AsRef, dst: impl AsRef) -> Result { create_parent_dir_if_missing(&dst)?; debug!("Creating symlink {} <= {}", src.as_ref().display(), dst.as_ref().display()); - symlink::symlink_auto(&src, &dst).anyhow_err() + Ok(symlink::symlink_auto(&src, &dst)?) } /// Remove a symlink to a directory if it exists. @@ -134,7 +119,7 @@ pub fn remove_symlink_dir_if_exists(path: impl AsRef) -> Result { let result = symlink::remove_symlink_dir(&path); match result { Err(err) if err.kind() == std::io::ErrorKind::NotFound => Ok(()), - ret => ret.anyhow_err(), + ret => Ok(ret?), } } diff --git a/build/ci_utils/src/fs/tokio.rs b/build/ci_utils/src/fs/tokio.rs index f4159227258..aa4335d391f 100644 --- a/build/ci_utils/src/fs/tokio.rs +++ b/build/ci_utils/src/fs/tokio.rs @@ -34,7 +34,7 @@ pub async fn create_dir_if_missing(path: impl AsRef) -> Result { } result => { trace!("Created directory: {}", path.as_ref().display()); - result.anyhow_err() + Ok(result?) } } } @@ -55,7 +55,7 @@ pub async fn create_parent_dir_if_missing(path: impl AsRef) -> Result, contents: impl AsRef<[u8]>) -> Result { create_parent_dir_if_missing(&path).await?; - crate::fs::wrappers::tokio::write(&path, &contents).await.anyhow_err() + crate::fs::wrappers::tokio::write(&path, &contents).await } pub async fn copy_to_file( @@ -63,7 +63,7 @@ pub async fn copy_to_file( output_path: impl AsRef, ) -> Result { let mut output = create(output_path).await?; - tokio::io::copy(&mut content, &mut output).await.anyhow_err() + Ok(tokio::io::copy(&mut content, &mut output).await?) } /// Remove a directory with all its subtree. @@ -184,7 +184,7 @@ pub async fn remove_file_if_exists(path: impl AsRef) -> Result<()> { let result = tokio::fs::remove_file(&path).await; match result { Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()), - result => result.anyhow_err(), + result => Ok(result?), } } diff --git a/build/ci_utils/src/fs/wrappers/tokio.rs b/build/ci_utils/src/fs/wrappers/tokio.rs index c4c13099085..f10a95c5f4c 100644 --- a/build/ci_utils/src/fs/wrappers/tokio.rs +++ b/build/ci_utils/src/fs/wrappers/tokio.rs @@ -8,7 +8,7 @@ use tokio_util::io::ReaderStream; pub fn metadata>(path: P) -> BoxFuture<'static, Result> { let path = path.as_ref().to_owned(); - tokio::fs::metadata(path).anyhow_err().boxed() + async { Ok(tokio::fs::metadata(path).await?) }.boxed() } @@ -36,7 +36,7 @@ pub fn symlink_metadata>(path: P) -> BoxFuture<'static, Result) -> Result { - File::open(&path).await.anyhow_err() + Ok(File::open(&path).await?) } pub fn open_stream(path: impl AsRef) -> BoxFuture<'static, Result>> { @@ -53,12 +53,12 @@ pub fn open_stream(path: impl AsRef) -> BoxFuture<'static, Result) -> Result { - File::create(&path).await.anyhow_err() + Ok(File::create(&path).await?) } #[context("Failed to create missing directories no path: {}", path.as_ref().display())] pub async fn create_dir_all(path: impl AsRef) -> Result { - tokio::fs::create_dir_all(&path).await.anyhow_err() + Ok(tokio::fs::create_dir_all(&path).await?) } pub async fn read_dir( @@ -79,12 +79,12 @@ pub async fn read_dir( #[context("Failed to remove directory with the subtree: {}", path.as_ref().display())] pub async fn remove_dir_all(path: impl AsRef) -> Result { - tokio::fs::remove_dir_all(&path).await.anyhow_err() + Ok(tokio::fs::remove_dir_all(&path).await?) } #[context("Failed to write file: {}", path.as_ref().display())] pub async fn write(path: impl AsRef, contents: impl AsRef<[u8]>) -> Result { - tokio::fs::write(&path, &contents).await.anyhow_err() + Ok(tokio::fs::write(&path, &contents).await?) } #[context("Failed to read file: {}", path.as_ref().display())] @@ -97,11 +97,11 @@ pub async fn read>(path: P) -> Result> { #[context("Failed to read the file: {}", path.as_ref().display())] pub async fn read_to_string(path: impl AsRef) -> Result { - tokio::fs::read_to_string(&path).await.anyhow_err() + Ok(tokio::fs::read_to_string(&path).await?) } /// See [`tokio::fs::set_permissions`]. #[context("Failed to set permissions {:?} for file: {}", permissions, path.as_ref().display())] pub async fn set_permissions(path: impl AsRef, permissions: std::fs::Permissions) -> Result { - tokio::fs::set_permissions(&path, permissions.clone()).await.anyhow_err() + Ok(tokio::fs::set_permissions(&path, permissions.clone()).await?) } diff --git a/build/ci_utils/src/future.rs b/build/ci_utils/src/future.rs index a41436954c8..0a42efd0a4c 100644 --- a/build/ci_utils/src/future.rs +++ b/build/ci_utils/src/future.rs @@ -1,21 +1,10 @@ use crate::prelude::*; - -use futures_util::future::OptionFuture; - - - -pub fn receiver_to_stream( - mut receiver: tokio::sync::mpsc::Receiver, -) -> impl Stream { - futures::stream::poll_fn(move |ctx| receiver.poll_recv(ctx)) -} - +use futures::future::OptionFuture; #[derive(Copy, Clone, Debug)] pub enum AsyncPolicy { Sequential, FutureParallelism, - TaskParallelism, } pub async fn join_all(futures: I, parallel: AsyncPolicy) -> Vec> @@ -28,42 +17,15 @@ where AsyncPolicy::Sequential => { let mut ret = Vec::new(); for future in futures { - ret.push(future.await.anyhow_err()); + ret.push(future.await.map_err(Into::into)); } ret } - AsyncPolicy::FutureParallelism => - futures::future::join_all(futures).await.into_iter().map(|r| r.anyhow_err()).collect(), - AsyncPolicy::TaskParallelism => { - let tasks = futures - .into_iter() - .map(|future| async move { tokio::task::spawn(future).await?.anyhow_err() }); - futures::future::join_all(tasks).await - } - } -} - -pub async fn try_join_all(futures: I, parallel: AsyncPolicy) -> Result> -where - I: IntoIterator, - F: Future> + Send + 'static, - T: Send + 'static, - E: Into + Send + 'static, { - match parallel { - AsyncPolicy::Sequential => { - let mut ret = Vec::new(); - for future in futures { - ret.push(future.await.anyhow_err()?); - } - Ok(ret) - } - AsyncPolicy::FutureParallelism => futures::future::try_join_all(futures).await.anyhow_err(), - AsyncPolicy::TaskParallelism => { - let tasks = futures - .into_iter() - .map(|future| async move { tokio::task::spawn(future).await?.anyhow_err() }); - futures::future::try_join_all(tasks).await - } + AsyncPolicy::FutureParallelism => futures::future::join_all(futures) + .await + .into_iter() + .map(|r| r.map_err(Into::into)) + .collect(), } } diff --git a/build/ci_utils/src/github.rs b/build/ci_utils/src/github.rs index 8daa3600b35..7935e02942e 100644 --- a/build/ci_utils/src/github.rs +++ b/build/ci_utils/src/github.rs @@ -126,7 +126,7 @@ pub trait IsOrganization { /// The organization's URL. fn url(&self) -> Result { let url_text = format!("https://github.com/{}", self.name()); - Url::from_str(&url_text) + Ok(Url::from_str(&url_text)?) } } @@ -162,12 +162,10 @@ pub async fn latest_runner_url(octocrab: &Octocrab, os: OS) -> Result { OS::Linux => "linux", OS::Windows => "win", OS::MacOS => "osx", - other_os => unimplemented!("System `{}` is not yet supported!", other_os), }; let arch_name = match TARGET_ARCH { Arch::X86_64 => "x64", - Arch::Arm => "arm", Arch::AArch64 => "arm64", other_arch => unimplemented!("Architecture `{}` is not yet supported!", other_arch), }; @@ -188,9 +186,5 @@ pub async fn fetch_runner(octocrab: &Octocrab, os: OS, output_dir: impl AsRef) -> Result { let mut header_map = reqwest::header::HeaderMap::new(); header_map.append(reqwest::header::AUTHORIZATION, format!("Bearer {}", pat.as_ref()).parse()?); - reqwest::Client::builder() - .user_agent("enso-build") - .default_headers(header_map) - .build() - .anyhow_err() + Ok(reqwest::Client::builder().user_agent("enso-build").default_headers(header_map).build()?) } diff --git a/build/ci_utils/src/github/release.rs b/build/ci_utils/src/github/release.rs index 71b9bef9e7a..7b7847bf91a 100644 --- a/build/ci_utils/src/github/release.rs +++ b/build/ci_utils/src/github/release.rs @@ -228,12 +228,12 @@ pub trait IsReleaseExt: IsRelease + Sync { /// Get the information about the release. async fn get(&self) -> Result { - self.octocrab() + Ok(self + .octocrab() .repos(self.repo().owner(), self.repo().name()) .releases() .get_by_id(self.id()) - .await - .anyhow_err() + .await?) } async fn publish(&self) -> Result { @@ -251,13 +251,12 @@ pub trait IsReleaseExt: IsRelease + Sync { impl IsReleaseExt for T where T: IsRelease + Sync {} /// A release on GitHub. -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone)] +#[derive_where(Debug)] pub struct Handle { - #[derivative(Debug(format_with = "std::fmt::Display::fmt"))] pub repo: Repo, pub id: ReleaseId, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub octocrab: Octocrab, } diff --git a/build/ci_utils/src/github/repo.rs b/build/ci_utils/src/github/repo.rs index dcf189d46dc..4a0553f02a4 100644 --- a/build/ci_utils/src/github/repo.rs +++ b/build/ci_utils/src/github/repo.rs @@ -27,7 +27,7 @@ use reqwest::Response; /// /// See also [`RepoRef`] for a non-owning equivalent. #[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, derive_more::Display)] -#[display(fmt = "{owner}/{name}")] +#[display("{owner}/{name}")] pub struct Repo { /// Owner - an organization's or user's name. pub owner: String, @@ -46,7 +46,7 @@ impl IsRepo for Repo { } /// Parse from strings in format "owner/name". Opposite of [`Display`]. -impl std::str::FromStr for Repo { +impl FromStr for Repo { type Err = anyhow::Error; fn from_str(s: &str) -> std::result::Result { @@ -78,7 +78,7 @@ impl Repo { /// /// Particularly useful for defining `const` repositories. #[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize, derive_more::Display)] -#[display(fmt = "{owner}/{name}")] +#[display("{owner}/{name}")] pub struct RepoRef<'a> { /// Owner - an organization's or user's name. pub owner: &'a str, @@ -161,11 +161,11 @@ pub trait IsRepo: Display { /// A handle to a specific GitHub repository. /// /// It includes a client (so also an authentication token) and a repository. -#[derive(Derivative, Clone)] -#[derivative(Debug)] +#[derive(Clone)] +#[derive_where(Debug; Repo)] pub struct Handle { /// Octocrab client (includes authentication token). - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub octocrab: Octocrab, /// Repository designation. pub repo: Repo, diff --git a/build/ci_utils/src/global.rs b/build/ci_utils/src/global.rs index da1dcc4848b..66caee0b0e3 100644 --- a/build/ci_utils/src/global.rs +++ b/build/ci_utils/src/global.rs @@ -1,8 +1,5 @@ use crate::prelude::*; -use crate::future::try_join_all; -use crate::future::AsyncPolicy; - use indicatif::MultiProgress; use indicatif::ProgressBar; use indicatif::WeakProgressBar; @@ -29,15 +26,14 @@ pub fn store_static_text(text: impl AsRef) -> &'static str { const REFRESHES_PER_SECOND: u32 = 100; -#[derive(derivative::Derivative)] -#[derivative(Debug)] +#[derive_where(Debug)] struct GlobalState { /// A globally-shared reference to the multi-progress bar. /// /// All progress bars must be added to this multi-progress bar. This ensures that the progress /// bars are displayed in a way that does not interfere with tracing log output. mp: MultiProgress, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] bars: Vec, _tick_thread: std::thread::JoinHandle<()>, ongoing_tasks: Vec>, @@ -139,7 +135,7 @@ pub async fn complete_tasks() -> Result { break; } info!("Found {} tasks to wait upon.", tasks.len()); - try_join_all(tasks, AsyncPolicy::FutureParallelism).await?; + futures::future::try_join_all(tasks).await?; } debug!("All pending tasks have been completed."); Ok(()) diff --git a/build/ci_utils/src/io.rs b/build/ci_utils/src/io.rs index 502af177d34..d2aba467e8d 100644 --- a/build/ci_utils/src/io.rs +++ b/build/ci_utils/src/io.rs @@ -21,7 +21,7 @@ pub mod web; /// Inputs content is discarded. pub async fn read_length(mut read: impl AsyncRead + Unpin) -> Result { let mut sink = tokio::io::sink(); - tokio::io::copy(&mut read, &mut sink).anyhow_err().await + Ok(tokio::io::copy(&mut read, &mut sink).await?) } /// Get the the response body as a byte stream. diff --git a/build/ci_utils/src/lib.rs b/build/ci_utils/src/lib.rs index 449d570d890..3487f58889f 100644 --- a/build/ci_utils/src/lib.rs +++ b/build/ci_utils/src/lib.rs @@ -1,14 +1,11 @@ // === Features === #![allow(incomplete_features)] -#![feature(try_blocks)] -#![feature(result_flattening)] #![feature(const_fmt_arguments_new)] #![feature(hash_set_entry)] #![feature(let_chains)] #![feature(min_specialization)] #![feature(exit_status_error)] #![feature(associated_type_defaults)] -#![feature(associated_type_bounds)] #![feature(exact_size_is_empty)] #![feature(async_closure)] #![feature(type_alias_impl_trait)] @@ -16,8 +13,6 @@ #![feature(string_remove_matches)] #![feature(duration_constants)] #![feature(const_trait_impl)] -#![feature(extend_one)] -#![feature(lazy_cell)] // === Non-Standard Linter Configuration === #![warn(unused_qualifications)] @@ -60,14 +55,12 @@ pub mod prelude { pub use async_trait::async_trait; pub use bytes::Bytes; - pub use derivative::Derivative; pub use derive_more::Display; + pub use derive_where::derive_where; pub use itertools::Itertools; pub use lazy_static::lazy_static; pub use octocrab::Octocrab; pub use path_absolutize::*; - pub use platforms::target::Arch; - pub use platforms::target::OS; pub use semver::Version; pub use tokio::io::AsyncWriteExt as _; pub use url::Url; @@ -79,6 +72,8 @@ pub mod prelude { pub use crate::github::release::IsRelease; pub use crate::github::repo::IsRepo; pub use crate::log::setup_logging; + pub use crate::os::target::Arch; + pub use crate::os::target::OS; pub use crate::os::target::TARGET_ARCH; pub use crate::os::target::TARGET_OS; pub use crate::program::command::provider::CommandProvider; diff --git a/build/ci_utils/src/os/target.rs b/build/ci_utils/src/os/target.rs index aa7aa5ea1c7..7c6bff9da36 100644 --- a/build/ci_utils/src/os/target.rs +++ b/build/ci_utils/src/os/target.rs @@ -1,189 +1,91 @@ //! Constants describing the target operating system and architecture. -//! -//! Based upon the [`platforms-2.0.0`](https://docs.rs/platforms/2.0.0/platforms/target/enum.OS.html) crate. Future crate versions dropped support for this in favor -//! of [`std::env::consts::OS`] and [`std::env::consts::ARCH`] -- these however are just string -//! literals, rather than enums (that are much more useful compile-time). Thus we put back this -//! functionality here. -use crate::prelude::*; +use std::fmt; +pub const TARGET_ARCH: Arch = Arch::from_str(std::env::consts::ARCH); +pub const TARGET_OS: OS = OS::from_str(std::env::consts::OS); +#[derive(Debug, PartialEq, Eq, Clone, Copy, serde::Serialize, serde::Deserialize)] +pub enum Arch { + AArch64, + Wasm32, + X86, + X86_64, +} -// Copied from platforms-2.0.0 crate -// https://github.com/rustsec/rustsec -// -// Copyright (c) 2018-2020 The Rust Secure Code Working Group -// -// Permission is hereby granted, free of charge, to any -// person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the -// Software without restriction, including without -// limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software -// is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice -// shall be included in all copies or substantial portions -// of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -// SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. +impl Arch { + pub const fn from_str(s: &str) -> Arch { + match s.as_bytes() { + b"aarch64" => Arch::AArch64, + b"wasm32" => Arch::Wasm32, + b"x86" => Arch::X86, + b"x86_64" => Arch::X86_64, + _ => panic!("Unsupported target architecture."), + } + } + pub const fn as_str(self) -> &'static str { + match self { + Arch::AArch64 => "aarch64", + Arch::Wasm32 => "wasm32", + Arch::X86 => "x86", + Arch::X86_64 => "amd64", + } + } +} -// Detect and expose `target_os` as a constant -// Whether this is a good idea is somewhat debatable +impl fmt::Display for Arch { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(self.as_str()) + } +} +#[derive(Debug, PartialEq, Eq, Clone, Copy, serde::Serialize, serde::Deserialize)] +pub enum OS { + Windows, + Linux, + MacOS, +} +impl fmt::Display for OS { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(self.as_str()) + } +} -#[cfg(target_arch = "aarch64")] -/// `target_arch` when building this crate: `x86_64` -pub const TARGET_ARCH: Arch = Arch::AArch64; +impl OS { + pub const fn from_str(s: &str) -> OS { + match s.as_bytes() { + b"windows" => OS::Windows, + b"linux" => OS::Linux, + b"macos" => OS::MacOS, + _ => panic!("Unsupported target OS."), + } + } -#[cfg(target_arch = "arm")] -/// `target_arch` when building this crate: `arm` -pub const TARGET_ARCH: Arch = Arch::Arm; + pub const fn as_str(self) -> &'static str { + match self { + OS::Windows => "windows", + OS::Linux => "linux", + OS::MacOS => "macos", + } + } -#[cfg(target_arch = "asmjs")] -/// `target_arch` when building this crate: `asmjs` -pub const TARGET_ARCH: Arch = Arch::AsmJs; + pub const fn exe_suffix(self) -> &'static str { + match self { + OS::Windows => ".exe", + OS::Linux => "", + OS::MacOS => "", + } + } +} -#[cfg(target_arch = "mips")] -/// `target_arch` when building this crate: `mips` -pub const TARGET_ARCH: Arch = Arch::Mips; +#[cfg(test)] +mod tests { + use super::*; -#[cfg(target_arch = "mips64")] -/// `target_arch` when building this crate: `mips64` -pub const TARGET_ARCH: Arch = Arch::Mips64; - -#[cfg(target_arch = "msp430")] -/// `target_arch` when building this crate: `msp430` -pub const TARGET_ARCH: Arch = Arch::Msp430; - -#[cfg(target_arch = "nvptx64")] -/// `target_arch` when building this crate: `nvptx64` -pub const TARGET_ARCH: Arch = Arch::Nvptx64; - -#[cfg(target_arch = "powerpc")] -/// `target_arch` when building this crate: `powerpc` -pub const TARGET_ARCH: Arch = Arch::PowerPc; - -#[cfg(target_arch = "powerpc64")] -/// `target_arch` when building this crate: `powerpc64` -pub const TARGET_ARCH: Arch = Arch::PowerPc64; - -#[cfg(target_arch = "riscv")] -/// `target_arch` when building this crate: `riscv` -pub const TARGET_ARCH: Arch = Arch::RiscV; - -#[cfg(target_arch = "s390x")] -/// `target_arch` when building this crate: `s390x` -pub const TARGET_ARCH: Arch = Arch::S390X; - -#[cfg(target_arch = "sparc")] -/// `target_arch` when building this crate: `sparc` -pub const TARGET_ARCH: Arch = Arch::Sparc; - -#[cfg(target_arch = "sparc64")] -/// `target_arch` when building this crate: `sparc64` -pub const TARGET_ARCH: Arch = Arch::Sparc64; - -#[cfg(target_arch = "wasm32")] -/// `target_arch` when building this crate: `wasm32` -pub const TARGET_ARCH: Arch = Arch::Wasm32; - -#[cfg(target_arch = "x86")] -/// `target_arch` when building this crate: `x86` -pub const TARGET_ARCH: Arch = Arch::X86; - -#[cfg(target_arch = "x86_64")] -/// `target_arch` when building this crate: `x86_64` -pub const TARGET_ARCH: Arch = Arch::X86_64; - -#[cfg(target_os = "android")] -/// `target_os` when building this crate: `android` -pub const TARGET_OS: OS = OS::Android; - -#[cfg(target_os = "cuda")] -/// `target_os` when building this crate: `cuda` -pub const TARGET_OS: OS = OS::Cuda; - -#[cfg(target_os = "dragonfly")] -/// `target_os` when building this crate: `dragonfly` -pub const TARGET_OS: OS = OS::Dragonfly; - -#[cfg(target_os = "emscripten")] -/// `target_os` when building this crate: `emscripten` -pub const TARGET_OS: OS = OS::Emscripten; - -#[cfg(target_os = "freebsd")] -/// `target_os` when building this crate: `freebsd` -pub const TARGET_OS: OS = OS::FreeBSD; - -#[cfg(target_os = "fuchsia")] -/// `target_os` when building this crate: `fuchsia` -pub const TARGET_OS: OS = OS::Fuchsia; - -#[cfg(target_os = "haiku")] -/// `target_os` when building this crate: `haiku` -pub const TARGET_OS: OS = OS::Haiku; - -#[cfg(target_os = "hermit")] -/// `target_os` when building this crate: `hermit` -pub const TARGET_OS: OS = OS::Hermit; - -#[cfg(target_os = "illumos")] -/// `target_os` when building this crate: `illumos` -pub const TARGET_OS: OS = OS::Illumos; - -#[cfg(target_os = "ios")] -/// `target_os` when building this crate: `ios` -pub const TARGET_OS: OS = OS::iOS; - -#[cfg(target_os = "linux")] -/// `target_os` when building this crate: `linux` -pub const TARGET_OS: OS = OS::Linux; - -#[cfg(target_os = "macos")] -/// `target_os` when building this crate: `macos` -pub const TARGET_OS: OS = OS::MacOS; - -#[cfg(target_os = "netbsd")] -/// `target_os` when building this crate: `netbsd` -pub const TARGET_OS: OS = OS::NetBSD; - -#[cfg(target_os = "openbsd")] -/// `target_os` when building this crate: `openbsd` -pub const TARGET_OS: OS = OS::OpenBSD; - -#[cfg(target_os = "redox")] -/// `target_os` when building this crate: `redox` -pub const TARGET_OS: OS = OS::Redox; - -#[cfg(target_os = "solaris")] -/// `target_os` when building this crate: `solaris` -pub const TARGET_OS: OS = OS::Solaris; - -#[cfg(target_os = "tvos")] -/// `target_os` when building this crate: `tvos` -pub const TARGET_OS: OS = OS::TvOS; - -#[cfg(target_os = "wasi")] -/// `target_os` when building this crate: `wasi` -pub const TARGET_OS: OS = OS::Wasi; - -#[cfg(target_os = "windows")] -/// `target_os` when building this crate: `windows` -pub const TARGET_OS: OS = OS::Windows; - -#[cfg(target_os = "vxworks")] -/// `target_os` when building this crate: `vxworks` -pub const TARGET_OS: OS = OS::VxWorks; + #[test] + fn same_on_target() { + assert_eq!(std::env::consts::EXE_SUFFIX, TARGET_OS.exe_suffix()); + } +} diff --git a/build/ci_utils/src/program.rs b/build/ci_utils/src/program.rs index a389edb536d..1ffd2cb8196 100644 --- a/build/ci_utils/src/program.rs +++ b/build/ci_utils/src/program.rs @@ -63,7 +63,7 @@ pub trait Program: Sized + 'static { /// /// The lookup locations are program-defined, they typically include Path environment variable /// and program-specific default locations. - fn lookup(&self) -> anyhow::Result> { + fn lookup(&self) -> Result> { Resolver::::new(self.executable_names(), self.default_locations())? .lookup() .map(Location::new) @@ -112,7 +112,7 @@ pub trait Program: Sized + 'static { } fn handle_exit_status(status: std::process::ExitStatus) -> Result { - status.exit_ok().anyhow_err() + Ok(status.exit_ok()?) } /// Command that prints to stdout the version of given program. diff --git a/build/ci_utils/src/program/command.rs b/build/ci_utils/src/program/command.rs index 2630df0fc9d..878873b85e7 100644 --- a/build/ci_utils/src/program/command.rs +++ b/build/ci_utils/src/program/command.rs @@ -81,7 +81,7 @@ pub trait MyCommand: BorrowMut + From + Into Result { - self.borrow_mut().spawn().anyhow_err() + self.borrow_mut().spawn() } } @@ -298,7 +298,7 @@ impl Debug for Command { impl Command { pub fn new>(program: S) -> Command { let inner = tokio::process::Command::new(program); - let status_checker = Arc::new(|status: ExitStatus| status.exit_ok().anyhow_err()); + let status_checker = Arc::new(|status: ExitStatus| Ok(status.exit_ok()?)); Self { inner, status_checker, pretty_name: None } } diff --git a/build/ci_utils/src/program/version.rs b/build/ci_utils/src/program/version.rs index 27ef6cd68ca..33dd5968982 100644 --- a/build/ci_utils/src/program/version.rs +++ b/build/ci_utils/src/program/version.rs @@ -28,7 +28,7 @@ impl IsVersion for Version { let matched = SEMVER_REGEX.find(text).context("No semver-like substring found within the text.")?; let version_text = matched.as_str(); - Version::from_str(version_text) + Ok(Version::from_str(version_text)?) } } diff --git a/build/ci_utils/src/programs/cmd.rs b/build/ci_utils/src/programs/cmd.rs index fd77478f4dc..fbfe7c37032 100644 --- a/build/ci_utils/src/programs/cmd.rs +++ b/build/ci_utils/src/programs/cmd.rs @@ -99,8 +99,8 @@ pub async fn compare_env( f(&mut cmd); add_next_command(&mut cmd, ["set"]); let output = cmd.output_ok().await?; - let outputs = - split_command_outputs(&output.stdout).map(std::str::from_utf8).try_collect_vec()?; + let outputs: Vec<_> = + split_command_outputs(&output.stdout).map(std::str::from_utf8).try_collect()?; ensure!(outputs.len() == 3, "Expected outputs from all 3 commands!"); diff --git a/build/ci_utils/src/programs/docker.rs b/build/ci_utils/src/programs/docker.rs index a14f2853bea..d4c704f5279 100644 --- a/build/ci_utils/src/programs/docker.rs +++ b/build/ci_utils/src/programs/docker.rs @@ -578,7 +578,7 @@ impl RunOptions { #[derive(Clone, Display, Debug, PartialEq, Eq, Hash)] pub struct ImageId(pub String); -impl std::str::FromStr for ImageId { +impl FromStr for ImageId { type Err = anyhow::Error; fn from_str(s: &str) -> std::result::Result { @@ -589,7 +589,7 @@ impl std::str::FromStr for ImageId { #[derive(Clone, Debug, Display, Deref, AsRef)] pub struct ContainerId(pub String); -impl std::str::FromStr for ContainerId { +impl FromStr for ContainerId { type Err = anyhow::Error; fn from_str(s: &str) -> std::result::Result { @@ -646,7 +646,7 @@ mod tests { fn get_kernel_version() -> Result { let ret = sysinfo::System::kernel_version() .with_context(|| "Failed to get OS kernel version.")? - .parse2()?; + .parse()?; debug!("OS kernel version: {ret}."); Ok(ret) } diff --git a/build/ci_utils/src/programs/git.rs b/build/ci_utils/src/programs/git.rs index 56509c81f84..45d41a7a48d 100644 --- a/build/ci_utils/src/programs/git.rs +++ b/build/ci_utils/src/programs/git.rs @@ -207,7 +207,7 @@ impl Context { let hash = fields.next().context("Missing hash.")?; let refs = fields.next().context("Missing refs.")?; let refs = refs_from_decoration(&refs); - let refs = refs.into_iter().map(|s| s.parse2()).try_collect()?; + let refs = refs.into_iter().map(|s| s.parse()).try_collect()?; Ok(LogEntry { hash, refs }) }) .try_collect() @@ -333,14 +333,14 @@ pub struct RemoteLsEntry { } /// Construct from a line of output of `git ls-remote`. -impl std::str::FromStr for RemoteLsEntry { +impl FromStr for RemoteLsEntry { type Err = anyhow::Error; #[context("Failed to parse remote ls entry from string: {}", line)] fn from_str(line: &str) -> std::result::Result { let mut parts = line.split_whitespace(); let hash = parts.next().context("Missing hash")?.to_string(); - let r#ref = parts.next().context("Missing reference")?.parse2()?; + let r#ref = parts.next().context("Missing reference")?.parse()?; ensure!(parts.next().is_none(), "Unexpected trailing extra parts."); Ok(Self { hash, r#ref }) } diff --git a/build/ci_utils/src/programs/git/ref.rs b/build/ci_utils/src/programs/git/ref.rs index 278ac5171b7..4f02d014bfb 100644 --- a/build/ci_utils/src/programs/git/ref.rs +++ b/build/ci_utils/src/programs/git/ref.rs @@ -12,8 +12,8 @@ use crate::prelude::*; /// /// # Examples /// ``` -/// use enso_build_base::prelude::FromString; /// use ide_ci::programs::git::Ref; +/// use std::str::FromStr; /// let reference = Ref::from_str("refs/heads/master").unwrap(); /// assert_eq!(reference, Ref::Branch { name: "master".into() }); /// ``` @@ -51,7 +51,7 @@ pub enum Ref { }, } -impl std::str::FromStr for Ref { +impl FromStr for Ref { type Err = anyhow::Error; /// Parse the reference from the full decorated name, like `refs/heads/main`. diff --git a/build/ci_utils/src/programs/java.rs b/build/ci_utils/src/programs/java.rs index cf30c56f66b..940e7459fe4 100644 --- a/build/ci_utils/src/programs/java.rs +++ b/build/ci_utils/src/programs/java.rs @@ -77,11 +77,11 @@ mod tests { #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Deref)] pub struct LanguageVersion(pub u8); -impl std::str::FromStr for LanguageVersion { +impl FromStr for LanguageVersion { type Err = anyhow::Error; fn from_str(s: &str) -> std::result::Result { - s.parse2::().map(LanguageVersion) + Ok(LanguageVersion(s.parse()?)) } } diff --git a/build/ci_utils/src/programs/robocopy.rs b/build/ci_utils/src/programs/robocopy.rs index 63982efaea0..d466a332994 100644 --- a/build/ci_utils/src/programs/robocopy.rs +++ b/build/ci_utils/src/programs/robocopy.rs @@ -15,7 +15,7 @@ impl Program for Robocopy { fn handle_exit_status(status: std::process::ExitStatus) -> Result { match status.code() { - None => status.exit_ok().anyhow_err(), + None => Ok(status.exit_ok()?), Some(code) if code >= 8 => bail!("Exit with code {}.", code), Some(_) => Ok(()), } diff --git a/build/ci_utils/src/programs/wasm_opt.rs b/build/ci_utils/src/programs/wasm_opt.rs index 83603f96e15..f6d59f2c74d 100644 --- a/build/ci_utils/src/programs/wasm_opt.rs +++ b/build/ci_utils/src/programs/wasm_opt.rs @@ -56,10 +56,10 @@ impl Program for WasmOpt { #[derive(Clone, Copy, Debug, Display, PartialEq, PartialOrd, Deref, Eq)] pub struct Version(pub u32); -impl std::str::FromStr for Version { - type Err = ::Err; +impl FromStr for Version { + type Err = ::Err; fn from_str(s: &str) -> std::result::Result { - std::str::FromStr::from_str(s).map(Self) + Ok(Self(s.parse()?)) } } @@ -68,7 +68,7 @@ impl IsVersion for Version { let number_regex = regex::Regex::new(r#"\d+"#)?; let number_match = number_regex.find(text).context("No number in the given text.")?; let number_text = number_match.as_str(); - number_text.parse2() + Ok(number_text.parse()?) } } diff --git a/build/ci_utils/src/serde.rs b/build/ci_utils/src/serde.rs index 0933b4a64ca..4d624ef738f 100644 --- a/build/ci_utils/src/serde.rs +++ b/build/ci_utils/src/serde.rs @@ -112,11 +112,12 @@ pub mod via_string { ser.collect_str(value) } - /// Deserializer, that uses [`FromString`] trait. + /// Deserializer, that uses [`FromStr`] trait. pub fn deserialize<'de, D, T>(de: D) -> std::result::Result where D: Deserializer<'de>, - T: FromString, { + T: FromStr, + T::Err: Display, { let text = String::deserialize(de)?; T::from_str(&text).map_err(D::Error::custom) } @@ -138,11 +139,12 @@ pub mod via_string_opt { } } - /// Deserializer, that uses [`FromString`] trait. + /// Deserializer, that uses [`FromStr`] trait. pub fn deserialize<'de, D, T>(de: D) -> std::result::Result, D::Error> where D: Deserializer<'de>, - T: FromString, { + T: FromStr, + T::Err: Display, { let text = Option::::deserialize(de)?; if let Some(text) = text { T::from_str(&text).map(Some).map_err(D::Error::custom) diff --git a/build/cli/Cargo.toml b/build/cli/Cargo.toml index ac401299266..1eb706333a7 100644 --- a/build/cli/Cargo.toml +++ b/build/cli/Cargo.toml @@ -1,22 +1,18 @@ [package] name = "enso-build-cli" -version = "0.1.0" edition = "2021" +version = "0.1.0" default-run = "enso-build-cli" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = { workspace = true } clap = { workspace = true } -derivative = { workspace = true } +derive-where = { workspace = true } enso-build-base = { path = "../base" } enso-build = { path = "../build" } enso-formatter = { path = "../enso-formatter" } -futures-util = "0.3.17" +futures-util = { workspace = true } ide-ci = { path = "../ci_utils" } octocrab = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } - -[lints] -workspace = true diff --git a/build/cli/src/arg.rs b/build/cli/src/arg.rs index 72b0afa4709..eb4bc3d2ff9 100644 --- a/build/cli/src/arg.rs +++ b/build/cli/src/arg.rs @@ -10,8 +10,7 @@ use clap::Args; use clap::Parser; use clap::Subcommand; use clap::ValueEnum; -use derivative::Derivative; -use enso_build_base::extensions::path::display_fmt; +use derive_where::derive_where; use ide_ci::cache; use ide_ci::github::Repo; use octocrab::models::RunId; @@ -184,8 +183,8 @@ pub struct Cli { /// Describe where to get a target artifacts from. /// /// This is the CLI representation of a [crate::source::Source] for a given target. -#[derive(Args, Clone, Debug, Derivative)] -#[derivative(PartialEq)] +#[derive(Args, Clone, Debug)] +#[derive_where(PartialEq)] #[group(skip)] pub struct Source { /// How the given target should be acquired. @@ -220,11 +219,9 @@ pub struct Source { pub release: Option, /// Used when `SourceKind::Build` is used. - #[derivative(PartialEq(bound = ""))] #[clap(flatten)] pub build_args: BuildDescription, - #[derivative(PartialEq(bound = ""))] #[clap(flatten)] pub output_path: OutputPath, } @@ -245,15 +242,14 @@ pub enum SourceKind { } /// Strongly typed argument for an output directory of a given build target. -#[derive(Args, Clone, Derivative)] +#[derive(Args, Clone)] #[group(skip)] -#[derivative(Debug, PartialEq)] +#[derive_where(Debug, PartialEq)] pub struct OutputPath { /// Directory where artifacts should be placed. - #[derivative(Debug(format_with = "display_fmt"))] #[clap(name = Target::OUTPUT_PATH_NAME, long, value_parser(normalize_path), default_value = Target::DEFAULT_OUTPUT_PATH, enso_env())] pub output_path: PathBuf, - #[derivative(Debug = "ignore", PartialEq(bound = ""))] + #[derive_where(skip(Debug))] #[allow(missing_docs)] #[clap(skip)] pub phantom: PhantomData, @@ -265,11 +261,10 @@ impl AsRef for OutputPath { } } -#[derive(Args, Clone, Derivative)] +#[derive(Args, Clone)] #[group(skip)] -#[derivative(Debug, PartialEq)] +#[derive_where(Debug, PartialEq)] pub struct BuildDescription { - #[derivative(PartialEq(bound = ""))] #[clap(flatten)] pub input: Target::BuildInput, // Cumbersome way of defining a bool argument that can take explicit value. @@ -286,9 +281,8 @@ pub struct BuildDescription { pub upload_artifact: bool, } -#[derive(Args, Clone, PartialEq, Derivative)] +#[derive(Args, Clone, PartialEq, Debug)] #[group(skip)] -#[derivative(Debug)] pub struct BuildJob { #[clap(flatten)] pub input: BuildDescription, @@ -296,9 +290,8 @@ pub struct BuildJob { pub output_path: OutputPath, } -#[derive(Args, Clone, PartialEq, Derivative)] +#[derive(Args, Clone, PartialEq, Debug)] #[group(skip)] -#[derivative(Debug)] pub struct WatchJob { #[clap(flatten)] pub build: BuildJob, @@ -308,8 +301,5 @@ pub struct WatchJob { /// Clap parser supporting a given set of [`OS`] values. pub fn possible_os_parser(possible_os: &[OS]) -> impl TypedValueParser { - PossibleValuesParser::new(possible_os.iter().map(|os| os.as_str())) - // Unwrap below is safe, because it is symmetric to the `as_str` conversion above, and - // we'll get only the values that were generated from the `possible_os` array. - .map(|s| s.parse::().unwrap()) + PossibleValuesParser::new(possible_os.iter().map(|os| os.as_str())).map(|s| OS::from_str(&s)) } diff --git a/build/cli/src/arg/ide.rs b/build/cli/src/arg/ide.rs index 932567cee06..359a3ac914d 100644 --- a/build/cli/src/arg/ide.rs +++ b/build/cli/src/arg/ide.rs @@ -14,16 +14,13 @@ use octocrab::models::ReleaseId; source_args_hlp!(Target, "ide", BuildInput); -#[derive(Args, Clone, Debug, Derivative)] +#[derive(Args, Clone, Debug, PartialEq)] #[group(skip)] -#[derivative(PartialEq)] pub struct BuildInput { - #[derivative(PartialEq(bound = ""))] #[clap(flatten)] pub gui: Source, #[clap(flatten)] pub project_manager: Source, - #[derivative(PartialEq(bound = ""))] #[clap(flatten)] pub output_path: OutputPath, /// Override the default target for electron-builder. E.g. pass `dir` for unpacked directory diff --git a/build/cli/src/lib.rs b/build/cli/src/lib.rs index d0043305cbf..f8cc8a5ff37 100644 --- a/build/cli/src/lib.rs +++ b/build/cli/src/lib.rs @@ -31,7 +31,6 @@ use crate::arg::WatchJob; use anyhow::Context; use arg::BuildDescription; use clap::Parser; -use derivative::Derivative; use enso_build::config::Config; use enso_build::context::BuildContext; use enso_build::engine::context::EnginePackageProvider; @@ -91,8 +90,7 @@ define_env_var! { } /// The basic, common information available in this application. -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone, Debug)] pub struct Processor { pub context: BuildContext, } @@ -192,12 +190,12 @@ impl Processor { ) -> BoxFuture<'static, Result> { let repository = self.remote_repo.clone(); let release = self.resolve_release_designator(designator); - release - .and_then_sync(move |release| { - let asset = target.find_asset(&release)?; - Ok(ReleaseSource { repository, asset_id: asset.id }) - }) - .boxed() + async move { + let release = release.await?; + let asset = target.find_asset(&release)?; + Ok(ReleaseSource { repository, asset_id: asset.id }) + } + .boxed() } pub fn js_build_info(&self) -> BoxFuture<'static, Result> { @@ -640,22 +638,21 @@ impl Resolvable for Backend { ) -> BoxFuture<'static, Result<::BuildInput>> { let arg::backend::BuildInput { runtime } = from; let versions = ctx.triple.versions.clone(); - let context = ctx.context.inner.clone(); - - ctx.resolve(Runtime, runtime) - .and_then_sync(|runtime| { - let external_runtime = runtime.to_external().map(move |external| { - Arc::new(move || { - Runtime - .get_external(context.clone(), external.clone()) - .map_ok(|artifact| artifact.into_inner()) - .boxed() - }) as Arc - }); - Ok(backend::BuildInput { external_runtime, versions }) - }) - .boxed() + let runtime_future = ctx.resolve(Runtime, runtime); + async { + let runtime = runtime_future.await?; + let external_runtime = runtime.to_external().map(move |external| { + Arc::new(move || { + Runtime + .get_external(context.clone(), external.clone()) + .map_ok(|artifact| artifact.into_inner()) + .boxed() + }) as Arc + }); + Ok(backend::BuildInput { external_runtime, versions }) + } + .boxed() } } diff --git a/build/enso-formatter/src/lib.rs b/build/enso-formatter/src/lib.rs index 54deec29614..5628c83fc32 100644 --- a/build/enso-formatter/src/lib.rs +++ b/build/enso-formatter/src/lib.rs @@ -14,7 +14,6 @@ #![deny(keyword_idents)] #![deny(macro_use_extern_crate)] #![deny(missing_abi)] -#![deny(pointer_structural_match)] #![deny(unsafe_op_in_unsafe_fn)] #![deny(unconditional_recursion)] #![warn(absolute_paths_not_starting_with_crate)] @@ -420,7 +419,7 @@ pub fn discover_paths_internal( let is_main_dir = dir_name.contains(&"bin"); // || dir_name == Some(OsStr::new("tests")); let sub_paths = fs::read_dir(path)?; for sub_path in sub_paths { - discover_paths_internal(vec, &sub_path?.path(), is_main_dir)?; + discover_paths_internal(vec, sub_path?.path(), is_main_dir)?; } } else if md.is_file() && path.extension().contains(&"rs") { let is_main_file = path diff --git a/build/install/Cargo.toml b/build/install/Cargo.toml index 804edd0a1ed..75692efb07e 100644 --- a/build/install/Cargo.toml +++ b/build/install/Cargo.toml @@ -16,15 +16,8 @@ strum = { workspace = true } sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } -windows = { version = "0.53.0", features = [ - "Win32", - "Win32_UI", - "Win32_UI_Shell", - "Win32_System", - "Win32_System_LibraryLoader", - "Win32_Foundation", - "Win32_System_Com", -] } +windows = { workspace = true } +derive_more = { workspace = true } [target.'cfg(windows)'.dependencies] mslnk = "0.1.8" diff --git a/build/install/installer/Cargo.toml b/build/install/installer/Cargo.toml index 270ac3fd39d..ab15833aa87 100644 --- a/build/install/installer/Cargo.toml +++ b/build/install/installer/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] anyhow = { workspace = true } -byte-unit = { workspace = true } +bytesize = "1.3.0" chrono = { workspace = true } enso-install = { path = ".." } enso-install-config = { path = "../config" } diff --git a/build/install/installer/src/lib.rs b/build/install/installer/src/lib.rs index 7a66bb856b6..10da3304abe 100644 --- a/build/install/installer/src/lib.rs +++ b/build/install/installer/src/lib.rs @@ -1,8 +1,5 @@ //! This crate implements the Windows installer for the Enso IDE. -// === Features === -#![feature(lazy_cell)] - use enso_install::prelude::*; use enso_install::access_built_time_env; diff --git a/build/install/installer/src/win/logic.rs b/build/install/installer/src/win/logic.rs index c3a4ac177da..7aa34114208 100644 --- a/build/install/installer/src/win/logic.rs +++ b/build/install/installer/src/win/logic.rs @@ -222,15 +222,15 @@ pub fn check_disk_space( .find(|disk| path.starts_with(disk.mount_point())) .context("No disk information found for the installation directory.")?; - let required_space = byte_unit::Byte::from_u64(bytes_required); - let free_space = byte_unit::Byte::from_u64(disk.available_space()); + let required_space = bytesize::ByteSize(bytes_required); + let free_space = bytesize::ByteSize(disk.available_space()); if free_space < required_space { let msg = format!( "Not enough disk space on {} to install. Required: {:.2}, available: {:.2}.", disk.mount_point().display(), - required_space.get_appropriate_unit(byte_unit::UnitType::Binary), - free_space.get_appropriate_unit(byte_unit::UnitType::Binary) + required_space, + free_space ); return Ok(Some(msg)); } diff --git a/build/install/src/lib.rs b/build/install/src/lib.rs index aa794d9ce71..04af7f97810 100644 --- a/build/install/src/lib.rs +++ b/build/install/src/lib.rs @@ -1,10 +1,5 @@ //! This crate is linked in both by the installer and the uninstaller. -// === Features === -#![feature(lazy_cell)] - - - pub mod prelude { pub use ide_ci::prelude::*; diff --git a/build/install/uninstaller/Cargo.toml b/build/install/uninstaller/Cargo.toml index fee9141798e..0dd408110c8 100644 --- a/build/install/uninstaller/Cargo.toml +++ b/build/install/uninstaller/Cargo.toml @@ -10,7 +10,7 @@ anyhow = { workspace = true } enso-install = { path = ".." } enso-install-config = { path = "../config" } ide-ci = { path = "../../ci_utils" } -self-replace = "1.3.7" +self-replace = "1.4.0" sysinfo = { workspace = true } tokio = { workspace = true } diff --git a/build/macros/lib/Cargo.toml b/build/macros/lib/Cargo.toml index d50513285b0..6490f4c11a6 100644 --- a/build/macros/lib/Cargo.toml +++ b/build/macros/lib/Cargo.toml @@ -13,7 +13,7 @@ proc-macro2 = { workspace = true } quote = { workspace = true } regex = { workspace = true } serde_yaml = { workspace = true } -syn_1 = { workspace = true } +syn = { workspace = true } derive_more = { workspace = true } [lints] diff --git a/build/macros/lib/src/lib.rs b/build/macros/lib/src/lib.rs index 391c2838ba1..8118b2968ea 100644 --- a/build/macros/lib/src/lib.rs +++ b/build/macros/lib/src/lib.rs @@ -1,25 +1 @@ -// === Features === -#![feature(const_trait_impl)] -#![feature(string_remove_matches)] -#![feature(once_cell_try)] - - - -mod prelude { - pub use derive_more::*; - pub use enso_build_base::prelude::*; - - pub use convert_case::Case; - pub use convert_case::Casing; - pub use itertools::Itertools; - pub use proc_macro2::Span; - pub use proc_macro2::TokenStream; - pub use quote::quote; - pub use syn::Data; - pub use syn::DeriveInput; - pub use syn::Ident; - pub use syn_1 as syn; -} - pub mod paths; -pub mod program_args; diff --git a/build/macros/lib/src/paths.rs b/build/macros/lib/src/paths.rs index f72da66302c..16fce2caf94 100644 --- a/build/macros/lib/src/paths.rs +++ b/build/macros/lib/src/paths.rs @@ -1,7 +1,14 @@ -use crate::prelude::*; +use convert_case::Case; +use convert_case::Casing; +use derive_more::*; +use enso_build_base::prelude::*; +use itertools::Itertools; +use proc_macro2::Span; +use proc_macro2::TokenStream; +use quote::quote; +use syn::Ident; use regex::Regex; -use std::cell::OnceCell; use std::iter::zip; @@ -12,9 +19,7 @@ fn normalize_ident(ident: impl AsRef, case: Case) -> Ident { let normalized_text = if base == "." { String::from("Paths") } else { - let mut ret = base.replace(|c| matches!(c, '-' | '.' | ' '), "_"); - ret.remove_matches(|c| matches!(c, '<' | '>')); - ret + base.replace(['-', '.', ' '], "_").replace(['<', '>'], "") }; Ident::new(&normalized_text.to_case(case), Span::call_site()) @@ -103,12 +108,11 @@ pub fn get_string( pub struct Generator<'a> { all_nodes: &'a [&'a Node], stack: Vec<&'a Node>, - empty_set: BTreeSet, } impl<'a> Generator<'a> { pub fn new(all_nodes: &'a [&'a Node]) -> Self { - Self { all_nodes, stack: default(), empty_set: default() } + Self { all_nodes, stack: default() } } pub fn resolve(&self, r#type: &str) -> Result<&Node> { @@ -160,24 +164,16 @@ impl<'a> Generator<'a> { let parameter_vars = last_node.all_parameters_vars(self)?; let own_parameter_vars = last_node.own_parameter_vars(); - let parent_parameter_vars: BTreeSet<_> = - full_path.iter().flat_map(|n| n.own_parameter_vars()).collect(); - - let child_parameter_vars: BTreeSet<_> = last_node - .children() + let mut child_parameter_vars = BTreeSet::new(); + for node in last_node.children() { + child_parameter_vars.extend(node.all_parameters_vars(self)?.iter().cloned()) + } + let all_parameters: BTreeSet<_> = full_path .iter() - .map(|node| node.all_parameters_vars(self)) - .try_collect_vec()? - .into_iter() - .flatten() - .cloned() + .flat_map(|n| n.own_parameter_vars()) + .chain(child_parameter_vars.iter().cloned()) .collect(); - let all_parameters = { - let mut v = parent_parameter_vars; - v.extend(child_parameter_vars.clone()); - v - }; let mut segment_names = vec![]; for i in 0..full_path.len() { @@ -190,7 +186,7 @@ impl<'a> Generator<'a> { }); } - let children_init = zip(last_node.children(), &children_struct) + let children_init: Vec<_> = zip(last_node.children(), &children_struct) .map(|(child, children_struct)| { Result::Ok(if let Some(r#_type) = child.r#type.as_ref() { let resolved_type = self.resolve(r#_type)?; @@ -208,7 +204,7 @@ impl<'a> Generator<'a> { } }) }) - .try_collect_vec()?; + .try_collect()?; let opt_conversions = if parameter_vars.is_empty() { quote! { @@ -303,24 +299,21 @@ impl<'a> Generator<'a> { #[derive(Clone, Debug, PartialEq, Deref)] pub struct Node { #[deref] - value: String, - /// All parameters needed for this node (directly and for the children). - parameters: OnceCell>, // Wasteful but paths won't be that huge. + value: String, /// The name that replaces value in variable-like contexts. /// Basically, we might not want use filepath name as name in the code. - var_name: Option, - shape: Shape, - r#type: Option, + var_name: Option, + shape: Shape, + r#type: Option, } impl Node { pub fn new(value: impl AsRef) -> Self { let shape = Shape::new(value.as_ref()); let value = value.as_ref().trim_end_matches('/').to_string(); - let parameters = default(); let r#type = default(); let var_name = default(); - Self { var_name, parameters, shape, value, r#type } + Self { var_name, shape, value, r#type } } #[context("Failed to process node from key: {}", serde_yaml::to_string(value).unwrap())] @@ -353,29 +346,23 @@ impl Node { pub fn type_dependent_parameters_vars<'a>( &'a self, g: &'a Generator, - ) -> Result<&'a BTreeSet> { + ) -> Result> { if let Some(r#type) = &self.r#type { let resolved_type = g.resolve(r#type)?; resolved_type.all_parameters_vars(g) } else { - Ok(&g.empty_set) + Ok(default()) } } - pub fn all_parameters_vars(&self, g: &Generator) -> Result<&BTreeSet> { - self.parameters.get_or_try_init(|| { - let mut ret = BTreeSet::new(); - for child in self.children() { - ret.extend(child.all_parameters_vars(g)?.clone()); - } - ret.extend(self.own_parameter_vars()); - ret.extend(self.type_dependent_parameters_vars(g)?.clone()); - Ok(ret) - }) - // let mut ret = BTreeSet::new(); - // ret.extend(self.parameters.iter().sorted().map(to_ident)); - // ret.extend(self.type_dependent_parameters_vars(g)?); - // Ok(ret) + pub fn all_parameters_vars(&self, g: &Generator) -> Result> { + let mut ret = BTreeSet::new(); + for child in self.children() { + ret.extend(child.all_parameters_vars(g)?); + } + ret.extend(self.own_parameter_vars()); + ret.extend(self.type_dependent_parameters_vars(g)?); + Ok(ret) } pub fn own_parameters(&self) -> impl IntoIterator { @@ -389,22 +376,9 @@ impl Node { pub fn children_parameters(&self, g: &Generator) -> Result> { let mut ret = BTreeSet::new(); for child in self.children() { - ret.extend(child.all_parameters_vars(g)?.clone()); + ret.extend(child.all_parameters_vars(g)?); } Ok(ret) - // let resolved_type_params = if let Some(r#type) = &self.r#type { - // if let Ok(r#type) = g.resolve(r#type) { - // // TODO: This might not work for parameters that are type-introduced in the - // subtree // of the resolved type. - // r#type.all_parameters_vars(g).iter().map(to_ident).collect_vec() - // } else { - // warn!(%r#type, "Failed to resolve type."); - // default() - // } - // } else { - // default() - // }; - // direct_child_params.chain(resolved_type_params).collect() } pub fn children(&self) -> &[Node] { diff --git a/build/macros/lib/src/program_args.rs b/build/macros/lib/src/program_args.rs deleted file mode 100644 index d8a05eeb226..00000000000 --- a/build/macros/lib/src/program_args.rs +++ /dev/null @@ -1,214 +0,0 @@ -use crate::prelude::*; - - - -#[derive(Clone, Debug, PartialEq, Eq)] -pub struct Policy { - pub flag_case: Case, - pub format: Option, -} - -impl Default for Policy { - fn default() -> Self { - Self::default_const() - } -} - -impl Policy { - pub const fn default_const() -> Self { - Self { flag_case: Case::Kebab, format: None } - } -} - - -#[derive(Clone, Debug, PartialEq, Eq)] -pub struct Generator<'a> { - pub input: &'a DeriveInput, - pub policy: Vec, -} - -impl<'a> Generator<'a> { - pub fn current_policy(&self) -> &Policy { - static DEFAULT_POLICY: Policy = Policy::default_const(); - self.policy.last().unwrap_or(&DEFAULT_POLICY) - } - - pub fn new(input: &'a DeriveInput) -> Self { - Self { input, policy: vec![Default::default()] } - } - - pub fn format_flag(&mut self, name: impl ToString) -> String { - format!("--{}", name.to_string().to_case(self.current_policy().flag_case)) - } - - pub fn generate(self) -> TokenStream { - // let name = &self.input.ident; - match &self.input.data { - Data::Enum(e) => EnumGenerator::new(self, e).generate(), - _ => unimplemented!(), - // Data::Struct(_) => {} - // Data::Union(_) => {} - } - } -} - -#[derive(Clone, Debug, PartialEq, Eq, Deref, DerefMut)] -pub struct EnumGenerator<'a> { - #[deref] - #[deref_mut] - pub generator: Generator<'a>, - pub enum_data: &'a syn::DataEnum, -} - -impl<'a> EnumGenerator<'a> { - pub fn new(generator: Generator<'a>, enum_data: &'a syn::DataEnum) -> Self { - Self { generator, enum_data } - } - - /// Generate output for enum where all variants are units. - /// - /// In such case every variant can be converted to OsStr. - /// An iterator is just a single occurrence of the string. - pub fn generate_plain(&mut self) -> TokenStream { - let name = &self.generator.input.ident; - let variant_names = - self.enum_data.variants.iter().map(|variant| &variant.ident).collect_vec(); - let flags = variant_names.iter().map(|v| self.format_flag(v)).collect_vec(); - quote! { - impl AsRef for #name { - fn as_ref(&self) -> &std::ffi::OsStr { - match self { - #( #name::#variant_names => #flags, )* - }.as_ref() - } - } - - impl IntoIterator for #name { - type Item = std::ffi::OsString; - type IntoIter = std::iter::Once; - - fn into_iter(self) -> Self::IntoIter { - std::iter::once(self.as_ref().to_owned()) - } - } - } - } - - /// Generate arm that matches a variant with zero or one field and outputs `Vec`. - pub fn generate_arm_with_field(&mut self, variant: &syn::Variant) -> TokenStream { - let relevant_attrs = variant - .attrs - .iter() - .filter_map(|attr| attr.path.is_ident("arg").then_some(&attr.tokens)) - .collect_vec(); - // dbg!(&relevant_attrs.iter().map(|t| t.to_string()).collect_vec()); - let _relevant_attrs_as_expr = relevant_attrs - .iter() - .filter_map(|tokens| syn::parse2::((*tokens).clone()).ok()) - .collect_vec(); - // dbg!(relevant_attrs_as_expr); - - let name = &self.generator.input.ident; - let variant_name = &variant.ident; - let flag = self.format_flag(variant_name); - if let Some(_field) = variant.fields.iter().next() { - // let field_type = &field.ty; - quote! { - #name::#variant_name(field) => { - let mut result = Vec::new(); - result.push(#flag.into()); - let os_str: &OsStr = field.as_ref(); - result.push(os_str.into()); - result.into_iter() - } - } - } else { - quote! { - #name::#variant_name => vec![#flag.into()].into_iter() - } - } - } - - /// Generate output for enum where variant can have fields. - pub fn generate_with_fields(&mut self) -> TokenStream { - let name = &self.generator.input.ident; - let arms = self.enum_data.variants.iter().map(|v| self.generate_arm_with_field(v)); - quote! { - impl IntoIterator for #name { - type Item = std::ffi::OsString; - type IntoIter = std::vec::IntoIter; - - fn into_iter(self) -> Self::IntoIter { - match self { - #( #arms, )* - } - } - } - } - } - - pub fn generate(&mut self) -> TokenStream { - // If all variants are unit variants, we just pretty print their names. - if self.enum_data.variants.iter().all(|v| v.fields.is_empty()) { - self.generate_plain() - } else { - self.generate_with_fields() - } - } -} - -pub fn derive(input: DeriveInput) -> Result { - let generator = Generator::new(&input); - Ok(generator.generate()) -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - #[ignore] - fn foo() -> Result { - let code = "enum Foo { - #[arg] - Bar, - #[arg] - Baz, - #[arg] - Quux, - }"; - let _token_stream = syn::parse_str::(code)?; - Ok(()) - } - - /// Structure with AST of parenthesized sequence of assignments. - /// - /// For example, `(a = 1, b = ToString::to_string)`. - #[derive(Debug, Clone)] - pub struct Assignments { - pub paren_token: syn::token::Paren, - pub assignments: syn::punctuated::Punctuated, - } - - impl syn::parse::Parse for Assignments { - fn parse(input: syn::parse::ParseStream) -> syn::Result { - let content; - let paren_token = syn::parenthesized!(content in input); - let assignments = content.parse_terminated(syn::ExprAssign::parse)?; - Ok(Self { paren_token, assignments }) - } - } - - #[test] - #[ignore] - fn parse_attribute() -> Result { - let attribute = r#"(format = ToString :: to_string)"#; - let token_stream = syn::parse_str::(attribute)?; - dbg!(&token_stream); - let foo = syn::parse2::(token_stream)?; - dbg!(foo); - // let attribute = syn::parse2::(token_stream)?; - // dbg!(attribute); - Ok(()) - } -} diff --git a/build/macros/proc-macro/Cargo.toml b/build/macros/proc-macro/Cargo.toml deleted file mode 100644 index 3dbe096ab92..00000000000 --- a/build/macros/proc-macro/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "enso-build-macros" -version = "0.1.0" -edition = "2021" - -[lib] -proc-macro = true - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[dependencies] -enso-build-base = { path = "../../base" } -enso-build-macros-lib = { path = "../lib" } -syn_1 = { workspace = true } - -[dev-dependencies] -itertools = { workspace = true } -proc-macro2 = { workspace = true } - -[lints] -workspace = true diff --git a/build/macros/proc-macro/src/lib.rs b/build/macros/proc-macro/src/lib.rs deleted file mode 100644 index 651a5f30b9c..00000000000 --- a/build/macros/proc-macro/src/lib.rs +++ /dev/null @@ -1,23 +0,0 @@ -use syn_1 as syn; - - - -#[proc_macro_derive(Arg, attributes(arg))] -pub fn derive_arg_fn(item: proc_macro::TokenStream) -> proc_macro::TokenStream { - let input = syn::parse_macro_input!(item as syn::DeriveInput); - enso_build_macros_lib::program_args::derive(input) - .unwrap_or_else(|err| panic!("Failed to derive program argument: {err:?}")) - .into() -} - -/// This macro takes a string literal with YAML description of file tree and generates wrapper -/// classes. See the tests for this crate for usage examples. -#[proc_macro] -pub fn make_paths(item: proc_macro::TokenStream) -> proc_macro::TokenStream { - let input = syn::parse_macro_input!(item as syn::LitStr); - let input = input.value(); - enso_build_macros_lib::paths::process(input.as_bytes()) - // .inspect(|tt| println!("Generated: {:}", tt)) - .unwrap_or_else(|err| panic!("Failed to generate path types: {err:?}")) - .into() -} diff --git a/build/macros/proc-macro/tests/paths.rs b/build/macros/proc-macro/tests/paths.rs deleted file mode 100644 index 68851083323..00000000000 --- a/build/macros/proc-macro/tests/paths.rs +++ /dev/null @@ -1,24 +0,0 @@ -use enso_build_base::prelude::*; - - - -mod paths { - use enso_build_macros::make_paths; - - make_paths! { - r#" -/: - item: - item-.bar:"# - } -} - -#[test] -fn test_path_generation() -> Result { - let paths = paths::Root::new("name"); - assert_eq!(paths.path, PathBuf::from("name")); - assert_eq!(paths.item.path, PathBuf::from_iter(["name", "item"])); - assert_eq!(paths.item_root_bar.path, PathBuf::from_iter(["name", "item-name.bar"])); - - Ok(()) -} diff --git a/build/macros/proc-macro/tests/plain.rs b/build/macros/proc-macro/tests/plain.rs deleted file mode 100644 index abc29b4285a..00000000000 --- a/build/macros/proc-macro/tests/plain.rs +++ /dev/null @@ -1,39 +0,0 @@ -// === Non-Standard Linter Configuration === -#![allow(clippy::disallowed_names)] - -use enso_build_base::prelude::*; - -use itertools::Itertools; -use std::str::FromStr; -use syn_1 as syn; - - - -#[derive(Clone, Copy, Debug, enso_build_macros::Arg)] -pub enum Foo { - Foo, - BarBaz, -} - -#[test] -fn hello() { - let foo = Foo::Foo; - assert_eq!(foo.as_ref(), OsStr::new("--foo")); - let args = foo.into_iter().collect_vec(); - assert_eq!(args, vec![OsString::from("--foo")]); - - let bar_baz = Foo::BarBaz; - assert_eq!(bar_baz.as_ref(), OsStr::new("--bar-baz")); - let args = bar_baz.into_iter().collect_vec(); - assert_eq!(args, vec![OsString::from("--bar-baz")]); -} - -#[test] -fn experiment_with_parsing() -> Result { - let code = "foo = ToString::to_string"; - let token_stream = proc_macro2::TokenStream::from_str(code).unwrap(); - dbg!(&token_stream); - let foo = syn::parse2::(token_stream).unwrap(); - dbg!(&foo); - Ok(()) -} diff --git a/build/macros/proc-macro/tests/with_arg.rs b/build/macros/proc-macro/tests/with_arg.rs deleted file mode 100644 index 7b8d1183e1f..00000000000 --- a/build/macros/proc-macro/tests/with_arg.rs +++ /dev/null @@ -1,32 +0,0 @@ -use enso_build_base::prelude::*; - -use itertools::Itertools; - - - -#[derive(Clone, Debug, enso_build_macros::Arg)] -pub enum Foo { - Bar, - BarBaz(String), - HogeHoge(OsString), - // #[arg(format = ToString::to_string)] - // TaraPon(u32), -} - -#[test] -fn test_argument_formatting() { - let bar = Foo::Bar; - assert_eq!(bar.into_iter().collect_vec(), vec![OsString::from("--bar")]); - - let bar_baz = Foo::BarBaz("foo".into()); - assert_eq!(bar_baz.into_iter().collect_vec(), vec![ - OsString::from("--bar-baz"), - OsString::from("foo") - ]); - - let hoge_hoge = Foo::HogeHoge(OsString::from("foo")); - assert_eq!(hoge_hoge.into_iter().collect_vec(), vec![ - OsString::from("--hoge-hoge"), - OsString::from("foo") - ]); -} diff --git a/build/macros/proc-macro/tests/with_attr.rs b/build/macros/proc-macro/tests/with_attr.rs deleted file mode 100644 index 1ed4d908b1a..00000000000 --- a/build/macros/proc-macro/tests/with_attr.rs +++ /dev/null @@ -1,23 +0,0 @@ -// use enso_build_base::prelude::*; -// -// use itertools::Itertools; -// - -// #[derive(enso_build_macros::Arg)] -// pub enum Foo { -// Bar, -// #[arg(format = ToString::to_string)] -// TaraPon(u32), -// } -// -// #[test] -// fn test_argument_formatting() { -// let bar = Foo::Bar; -// assert_eq!(bar.into_iter().collect_vec(), vec![OsString::from("--bar")]); -// -// let tara_pon = Foo::TaraPon(42); -// assert_eq!(tara_pon.into_iter().collect_vec(), vec![ -// OsString::from("--tara-pon"), -// OsString::from("42") -// ]); -// } diff --git a/lib/rust/data-structures/Cargo.toml b/lib/rust/data-structures/Cargo.toml deleted file mode 100644 index 2737d9dee11..00000000000 --- a/lib/rust/data-structures/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "enso-data-structures" -version = "0.2.0" -authors = ["Enso Team "] -edition = "2021" -description = "A collection of useful data structures." -readme = "README.md" -homepage = "https://github.com/enso-org/enso/lib/rust/data" -repository = "https://github.com/enso-org/enso" -license-file = "../../LICENSE" -keywords = [] -categories = ["data-structures"] -publish = true - -[lib] -crate-type = ["rlib", "cdylib"] - -[dependencies] -enso-prelude = { path = "../prelude" } -serde = { workspace = true } -failure = { workspace = true } - -[lints] -workspace = true diff --git a/lib/rust/data-structures/README.md b/lib/rust/data-structures/README.md deleted file mode 100644 index 58adf8ce5f0..00000000000 --- a/lib/rust/data-structures/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Enso Data Structures - -A collection of useful data structures. diff --git a/lib/rust/data-structures/src/lib.rs b/lib/rust/data-structures/src/lib.rs deleted file mode 100644 index 391ae14111c..00000000000 --- a/lib/rust/data-structures/src/lib.rs +++ /dev/null @@ -1,15 +0,0 @@ -//! Library of general data structures. - -// === Non-Standard Linter Configuration === -#![deny(unconditional_recursion)] -#![warn(missing_docs)] -#![warn(trivial_casts)] - - -// ============== -// === Export === -// ============== - -pub mod im_list; - -pub use enso_prelude as prelude; diff --git a/lib/rust/macro-utils/Cargo.toml b/lib/rust/macro-utils/Cargo.toml index 269dc3a53c4..61377395329 100644 --- a/lib/rust/macro-utils/Cargo.toml +++ b/lib/rust/macro-utils/Cargo.toml @@ -18,7 +18,7 @@ crate-type = ["rlib"] [dependencies] proc-macro2 = { workspace = true } quote = { workspace = true } -syn_1 = { workspace = true } +syn = { workspace = true } [lints] workspace = true diff --git a/lib/rust/macro-utils/src/lib.rs b/lib/rust/macro-utils/src/lib.rs index f8162d53358..a7e108bc5dc 100644 --- a/lib/rust/macro-utils/src/lib.rs +++ b/lib/rust/macro-utils/src/lib.rs @@ -7,7 +7,6 @@ use proc_macro2::TokenTree; use syn::WhereClause; use syn::WherePredicate; -use syn_1 as syn; diff --git a/lib/rust/metamodel/Cargo.toml b/lib/rust/metamodel/Cargo.toml index 276aa5c44dd..487ebf6a02b 100644 --- a/lib/rust/metamodel/Cargo.toml +++ b/lib/rust/metamodel/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Enso Team "] [dependencies] enso-zst = { path = "../zst" } -derivative = { workspace = true } derive-where = { workspace = true } derive_more = { workspace = true } @@ -14,7 +13,7 @@ derive_more = { workspace = true } bincode = "1.3" [features] -default = ["graphviz", "java", "rust"] +default = [] graphviz = [] java = [] rust = [] diff --git a/lib/rust/metamodel/lexpr/Cargo.toml b/lib/rust/metamodel/lexpr/Cargo.toml index 31efb1c23fa..fbf02a218fb 100644 --- a/lib/rust/metamodel/lexpr/Cargo.toml +++ b/lib/rust/metamodel/lexpr/Cargo.toml @@ -7,12 +7,11 @@ authors = ["Enso Team "] [dependencies] lexpr = "0.2.6" bincode = "1.3" -serde = "1" +serde = { workspace = true } enso-metamodel = { path = "../" } -derivative = { workspace = true } +derive-where = { workspace = true } [dev-dependencies] -serde = { workspace = true } enso-reflect = { path = "../../reflect" } [lints] diff --git a/lib/rust/metamodel/lexpr/src/lib.rs b/lib/rust/metamodel/lexpr/src/lib.rs index 5926a00350c..6baa044b124 100644 --- a/lib/rust/metamodel/lexpr/src/lib.rs +++ b/lib/rust/metamodel/lexpr/src/lib.rs @@ -47,7 +47,7 @@ use enso_metamodel::meta::*; -use derivative::Derivative; +use derive_where::derive_where; use lexpr::Value; use std::collections::BTreeMap; use std::collections::BTreeSet; @@ -59,11 +59,10 @@ use std::collections::BTreeSet; // ============================= /// Render data to an S-expression representation based on its `meta` model. -#[derive(Derivative)] -#[derivative(Debug)] +#[derive_where(Debug)] pub struct ToSExpr<'g> { graph: &'g TypeGraph, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] mappers: BTreeMap Value>>, skip: BTreeSet, } diff --git a/lib/rust/metamodel/src/data_structures.rs b/lib/rust/metamodel/src/data_structures.rs index f38b37c5eb1..b3d93dd86a7 100644 --- a/lib/rust/metamodel/src/data_structures.rs +++ b/lib/rust/metamodel/src/data_structures.rs @@ -2,7 +2,6 @@ use vecmap::*; -use derivative::Derivative; use derive_where::derive_where; use enso_zst::ZST; @@ -175,15 +174,12 @@ pub mod vecmap { pub struct Unbound; /// Identifies a location within a `VecMap`. - #[derive(Derivative)] - #[derivative(Debug)] - #[derive_where(Clone, Copy; State)] - #[derive_where(Eq, PartialEq, Ord, PartialOrd, Hash)] + #[derive_where(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] pub struct Key { pub(super) index: usize, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] marker: ZST, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] state: ZST, } diff --git a/lib/rust/metamodel/src/java/bincode.rs b/lib/rust/metamodel/src/java/bincode.rs index 879ca5f235c..6869063d699 100644 --- a/lib/rust/metamodel/src/java/bincode.rs +++ b/lib/rust/metamodel/src/java/bincode.rs @@ -49,7 +49,7 @@ use crate::java::implementation::*; use crate::java::*; -use derivative::Derivative; +use derive_where::derive_where; use std::fmt::Write; @@ -59,17 +59,16 @@ use std::fmt::Write; // ========================== /// Supports configuring deserialization for a type. -#[derive(Derivative)] -#[derivative(Debug)] +#[derive_where(Debug)] pub struct DeserializerBuilder { root: ClassId, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] materializers: BTreeMap, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] mappers: BTreeMap, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pre_hooks: Vec, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] post_hooks: Vec, support: String, either_type: String, diff --git a/lib/rust/metamodel/src/java/implementation.rs b/lib/rust/metamodel/src/java/implementation.rs index 1059917656f..c4dfa6584be 100644 --- a/lib/rust/metamodel/src/java/implementation.rs +++ b/lib/rust/metamodel/src/java/implementation.rs @@ -243,8 +243,8 @@ fn implement_hash_code(graph: &TypeGraph, class: &Class) -> syntax::Method { /// /// The implementation: /// - Returns `true` if the objects are identity-equal. -/// - Returns `false` if the other object is not of the same type as this object. -/// Otherwise, returns a boolean-and of a field-by-field comparison: +/// - Returns `false` if the other object is not of the same type as this object. Otherwise, returns +/// a boolean-and of a field-by-field comparison: /// - Primitive fields are compared with `==`. /// - Reference-type fields are compared with `Object.equals`. /// diff --git a/lib/rust/parser/Cargo.toml b/lib/rust/parser/Cargo.toml index 3e94a4726a7..077ff7f6f38 100644 --- a/lib/rust/parser/Cargo.toml +++ b/lib/rust/parser/Cargo.toml @@ -15,7 +15,8 @@ debug = ["dep:enso-parser-syntax-tree-visitor"] [dependencies] enso-prelude = { path = "../prelude" } enso-reflect = { path = "../reflect" } -enso-data-structures = { path = "../data-structures" } +derive-where = { workspace = true } +derive_more = { workspace = true } enso-parser-syntax-tree-visitor = { path = "src/syntax/tree/visitor", optional = true } paste = { version = "1.0" } serde = { workspace = true } @@ -24,7 +25,7 @@ uuid = { version = "1.1", features = ["serde"] } bincode = "1.3" [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] -enso-metamodel = { path = "../metamodel", features = ["rust"] } +enso-metamodel = { path = "../metamodel" } rand = "0.8.5" rand_chacha = "0.3.1" rand_distr = "0.4.3" diff --git a/lib/rust/parser/debug/Cargo.toml b/lib/rust/parser/debug/Cargo.toml index addb4bf854f..4162d9570a2 100644 --- a/lib/rust/parser/debug/Cargo.toml +++ b/lib/rust/parser/debug/Cargo.toml @@ -11,7 +11,7 @@ license-file = "../../LICENSE" [dependencies] enso-parser = { path = "../", features = ["debug"] } -enso-metamodel = { path = "../../metamodel", features = ["rust"] } +enso-metamodel = { path = "../../metamodel" } enso-metamodel-lexpr = { path = "../../metamodel/lexpr" } enso-reflect = { path = "../../reflect" } lexpr = "0.2.6" diff --git a/lib/rust/parser/debug/tests/parse.rs b/lib/rust/parser/debug/tests/parse.rs index 64f03b63a21..59d4281af0d 100644 --- a/lib/rust/parser/debug/tests/parse.rs +++ b/lib/rust/parser/debug/tests/parse.rs @@ -1821,7 +1821,7 @@ fn nonsense_inputs_broken() { /// Check that the given [`Tree`] is a valid representation of the given source code: /// - Assert that the given [`Tree`] is composed of tokens that concatenate back to the given source -/// code. +/// code. /// - Assert that the given [`Tree`] can be serialized and deserialized without error. fn expect_tree_representing_code(code: &str, ast: &enso_parser::syntax::Tree) { assert_eq!(ast.code(), code, "{:?}", &ast); diff --git a/lib/rust/parser/doc-parser/Cargo.toml b/lib/rust/parser/doc-parser/Cargo.toml index 62b263669d2..8a98baa3910 100644 --- a/lib/rust/parser/doc-parser/Cargo.toml +++ b/lib/rust/parser/doc-parser/Cargo.toml @@ -16,11 +16,10 @@ enso-reflect = { path = "../../reflect" } serde = { workspace = true } [dev-dependencies] -enso-metamodel = { path = "../../metamodel", features = ["rust"] } +enso-metamodel = { path = "../../metamodel" } enso-metamodel-lexpr = { path = "../../metamodel/lexpr" } enso-parser = { path = "..", features = ["debug"] } lexpr = "0.2.6" -pretty_assertions = "1.4" [lints] workspace = true diff --git a/lib/rust/parser/doc-parser/src/doc_sections.rs b/lib/rust/parser/doc-parser/src/doc_sections.rs index eb5625e95da..96470be3746 100644 --- a/lib/rust/parser/doc-parser/src/doc_sections.rs +++ b/lib/rust/parser/doc-parser/src/doc_sections.rs @@ -77,7 +77,7 @@ impl Argument { // We split by the first colon or space, whatever comes first. // Typically a colon must be used as a separator, but in some documentation snippets we // have there is no colon and the name of the argument is simply the first word. - let mut split = text.splitn(2, |c| c == ':' || c == ' '); + let mut split = text.splitn(2, [':', ' ']); let name = split.next().unwrap_or(text).trim().to_string(); let description = split.next().unwrap_or_default().trim().to_string(); Self { name, description } diff --git a/lib/rust/parser/doc-parser/src/lib.rs b/lib/rust/parser/doc-parser/src/lib.rs index 3d04859f041..b8e09235b12 100644 --- a/lib/rust/parser/doc-parser/src/lib.rs +++ b/lib/rust/parser/doc-parser/src/lib.rs @@ -547,11 +547,14 @@ struct Scopes { } impl Scopes { - fn end_all(&mut self) -> impl Iterator { + fn end_all(&mut self) -> impl Iterator + '_ { self.end_including(VisibleOffset(0)) } - fn end_below(&mut self, indent: impl Into) -> impl Iterator { + fn end_below( + &mut self, + indent: impl Into, + ) -> impl Iterator + '_ { let indent = indent.into(); self.end_including(indent + VisibleOffset(1)) } @@ -559,14 +562,14 @@ impl Scopes { fn end_including( &mut self, indent: impl Into, - ) -> impl Iterator { + ) -> impl Iterator + '_ { let indent = indent.into(); - // FIXME: Don't allocate. - let mut scopes = vec![]; - while let Some(scope) = self.scopes.pop_if(|scope| scope.indent >= indent) { - scopes.push(scope.r#type); - } - scopes.into_iter() + let new_size = self + .scopes + .iter() + .rposition(move |scope| scope.indent < indent) + .map_or(0, |pos| pos + 1); + self.scopes.drain(new_size..).map(|s| s.r#type).rev() } fn start_list_if_not_started(&mut self, indent: impl Into) -> bool { @@ -676,7 +679,6 @@ pub trait TokenConsumer { #[cfg(test)] mod tests { use super::*; - use pretty_assertions::assert_eq; #[test] fn test_doc_parsing() { diff --git a/lib/rust/parser/generate-java/Cargo.toml b/lib/rust/parser/generate-java/Cargo.toml index 781722b896d..ec0b8c24458 100644 --- a/lib/rust/parser/generate-java/Cargo.toml +++ b/lib/rust/parser/generate-java/Cargo.toml @@ -10,11 +10,11 @@ repository = "https://github.com/enso-org/enso" license-file = "../../LICENSE" [dependencies] -enso-metamodel = { path = "../../metamodel", features = ["rust", "java"] } +enso-metamodel = { path = "../../metamodel", features = ["java"] } enso-prelude = { path = "../../prelude" } enso-parser = { path = ".." } enso-reflect = { path = "../../reflect", features = ["graphviz"] } -derivative = { workspace = true } +derive-where = { workspace = true } [lints] workspace = true diff --git a/lib/rust/parser/schema/Cargo.toml b/lib/rust/parser/schema/Cargo.toml index 8bee976991c..4e8497c6797 100644 --- a/lib/rust/parser/schema/Cargo.toml +++ b/lib/rust/parser/schema/Cargo.toml @@ -10,9 +10,9 @@ repository = "https://github.com/enso-org/enso" license-file = "../../LICENSE" [dependencies] -enso-metamodel = { path = "../../metamodel", features = ["rust"] } +enso-metamodel = { path = "../../metamodel" } enso-parser = { path = ".." } -enso-reflect = { path = "../../reflect", features = ["graphviz"] } +enso-reflect = { path = "../../reflect" } serde = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/lib/rust/data-structures/src/im_list.rs b/lib/rust/parser/src/im_list.rs similarity index 92% rename from lib/rust/data-structures/src/im_list.rs rename to lib/rust/parser/src/im_list.rs index 47011859ae0..a214eee9f5b 100644 --- a/lib/rust/data-structures/src/im_list.rs +++ b/lib/rust/parser/src/im_list.rs @@ -10,17 +10,16 @@ use crate::prelude::*; /// Immutable linked list containing values of type [`T`]. As every node of the list is kept in /// [`Rc`], cloning of any subsection of this list is very fast. -#[derive(Derivative, Deref)] -#[derivative(Clone(bound = ""))] -#[derivative(Default(bound = ""))] +#[derive(Deref)] +#[derive_where(Clone, Default)] pub struct List { #[allow(missing_docs)] pub data: Option>, } /// Non-empty list. It is guaranteed to have at least one element. See [`List`] to learn more. -#[derive(Derivative, Deref, Debug)] -#[derivative(Clone(bound = ""))] +#[derive(Deref, Debug)] +#[derive_where(Clone)] pub struct NonEmpty { #[allow(missing_docs)] pub node: Rc>, @@ -198,10 +197,18 @@ impl From> for List { } } -impl TryFrom> for NonEmpty { - type Error = failure::Error; - fn try_from(v: Vec) -> Result { - let err = "Cannot convert empty Vec to NonEmpty one."; - List::::from(v).into_non_empty().ok_or_else(|| failure::err_msg(err)) +#[derive(Debug, Clone, Copy)] +pub struct EmptyVectorError; + +impl Display for EmptyVectorError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Cannot convert empty Vec to NonEmpty one.") + } +} + +impl TryFrom> for NonEmpty { + type Error = EmptyVectorError; + fn try_from(v: Vec) -> Result { + List::::from(v).into_non_empty().ok_or(EmptyVectorError) } } diff --git a/lib/rust/parser/src/lib.rs b/lib/rust/parser/src/lib.rs index 917e00fefd9..633c1c6ed00 100644 --- a/lib/rust/parser/src/lib.rs +++ b/lib/rust/parser/src/lib.rs @@ -99,6 +99,7 @@ use crate::syntax::token; use crate::syntax::tree::SyntaxError; use crate::syntax::Finish; +mod im_list; // ============== // === Export === diff --git a/lib/rust/parser/src/macros.rs b/lib/rust/parser/src/macros.rs index 44d1a5af7e1..8289e8fd166 100644 --- a/lib/rust/parser/src/macros.rs +++ b/lib/rust/parser/src/macros.rs @@ -5,10 +5,9 @@ use crate::prelude::*; +use crate::im_list; use crate::syntax; -use enso_data_structures::im_list; - // ============== // === Export === @@ -35,12 +34,11 @@ pub use pattern::Pattern; /// /// If you want to create macro definition in Rust, use the [`macro_definition`] macro instead, /// which for a nice and concise definitions. -#[derive(Derivative)] -#[derivative(Debug)] +#[derive_where(Debug)] #[allow(missing_docs)] pub struct Definition<'a> { pub segments: im_list::NonEmpty>, - #[derivative(Debug = "ignore")] + #[derive_where(skip)] pub body: Rc, } diff --git a/lib/rust/parser/src/macros/pattern.rs b/lib/rust/parser/src/macros/pattern.rs index 2b8291d7e8e..792bc41c2f0 100644 --- a/lib/rust/parser/src/macros/pattern.rs +++ b/lib/rust/parser/src/macros/pattern.rs @@ -143,7 +143,7 @@ impl std::ops::Shr for Pattern { } /// The syntax `pattern1 | pattern2` is a shortcut for `or(pattern1, pattern2)`. -impl std::ops::BitOr for Pattern { +impl BitOr for Pattern { type Output = Pattern; fn bitor(self, rhs: Pattern) -> Self::Output { or(self, rhs) diff --git a/lib/rust/parser/src/macros/resolver.rs b/lib/rust/parser/src/macros/resolver.rs index d2997c5543b..5462541d779 100644 --- a/lib/rust/parser/src/macros/resolver.rs +++ b/lib/rust/parser/src/macros/resolver.rs @@ -24,6 +24,7 @@ use crate::prelude::*; +use crate::im_list::List; use crate::macros; use crate::macros::pattern; use crate::source::Code; @@ -37,7 +38,6 @@ use crate::syntax::Item; use crate::syntax::NewlineConsumer; use crate::syntax::TokenConsumer; -use enso_data_structures::im_list::List; use std::collections::HashMap; use std::collections::VecDeque; diff --git a/lib/rust/parser/src/source/code.rs b/lib/rust/parser/src/source/code.rs index 1dc5505d7ad..be51be341ee 100644 --- a/lib/rust/parser/src/source/code.rs +++ b/lib/rust/parser/src/source/code.rs @@ -71,7 +71,7 @@ pub struct Code<'s> { /// The borrowed string data. #[serde(serialize_with = "crate::serialization::serialize_cow")] #[serde(deserialize_with = "crate::serialization::deserialize_cow")] - #[reflect(as = "crate::serialization::Code", flatten, hide)] + #[reflect(as = crate::serialization::Code, flatten, hide)] #[deref] pub repr: StrRef<'s>, #[reflect(flatten)] diff --git a/lib/rust/parser/src/syntax/token.rs b/lib/rust/parser/src/syntax/token.rs index e0c765b6f9d..aef0db1baf1 100644 --- a/lib/rust/parser/src/syntax/token.rs +++ b/lib/rust/parser/src/syntax/token.rs @@ -382,7 +382,7 @@ pub enum Base { /// serialization for optional codepoints. #[derive(Clone, Copy, PartialEq, Eq, Serialize, Reflect, Deserialize, Debug)] #[reflect(transparent)] -pub struct Codepoint(#[reflect(as = "char")] u32); +pub struct Codepoint(#[reflect(as = char)] u32); impl Default for Codepoint { fn default() -> Self { diff --git a/lib/rust/parser/src/syntax/tree.rs b/lib/rust/parser/src/syntax/tree.rs index 6116e4e9537..2e34e14929f 100644 --- a/lib/rust/parser/src/syntax/tree.rs +++ b/lib/rust/parser/src/syntax/tree.rs @@ -120,7 +120,7 @@ macro_rules! with_ast_definition { ($f:ident ($($args:tt)*)) => { $f! { $($args) pub token: token::Wildcard<'s>, #[serde(serialize_with = "crate::serialization::serialize_optional_int")] #[serde(deserialize_with = "crate::serialization::deserialize_optional_int")] - #[reflect(as = "i32")] + #[reflect(as = i32)] pub de_bruijn_index: Option, }, /// The suspended-default-arguments marker, `...`. diff --git a/lib/rust/parser/src/syntax/tree/visitor/Cargo.toml b/lib/rust/parser/src/syntax/tree/visitor/Cargo.toml index 96818a71a3f..d1c866fe997 100644 --- a/lib/rust/parser/src/syntax/tree/visitor/Cargo.toml +++ b/lib/rust/parser/src/syntax/tree/visitor/Cargo.toml @@ -16,10 +16,8 @@ proc-macro = true proc-macro2 = { workspace = true } enso-macro-utils = { path = "../../../../../macro-utils" } quote = { workspace = true } +syn = { workspace = true } -[dependencies.syn] -version = "1.0" -features = ['extra-traits', 'visit', 'full'] [lints] workspace = true diff --git a/lib/rust/prelude/Cargo.toml b/lib/rust/prelude/Cargo.toml index 6c9ec7b51fe..5af75038792 100644 --- a/lib/rust/prelude/Cargo.toml +++ b/lib/rust/prelude/Cargo.toml @@ -19,7 +19,7 @@ crate-type = ["rlib"] enso-reflect = { path = "../reflect" } enso-zst = { path = "../zst" } boolinator = { workspace = true } -derivative = { workspace = true } +derive-where = { workspace = true } derive_more = { workspace = true } serde = { workspace = true } enso-macros = { path = "macros" } diff --git a/lib/rust/prelude/macros/Cargo.toml b/lib/rust/prelude/macros/Cargo.toml index fff8cd02710..09c4b838846 100644 --- a/lib/rust/prelude/macros/Cargo.toml +++ b/lib/rust/prelude/macros/Cargo.toml @@ -18,11 +18,8 @@ default = [] enso-macro-utils = { path = "../../macro-utils" } proc-macro2 = { workspace = true } quote = { workspace = true } -Inflector = "0.11.4" - -[dependencies.syn] -version = "1.0" -features = ['extra-traits', 'visit', 'full'] +syn = { workspace = true } +convert_case = { workspace = true } [lints] workspace = true diff --git a/lib/rust/prelude/macros/src/tagged_enum.rs b/lib/rust/prelude/macros/src/tagged_enum.rs index 14d86b25f6c..f70797f8c51 100644 --- a/lib/rust/prelude/macros/src/tagged_enum.rs +++ b/lib/rust/prelude/macros/src/tagged_enum.rs @@ -1,4 +1,5 @@ -use inflector::cases::snakecase::to_snake_case; +use convert_case::Case; +use convert_case::Casing; use quote::quote; use syn::AttrStyle; use syn::Attribute; @@ -65,7 +66,7 @@ pub fn run( split_attr_sections(std::mem::take(&mut decl.attrs)); let (impl_generics, ty_generics, inherent_where_clause_opt) = &decl.generics.split_for_impl(); let mut where_clause = enso_macro_utils::new_where_clause(vec![]); - for inherent_where_clause in inherent_where_clause_opt { + if let Some(inherent_where_clause) = inherent_where_clause_opt { where_clause.predicates.extend(inherent_where_clause.predicates.iter().cloned()) } @@ -224,7 +225,7 @@ pub fn run( // Self::App(Box::new(App{func, args})) // } // } - let variant_snake_name = to_snake_case(&variant_name.to_string()); + let variant_snake_name = variant_name.to_string().to_case(Case::Snake); let variant_snake_ident = quote::format_ident!("{}", variant_snake_name); let (names, types) = match &variant.fields { Fields::Unit => (vec![], vec![]), @@ -360,18 +361,16 @@ enum ApplyAttributesTo { } fn parse_attr(attr: &Attribute) -> Option { - if attr.style != AttrStyle::Outer { - return None; - } - if attr.path.get_ident()? != HELPER_ATTRIBUTE_PATH { + if attr.style != AttrStyle::Outer || !attr.path().is_ident(HELPER_ATTRIBUTE_PATH) { return None; } + let name_value = "Parsing name-value argument"; - let syn::MetaNameValue { lit, path, .. } = attr.parse_args().expect(name_value); + let syn::MetaNameValue { path, value, .. } = attr.parse_args().expect(name_value); match path.get_ident().expect("Unsupported helper-attribute name").to_string().as_str() { "apply_attributes_to" => Some(Attr::ApplyAttributesTo({ - let value = match lit { - syn::Lit::Str(lit_str) => lit_str.value(), + let value = match value { + syn::Expr::Lit(syn::ExprLit { lit: syn::Lit::Str(lit_str), .. }) => lit_str.value(), _ => panic!("Expected a LitStr in argument to helper-attribute."), }; match value.as_str() { diff --git a/lib/rust/prelude/src/lib.rs b/lib/rust/prelude/src/lib.rs index ded1cc9a335..026267298e7 100644 --- a/lib/rust/prelude/src/lib.rs +++ b/lib/rust/prelude/src/lib.rs @@ -17,8 +17,8 @@ pub use std_reexports::*; pub use vec::*; pub use boolinator::Boolinator; -pub use derivative::Derivative; pub use derive_more::*; +pub use derive_where::derive_where; pub use enso_reflect::prelude::*; pub use serde::Deserialize; pub use serde::Serialize; diff --git a/lib/rust/prelude/src/vec.rs b/lib/rust/prelude/src/vec.rs index 23af50ed3a9..481cc963759 100644 --- a/lib/rust/prelude/src/vec.rs +++ b/lib/rust/prelude/src/vec.rs @@ -9,43 +9,6 @@ use serde::Serializer; -// ============== -// === VecOps === -// ============== - -pub trait VecOps: AsMut> + Sized { - /// Pop and return the last element, if the vector is non-empty and the given predicate returns - /// true when applied to the last element. - fn pop_if(&mut self, f: F) -> Option - where F: FnOnce(&T) -> bool { - let vec = self.as_mut(); - if let Some(last) = vec.last() { - if f(last) { - return vec.pop(); - } - } - None - } - - /// Pop and return the last element, if the vector is non-empty and the given predicate returns - /// true when applied to the last element. The predicate may mutate the element, whether or not - /// it is popped. - fn pop_if_mut(&mut self, f: F) -> Option - where F: FnOnce(&mut T) -> bool { - let vec = self.as_mut(); - if let Some(last) = vec.last_mut() { - if f(last) { - return vec.pop(); - } - } - None - } -} - -impl VecOps for Vec {} - - - // ===================== // === VecAllocation === // ===================== @@ -137,7 +100,7 @@ impl VecAllocation { #[reflect(transparent)] pub struct ColdVec { #[allow(clippy::box_collection)] - #[reflect(as = "Vec")] + #[reflect(as = Vec)] elements: Option>>, } diff --git a/lib/rust/reflect/Cargo.toml b/lib/rust/reflect/Cargo.toml index b1b026d4dd3..8b7c697e010 100644 --- a/lib/rust/reflect/Cargo.toml +++ b/lib/rust/reflect/Cargo.toml @@ -9,7 +9,7 @@ enso-reflect-macros = { path = "macros" } enso-metamodel = { path = "../metamodel", features = ["rust"] } [features] -default = ["graphviz"] +default = [] graphviz = ["enso-metamodel/graphviz"] [lints] diff --git a/lib/rust/reflect/macros/Cargo.toml b/lib/rust/reflect/macros/Cargo.toml index 7fdba0c997c..a66ccba58b1 100644 --- a/lib/rust/reflect/macros/Cargo.toml +++ b/lib/rust/reflect/macros/Cargo.toml @@ -10,7 +10,7 @@ proc-macro = true [dependencies] proc-macro2 = { workspace = true } quote = { workspace = true } -syn_1 = { workspace = true } +syn = { workspace = true } [lints] workspace = true diff --git a/lib/rust/reflect/macros/src/analyze.rs b/lib/rust/reflect/macros/src/analyze.rs index d6d0d90907d..9122bbd0d8c 100644 --- a/lib/rust/reflect/macros/src/analyze.rs +++ b/lib/rust/reflect/macros/src/analyze.rs @@ -131,48 +131,33 @@ enum FieldAttr { } fn parse_field_attrs(attr: &syn::Attribute, out: &mut Vec) { - if attr.style != syn::AttrStyle::Outer { + if attr.style != syn::AttrStyle::Outer || !attr.path().is_ident(HELPER_ATTRIBUTE_PATH) { return; } - match attr.path.get_ident() { - Some(ident) if ident == HELPER_ATTRIBUTE_PATH => (), - _ => return, - } - let meta = attr.parse_meta().expect(INVALID_HELPER_SYNTAX); - match meta { - syn::Meta::List(metalist) => - out.extend(metalist.nested.iter().map(|meta| parse_field_annotation(meta, attr))), + match &attr.meta { + syn::Meta::List(metalist) => { + metalist.parse_nested_meta(|meta| { + out.push(parse_field_annotation(&meta)?); + Ok(()) + }) + } + .expect(INVALID_HELPER_SYNTAX), syn::Meta::Path(_) | syn::Meta::NameValue(_) => - panic!("{}: {}.", INVALID_HELPER_SYNTAX, meta.to_token_stream()), + panic!("{}: {}.", INVALID_HELPER_SYNTAX, attr.meta.to_token_stream()), } } -fn parse_field_annotation(meta: &syn::NestedMeta, attr: &syn::Attribute) -> FieldAttr { - let meta = match meta { - syn::NestedMeta::Meta(meta) => meta, - _ => panic!("{}: {}.", INVALID_HELPER_SYNTAX, meta.into_token_stream()), - }; - match meta { - syn::Meta::Path(path) => { - let ident = path.get_ident().expect(INVALID_HELPER_SYNTAX); - match ident.to_string().as_str() { - "flatten" => FieldAttr::Flatten, - "hide" => FieldAttr::Hide, - "skip" => FieldAttr::Skip, - "subtype" => FieldAttr::Subtype, - _ => panic!("{}: {}.", UNKNOWN_HELPER, ident.into_token_stream()), - } - } - syn::Meta::NameValue(syn::MetaNameValue { path, lit: syn::Lit::Str(lit), .. }) => { - let ident = path.get_ident().expect(INVALID_HELPER_SYNTAX); - match ident.to_string().as_str() { - "as" => FieldAttr::As(Box::new(lit.parse().expect(INVALID_HELPER_SYNTAX))), - "rename" => FieldAttr::Rename(lit.clone()), - _ => panic!("{}: {}.", UNKNOWN_HELPER, ident.into_token_stream()), - } - } - _ => panic!("{}: {}.", INVALID_HELPER_SYNTAX, attr.into_token_stream()), - } +fn parse_field_annotation(meta: &syn::meta::ParseNestedMeta) -> syn::Result { + let ident = meta.path.get_ident().expect(INVALID_HELPER_SYNTAX); + Ok(match ident.to_string().as_str() { + "flatten" => FieldAttr::Flatten, + "hide" => FieldAttr::Hide, + "skip" => FieldAttr::Skip, + "subtype" => FieldAttr::Subtype, + "as" => FieldAttr::As(Box::new(meta.value()?.parse()?)), + "rename" => FieldAttr::Rename(meta.value()?.parse()?), + _ => panic!("{}: {}.", UNKNOWN_HELPER, meta.path.clone().into_token_stream()), + }) } @@ -184,24 +169,24 @@ enum VariantAttr { } fn parse_variant_attrs(attr: &syn::Attribute, out: &mut Vec) { - if attr.style != syn::AttrStyle::Outer { + if attr.style != syn::AttrStyle::Outer || !attr.path().is_ident(HELPER_ATTRIBUTE_PATH) { return; } - match attr.path.get_ident() { - Some(ident) if ident == HELPER_ATTRIBUTE_PATH => (), - _ => return, - } - let meta = attr.parse_meta().expect(INVALID_HELPER_SYNTAX); - match meta { + match &attr.meta { syn::Meta::List(metalist) => { - let parse = |meta| match parse_meta_ident(meta).to_string().as_str() { - "inline" => VariantAttr::Inline, - _ => panic!("{}: {}.", UNKNOWN_HELPER, meta.into_token_stream()), - }; - out.extend(metalist.nested.iter().map(parse)); + metalist + .parse_nested_meta(|meta| { + if meta.path.is_ident("inline") { + out.push(VariantAttr::Inline); + Ok(()) + } else { + panic!("{}: {}.", UNKNOWN_HELPER, attr.meta.clone().into_token_stream()); + } + }) + .expect(INVALID_HELPER_SYNTAX); } syn::Meta::Path(_) | syn::Meta::NameValue(_) => - panic!("{}: {}.", INVALID_HELPER_SYNTAX, meta.into_token_stream()), + panic!("{}: {}.", INVALID_HELPER_SYNTAX, attr.meta.clone().into_token_stream()), } } @@ -217,18 +202,21 @@ fn parse_container_attrs(attr: &syn::Attribute, out: &mut Vec) { if attr.style != syn::AttrStyle::Outer { return; } - match attr.path.get_ident() { - Some(ident) if ident == HELPER_ATTRIBUTE_PATH => (), - _ => return, + if !attr.path().is_ident(HELPER_ATTRIBUTE_PATH) { + return; } - let meta = attr.parse_meta().expect(INVALID_HELPER_SYNTAX); - match meta { + match &attr.meta { syn::Meta::List(metalist) => { - let parse = |meta| match parse_meta_ident(meta).to_string().as_str() { - "transparent" => ContainerAttr::Transparent, - _ => panic!("{}: {}.", UNKNOWN_HELPER, attr.into_token_stream()), - }; - out.extend(metalist.nested.iter().map(parse)); + metalist + .parse_nested_meta(|meta| { + if meta.path.is_ident("transparent") { + out.push(ContainerAttr::Transparent); + Ok(()) + } else { + panic!("{}: {}.", UNKNOWN_HELPER, attr.into_token_stream()); + } + }) + .expect(INVALID_HELPER_SYNTAX); } syn::Meta::Path(_) | syn::Meta::NameValue(_) => panic!("{}: {}.", INVALID_HELPER_SYNTAX, attr.into_token_stream()), @@ -252,17 +240,6 @@ impl<'a> FromIterator<&'a syn::Attribute> for ContainerAttrs { } -// === Helpers === - -fn parse_meta_ident(meta: &syn::NestedMeta) -> &syn::Ident { - let path = match meta { - syn::NestedMeta::Meta(syn::Meta::Path(path)) => path, - _ => panic!("{}: {}.", INVALID_HELPER_SYNTAX, meta.into_token_stream()), - }; - path.get_ident().expect(INVALID_HELPER_SYNTAX) -} - - // ============= // === Tests === diff --git a/lib/rust/reflect/macros/src/lib.rs b/lib/rust/reflect/macros/src/lib.rs index 5f9db5535d9..1a2942990c5 100644 --- a/lib/rust/reflect/macros/src/lib.rs +++ b/lib/rust/reflect/macros/src/lib.rs @@ -9,7 +9,7 @@ //! The field will be excluded from reflection data. //! When this attribute is present, the field's type does not need to implement `Reflect`. //! -//! ### `#[reflect(as = "OtherType")]` (field attribute) +//! ### `#[reflect(as = OtherType)]` (field attribute) //! The field's type in the reflection data will be `OtherType` rather than the field's real type. //! When this attribute is present, the field's real type does not need to implement `Reflect`. The //! alternative type specified must implement `Reflect`. @@ -117,7 +117,6 @@ use quote::quote; use quote::ToTokens; use syn::punctuated::Punctuated; use syn::Token; -use syn_1 as syn; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 56e207e9c59..a4504f6efdc 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2024-03-18" +channel = "nightly-2024-08-08" components = ["clippy", "rustfmt"] profile = "default" targets = ["wasm32-unknown-unknown"] diff --git a/rustfmt.toml b/rustfmt.toml index 015ad28039c..c147686b338 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -56,7 +56,7 @@ color = "Auto" unstable_features = false disable_all_formatting = false skip_children = false -hide_parse_errors = false +show_parse_errors = true error_on_line_overflow = false error_on_unformatted = false ignore = []