diff --git a/Cargo.lock b/Cargo.lock index 768cadc44..19f7f4074 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -155,6 +155,26 @@ version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +[[package]] +name = "archspec" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9db67cd9cf4f56a10d2cbae6a3b552e5bd36701fd37b74a18c14a231bdf446c7" +dependencies = [ + "cfg-if", + "itertools", + "libc", + "serde", + "serde_json", + "sysctl", +] + +[[package]] +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + [[package]] name = "arrayvec" version = "0.7.4" @@ -197,8 +217,8 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "zstd 0.13.0", - "zstd-safe 7.0.0", + "zstd 0.13.1", + "zstd-safe 7.1.0", ] [[package]] @@ -639,9 +659,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.35" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" dependencies = [ "android-tzdata", "iana-time-zone", @@ -700,9 +720,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.3" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949626d00e063efc93b6dca932419ceb5432f99769911c0b995f7e884c778813" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -741,9 +761,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.3" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90239a040c80f5e14809ca132ddc4176ab33d5e17e49691793296e3fcb34d72f" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -1053,12 +1073,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" -[[package]] -name = "drop_bomb" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bda8e21c04aca2ae33ffc2fd8c23134f3cac46db123ba97bd9d3f3b8a4a85e1" - [[package]] name = "duct" version = "0.13.7" @@ -1107,6 +1121,18 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-as-inner" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.53", +] + [[package]] name = "enum_dispatch" version = "0.3.12" @@ -1532,7 +1558,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.5", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -1565,6 +1591,15 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.3", +] + [[package]] name = "heck" version = "0.4.1" @@ -1844,9 +1879,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.5" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -1884,16 +1919,15 @@ dependencies = [ [[package]] name = "insta" -version = "1.36.1" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7c22c4d34ef4788c351e971c52bfdfe7ea2766f8c5466bc175dd46e52ac22e" +checksum = "3eab73f58e59ca6526037208f0e98851159ec1633cf17b6cd2e1f2c3fd5d53cc" dependencies = [ "console", "lazy_static", "linked-hash-map", "serde", "similar", - "yaml-rust", ] [[package]] @@ -2124,13 +2158,13 @@ dependencies = [ [[package]] name = "marked-yaml" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "748d469047f82705625fabc3dd8f3122c627f15f68c4215b7f07586f37a0ef76" +checksum = "ee72bc8ad60a5eaa18a8d103afbf5f55699ddc0e661c1e6941dc374538472600" dependencies = [ "doc-comment", "linked-hash-map", - "yaml-rust", + "yaml-rust2", ] [[package]] @@ -2154,9 +2188,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memmap2" @@ -2723,7 +2757,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.5", + "indexmap 2.2.6", ] [[package]] @@ -2832,7 +2866,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" dependencies = [ "base64 0.21.7", - "indexmap 2.2.5", + "indexmap 2.2.6", "line-wrap", "quick-xml", "serde", @@ -2940,7 +2974,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95c3dd745f99aa3c554b7bb00859f7d18c2f1d6afd749ccc86d60b61e702abd9" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.6", "pep440_rs", "pep508_rs", "serde", @@ -3023,9 +3057,9 @@ dependencies = [ [[package]] name = "rattler" -version = "0.19.4" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6fbcaa02a723f289c6ca6a23b923dfc7172d5686428e519e5c5667d21b602b2" +checksum = "0cf17592e2097c40bb78458d5894cd0c4f4e54fa3c7e48a4ca2cdc09bf48d18f" dependencies = [ "anyhow", "async-compression", @@ -3034,12 +3068,11 @@ dependencies = [ "clap", "digest", "dirs", - "drop_bomb", "fs-err", "futures", "fxhash", "hex", - "indexmap 2.2.5", + "indexmap 2.2.6", "itertools", "memchr", "memmap2 0.9.4", @@ -3094,7 +3127,7 @@ dependencies = [ "goblin", "hex", "ignore", - "indexmap 2.2.5", + "indexmap 2.2.6", "indicatif", "insta", "itertools", @@ -3148,20 +3181,20 @@ dependencies = [ "which", "xz2", "zip", - "zstd 0.13.0", + "zstd 0.13.1", ] [[package]] name = "rattler_conda_types" -version = "0.20.2" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33f37815d9f04d8a286cfb4147cae9fcd1db9711f0d34bba7c610e1704da125f" +checksum = "f04312e29a2f1f7932b82f522ce01a7f6f095810775db681062f6d7c6ac2f7ea" dependencies = [ "chrono", "fxhash", "glob", "hex", - "indexmap 2.2.5", + "indexmap 2.2.6", "itertools", "lazy-regex", "nom", @@ -3214,9 +3247,9 @@ dependencies = [ [[package]] name = "rattler_index" -version = "0.19.3" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ea3639990d9dc6e1efdd926d4b9b1b2df681ec4dfa232e8c1e662ba8725a51" +checksum = "cdaae94a7791fa7b86ad48afa321012c0b63de787bdbf3b9855534a0add5fe33" dependencies = [ "fs-err", "rattler_conda_types", @@ -3255,7 +3288,7 @@ dependencies = [ "http", "http-cache-semantics", "include_dir", - "indexmap 2.2.5", + "indexmap 2.2.6", "itertools", "miette 7.2.0", "mime", @@ -3299,9 +3332,9 @@ dependencies = [ [[package]] name = "rattler_networking" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92f944900e1008d0760ccbd8a4989e32207728826fc1e2f7c2f639f917739bce" +checksum = "5d0b9354421a0725078dfd1ba787269578a7c1121fe9a859818f8eb57fecb0b6" dependencies = [ "anyhow", "async-trait", @@ -3330,9 +3363,9 @@ dependencies = [ [[package]] name = "rattler_package_streaming" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78d226a0aa9317c35d244fc991e77552331007801a6b1a6d63a22325f870c709" +checksum = "51ab40c7851026ce066437a7aa8f41bd855631de1df7119cd6c4592f5e7c8761" dependencies = [ "bzip2", "chrono", @@ -3352,14 +3385,14 @@ dependencies = [ "tokio-util", "url", "zip", - "zstd 0.13.0", + "zstd 0.13.1", ] [[package]] name = "rattler_repodata_gateway" -version = "0.19.3" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b89b63a9fa257cefed44e3de10e95987bf29bfaeb376abd0b40ee33ff0d4a391" +checksum = "d5a431bebc785418239234de099d93c762f36ee9eccc25fb771e66f7e67dc478" dependencies = [ "anyhow", "async-compression", @@ -3397,12 +3430,12 @@ dependencies = [ [[package]] name = "rattler_shell" -version = "0.19.3" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7c92c8397fe02a27cb7cbbbc39a95246e2dd479e13455f0e402e290a475792" +checksum = "eb0bc411deca7d7592d234fb3af4143e43a4a82778543815cc553d79ec7c920f" dependencies = [ "enum_dispatch", - "indexmap 2.2.5", + "indexmap 2.2.6", "itertools", "rattler_conda_types", "serde_json", @@ -3415,9 +3448,9 @@ dependencies = [ [[package]] name = "rattler_solve" -version = "0.20.2" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eecfc2cc975fd3eb54753e3e894ee69a92d1cdb8ef73e99a4526704e72aa368" +checksum = "3afcaf726654799c7ebe4c8ecc25418a6cdc1717ada8d04df0c4f560e8eb7bfa" dependencies = [ "anyhow", "chrono", @@ -3436,10 +3469,11 @@ dependencies = [ [[package]] name = "rattler_virtual_packages" -version = "0.19.3" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b916c2861f98dc500d1c0120e6db60560f4b5a8a5afe1b972d613b6ca24e103a" +checksum = "ec1b00f4888441c1a11df94bc07be619124fdf75d0d1a5072d3b28df3ae08ba1" dependencies = [ + "archspec", "cfg-if", "libloading", "nom", @@ -3926,11 +3960,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -3978,7 +4012,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.5", + "indexmap 2.2.6", "serde", "serde_derive", "serde_json", @@ -4000,11 +4034,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.33" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0623d197252096520c6f2a5e1171ee436e5af99a5d7caa2891e55e61950e6d9" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -4340,6 +4374,20 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sysctl" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7dddc5f0fee506baf8b9fdb989e242f17e4b11c61dfbb0635b705217199eea" +dependencies = [ + "bitflags 2.5.0", + "byteorder", + "enum-as-inner", + "libc", + "thiserror", + "walkdir", +] + [[package]] name = "sysinfo" version = "0.30.7" @@ -4467,9 +4515,9 @@ dependencies = [ [[package]] name = "throbber-widgets-tui" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a99cd25e625314594c7eef24bfad0e7948cb37f697ca54c6a97f7987c92d4a49" +checksum = "431b847a60fc7b1df94a5b1bcb3cdd7027bb0013b431b08038505e8891c577a2" dependencies = [ "rand", "ratatui", @@ -4529,9 +4577,9 @@ checksum = "b130bd8a58c163224b44e217b4239ca7b927d82bf6cc2fea1fc561d15056e3f7" [[package]] name = "tokio" -version = "1.36.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -4630,7 +4678,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.6", "toml_datetime", "winnow 0.5.40", ] @@ -4641,7 +4689,7 @@ version = "0.22.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c12219811e0c1ba077867254e5ad62ee2c9c190b0d957110750ac0cda1ae96cd" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -5079,15 +5127,14 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "which" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa5e0c10bf77f44aac573e498d1a82d5fbd5e91f6fc0a99e7be4b38e85e101c" +checksum = "8211e4f58a2b2805adfbefbc07bab82958fc91e3836339b1ab7ae32465dce0d7" dependencies = [ "either", "home", - "once_cell", "rustix 0.38.32", - "windows-sys 0.52.0", + "winsafe", ] [[package]] @@ -5329,6 +5376,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winsafe" +version = "0.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" + [[package]] name = "wyz" version = "0.5.1" @@ -5375,12 +5428,14 @@ dependencies = [ ] [[package]] -name = "yaml-rust" -version = "0.4.5" +name = "yaml-rust2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +checksum = "498f4d102a79ea1c9d4dd27573c0fc96ad74c023e8da38484e47883076da25fb" dependencies = [ - "linked-hash-map", + "arraydeque", + "encoding_rs", + "hashlink", ] [[package]] @@ -5506,11 +5561,11 @@ dependencies = [ [[package]] name = "zstd" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" dependencies = [ - "zstd-safe 7.0.0", + "zstd-safe 7.1.0", ] [[package]] @@ -5525,18 +5580,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index e6a63cbf1..e42e1563c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,39 +20,39 @@ tui = ['ratatui', 'crossterm', 'ansi-to-tui', 'throbber-widgets-tui', 'tui-input [dependencies] serde = { version = "1.0.197", features = ["derive"] } -serde_yaml = "0.9.33" -rattler = { version = "0.19.4", default-features = false, features = ["cli-tools"] } -rattler_conda_types = { version = "0.20.2", default-features = false } +serde_yaml = "0.9.34" +rattler = { version = "0.20.1", default-features = false, features = ["cli-tools"] } +rattler_conda_types = { version = "0.20.4", default-features = false } rattler_digest = { version = "0.19.2", default-features = false } -rattler_index = { version = "0.19.3", default-features = false } -rattler_networking = { version = "0.19.2", default-features = false } -rattler_repodata_gateway = { version = "0.19.3", default-features = false, features = [ +rattler_index = { version = "0.19.5", default-features = false } +rattler_networking = { version = "0.20.0", default-features = false } +rattler_repodata_gateway = { version = "0.19.5", default-features = false, features = [ "sparse", ] } -rattler_shell = { version = "0.19.3", default-features = false, features = [ +rattler_shell = { version = "0.19.5", default-features = false, features = [ "sysinfo", ] } -rattler_solve = { version = "0.20.2", default-features = false, features = [ +rattler_solve = { version = "0.20.4", default-features = false, features = [ "resolvo", ] } -rattler_virtual_packages = { version = "0.19.3", default-features = false } -rattler_package_streaming = { version = "0.20.0", default-features = false } +rattler_virtual_packages = { version = "0.19.5", default-features = false } +rattler_package_streaming = { version = "0.20.2", default-features = false } anyhow = "1.0.81" walkdir = "2.5.0" sha2 = "0.10.8" hex = "0.4.3" -serde_json = "1.0.114" +serde_json = "1.0.115" reqwest = { version = "0.11.27", default-features = false, features = [ "multipart", ] } -tokio = { version = "1.36.0", features = ["rt", "macros", "rt-multi-thread"] } +tokio = { version = "1.37.0", features = ["rt", "macros", "rt-multi-thread"] } itertools = "0.12.1" content_inspector = "0.2.4" serde_with = "3.7.0" url = "2.5.0" tracing = "0.1.40" -clap = { version = "4.5.3", features = ["derive", "env", "cargo"] } -minijinja = { version = "1.0.14", features = [ +clap = { version = "4.5.4", features = ["derive", "env", "cargo"] } +minijinja = { version = "=1.0.14", features = [ "unstable_machinery", "custom_syntax", ] } @@ -62,7 +62,7 @@ tracing-subscriber = { version = "0.3.18", features = [ "ansi", "json" ] } -marked-yaml = { version = "0.3.0" } +marked-yaml = { version = "0.4.0" } miette = { version = "7.2.0", features = ["fancy"] } num_cpus = "1.16.0" goblin = "0.8.0" @@ -74,7 +74,7 @@ indicatif = "0.17.8" console = { version = "0.15.8", features = ["windows-console-colors"] } thiserror = "1.0.58" tempfile = "3.10.1" -chrono = "0.4.35" +chrono = "0.4.37" sha1 = "0.10.6" spdx = "0.10.4" fs_extra = "1.3.0" @@ -83,10 +83,10 @@ globset = "0.4.14" clap-verbosity-flag = "2.2.0" tracing-core = "0.1.32" petgraph = "0.6.4" -indexmap = "2.2.5" +indexmap = "2.2.6" dunce = "1.0.4" fs-err = "2.11.0" -which = "6.0.0" +which = "6.0.1" clap_complete = "4.5.1" tokio-util = "0.7.10" @@ -99,22 +99,22 @@ bzip2 = "0.4.4" base64 = "0.22.0" flate2 = "1.0.28" xz2 = "0.1.7" -zstd = "0.13.0" +zstd = "0.13.1" toml = "0.8.12" memmap2 = "0.9.4" reqwest-middleware = "0.2.5" rattler_installs_packages = { version = "0.8.1", default-features = false } async-once-cell = "0.5.3" terminal_size = "0.3.0" -memchr = "2.7.1" +memchr = "2.7.2" ratatui = { version = "0.26.1", optional = true } crossterm = { version = "0.27.0", features = ["event-stream"], optional = true } ansi-to-tui = { version = "4.0.1", optional = true } -throbber-widgets-tui = { version = "0.4.1", optional = true } +throbber-widgets-tui = { version = "0.5.0", optional = true } tui-input = { version = "0.8.0", optional = true } [dev-dependencies] -insta = { version = "1.36.1", features = ["yaml"] } +insta = { version = "1.38.0", features = ["yaml"] } rstest = "0.18.2" tracing-test = "0.2.4" tracing-indicatif = "0.3.6" diff --git a/rust-tests/Cargo.toml b/rust-tests/Cargo.toml index 9bb69b942..0e5fbbcbc 100644 --- a/rust-tests/Cargo.toml +++ b/rust-tests/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] glob = "0.3.1" -rattler_package_streaming = { version = "0.20.0", default-features = false } -serde_json = "1.0.114" +rattler_package_streaming = { version = "0.20.2", default-features = false } +serde_json = "1.0.115" sha1 = "0.10.6" duct = "0.13.7" diff --git a/src/lib.rs b/src/lib.rs index 3691a66dc..bb88ab587 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -113,10 +113,11 @@ pub fn get_recipe_path(path: &Path) -> miette::Result { pub fn get_tool_config( args: &BuildOpts, fancy_log_handler: &LoggingOutputHandler, -) -> Configuration { +) -> miette::Result { let client = - tool_configuration::reqwest_client_from_auth_storage(args.common.auth_file.clone()); - Configuration { + tool_configuration::reqwest_client_from_auth_storage(args.common.auth_file.clone()) + .into_diagnostic()?; + Ok(Configuration { client, fancy_log_handler: fancy_log_handler.clone(), no_clean: args.keep_build, @@ -125,7 +126,7 @@ pub fn get_tool_config( use_bz2: args.common.use_bz2, render_only: args.render_only, skip_existing: args.skip_existing, - } + }) } /// Returns the output for the build. @@ -346,7 +347,8 @@ pub async fn run_test_from_args( fancy_log_handler: LoggingOutputHandler, ) -> miette::Result<()> { let package_file = canonicalize(args.package_file).into_diagnostic()?; - let client = tool_configuration::reqwest_client_from_auth_storage(args.common.auth_file); + let client = tool_configuration::reqwest_client_from_auth_storage(args.common.auth_file) + .into_diagnostic()?; let tempdir = tempfile::tempdir().into_diagnostic()?; @@ -415,7 +417,8 @@ pub async fn rebuild_from_args( output.build_configuration.directories.output_dir = canonicalize(output_dir).into_diagnostic()?; - let client = tool_configuration::reqwest_client_from_auth_storage(args.common.auth_file); + let client = tool_configuration::reqwest_client_from_auth_storage(args.common.auth_file) + .into_diagnostic()?; let tool_config = tool_configuration::Configuration { client, @@ -454,7 +457,7 @@ pub async fn upload_from_args(args: UploadOpts) -> miette::Result<()> { } } - let store = tool_configuration::get_auth_store(args.common.auth_file); + let store = tool_configuration::get_auth_store(args.common.auth_file).into_diagnostic()?; match args.server_type { ServerType::Quetz(quetz_opts) => { diff --git a/src/main.rs b/src/main.rs index fb7716d20..dac8b0bbc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -103,7 +103,7 @@ async fn main() -> miette::Result<()> { } } else { let log_handler = log_handler.expect("logger is not initialized"); - let tool_config = get_tool_config(&build_args, &log_handler); + let tool_config = get_tool_config(&build_args, &log_handler)?; let mut outputs = Vec::new(); for recipe_path in &recipe_paths { let output = get_build_output(&build_args, recipe_path, &tool_config).await?; diff --git a/src/tool_configuration.rs b/src/tool_configuration.rs index 1756c8b87..7f2ac946b 100644 --- a/src/tool_configuration.rs +++ b/src/tool_configuration.rs @@ -4,7 +4,10 @@ use std::{path::PathBuf, sync::Arc}; use crate::console_utils::LoggingOutputHandler; -use rattler_networking::{authentication_storage, AuthenticationMiddleware, AuthenticationStorage}; +use rattler_networking::{ + authentication_storage::{self, backends::file::FileStorageError}, + AuthenticationMiddleware, AuthenticationStorage, +}; use reqwest_middleware::ClientWithMiddleware; /// The user agent to use for the reqwest client @@ -39,25 +42,29 @@ pub struct Configuration { } /// Get the authentication storage from the given file -pub fn get_auth_store(auth_file: Option) -> AuthenticationStorage { +pub fn get_auth_store( + auth_file: Option, +) -> Result { match auth_file { Some(auth_file) => { let mut store = AuthenticationStorage::new(); store.add_backend(Arc::from( - authentication_storage::backends::file::FileStorage::new(auth_file), + authentication_storage::backends::file::FileStorage::new(auth_file)?, )); - store + Ok(store) } - None => rattler_networking::AuthenticationStorage::default(), + None => Ok(rattler_networking::AuthenticationStorage::default()), } } /// Create a reqwest client with the authentication middleware -pub fn reqwest_client_from_auth_storage(auth_file: Option) -> ClientWithMiddleware { - let auth_storage = get_auth_store(auth_file); +pub fn reqwest_client_from_auth_storage( + auth_file: Option, +) -> Result { + let auth_storage = get_auth_store(auth_file)?; let timeout = 5 * 60; - reqwest_middleware::ClientBuilder::new( + Ok(reqwest_middleware::ClientBuilder::new( reqwest::Client::builder() .no_gzip() .pool_max_idle_per_host(20) @@ -67,14 +74,14 @@ pub fn reqwest_client_from_auth_storage(auth_file: Option) -> ClientWit .expect("failed to create client"), ) .with_arc(Arc::new(AuthenticationMiddleware::new(auth_storage))) - .build() + .build()) } impl Default for Configuration { fn default() -> Self { Self { fancy_log_handler: LoggingOutputHandler::default(), - client: reqwest_client_from_auth_storage(None), + client: reqwest_client_from_auth_storage(None).expect("failed to create client"), no_clean: false, no_test: false, use_zstd: true, diff --git a/src/tui/state.rs b/src/tui/state.rs index a8e60a879..c9b05f6cf 100644 --- a/src/tui/state.rs +++ b/src/tui/state.rs @@ -112,7 +112,8 @@ impl TuiState { pub fn new(build_opts: BuildOpts, log_handler: LoggingOutputHandler) -> Self { Self { build_opts: build_opts.clone(), - tool_config: get_tool_config(&build_opts, &log_handler), + tool_config: get_tool_config(&build_opts, &log_handler) + .expect("Could not get tool config"), running: true, packages: Vec::new(), selected_package: 0,