diff --git a/.cargo/config.toml b/.cargo/config.toml index 211d9982..317133ce 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,6 @@ +[env] +PYO3_CONFIG_FILE = { value = "crates/onetagger-python/pyembedded/pyo3-build-config-file.txt", relative = true } + # Mac OS libraries [target.x86_64-apple-darwin] rustflags = ["-lz", "-lbz2", "-llzma", "-C", "link-args=-framework AudioUnit"] diff --git a/.gitignore b/.gitignore index d55c29af..6bb64125 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ osxcross/ .vscode/ test/ vc_redist.x64.exe -assets/vc_redist.x64.exe \ No newline at end of file +assets/vc_redist.x64.exe +crates/onetagger-python/pyembedded \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 30bd6895..02663167 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,6 +23,17 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.3" @@ -32,7 +43,7 @@ dependencies = [ "cfg-if", "getrandom 0.2.10", "once_cell", - "version_check", + "version_check 0.9.4", ] [[package]] @@ -168,6 +179,179 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[package]] +name = "app-store-connect" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69029f2bda37a6df66f674f1ab160c92c8584d8a667d0d58028648be9fa47414" +dependencies = [ + "anyhow", + "base64 0.20.0", + "clap", + "dirs", + "env_logger", + "jsonwebtoken", + "log", + "pem", + "rand 0.8.5", + "reqwest", + "rsa", + "serde", + "serde_json", + "thiserror", + "x509-certificate", +] + +[[package]] +name = "apple-bundles" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "716b8a7bacf7325eb3e7a1a7f5ead4da91e1e16d9b56a25edea0e1e4ba21fd8e" +dependencies = [ + "anyhow", + "plist", + "simple-file-manifest", + "walkdir", +] + +[[package]] +name = "apple-codesign" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8ffefec1fc03e4cc46f49ead8f0dc04637e0142c1daa2f0c795f6b0a36234f5" +dependencies = [ + "anyhow", + "app-store-connect", + "apple-bundles", + "apple-flat-package", + "apple-xar", + "aws-config", + "aws-sdk-s3", + "aws-smithy-http", + "base64 0.20.0", + "bcder", + "bitflags 1.3.2", + "bytes", + "chrono", + "clap", + "cryptographic-message-syntax", + "der", + "dialoguer", + "difference", + "digest 0.10.7", + "dirs", + "elliptic-curve", + "env_logger", + "filetime", + "glob", + "goblin", + "hex", + "log", + "md-5", + "minicbor", + "oid-registry", + "once_cell", + "p12", + "p256", + "pem", + "pkcs1", + "pkcs8", + "plist", + "rand 0.8.5", + "rasn", + "rayon", + "regex", + "reqwest", + "ring", + "rsa", + "scroll", + "security-framework", + "semver 1.0.18", + "serde", + "serde_json", + "serde_yaml", + "sha2 0.10.7", + "signature", + "simple-file-manifest", + "spake2", + "spki", + "subtle", + "tempfile", + "thiserror", + "tokio", + "tungstenite 0.18.0", + "uuid", + "x509", + "x509-certificate", + "xml-rs", + "yasna", + "zeroize", + "zip", + "zip_structs", +] + +[[package]] +name = "apple-flat-package" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ddaabaf2f26a4c5371eef64d9c844796fde64d83d93ba2b745d33cb8b686e2e" +dependencies = [ + "apple-xar", + "cpio-archive", + "flate2", + "scroll", + "serde", + "serde-xml-rs", + "thiserror", +] + +[[package]] +name = "apple-sdk" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a04f192a700686ee70008ff4e4eb76fe7d11814ab93b7ee9d48c36b9a9f0bd2a" +dependencies = [ + "plist", + "serde", + "serde_json", +] + +[[package]] +name = "apple-xar" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b51e52d6b526cefb1586b6eff6e60f03d2e23369c808d284ca64f2c56402e351" +dependencies = [ + "base64 0.20.0", + "bcder", + "bzip2", + "chrono", + "cryptographic-message-syntax", + "digest 0.10.7", + "flate2", + "log", + "md-5", + "rand 0.8.5", + "reqwest", + "scroll", + "serde", + "serde-xml-rs", + "sha1 0.10.5", + "sha2 0.10.7", + "signature", + "thiserror", + "url", + "x509-certificate", + "xml-rs", + "xz2", +] + +[[package]] +name = "ar" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d67af77d68a931ecd5cbd8a3b5987d63a1d1d1278f7f6a60ae33db485cdebb69" + [[package]] name = "arbitrary-int" version = "1.2.6" @@ -180,6 +364,53 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom 7.1.3", + "num-traits", + "rusticata-macros", + "thiserror", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "async-broadcast" version = "0.5.1" @@ -342,120 +573,570 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" [[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "az" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" - -[[package]] -name = "backtrace" -version = "0.3.69" +name = "atty" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "addr2line", - "cc", - "cfg-if", + "hermit-abi 0.1.19", "libc", - "miniz_oxide", - "object", - "rustc-demangle", + "winapi", ] [[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - -[[package]] -name = "base64" -version = "0.13.1" +name = "autocfg" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] -name = "base64" -version = "0.20.0" +name = "aws-config" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" +checksum = "e7688e1dfbb9f7804fab0a830820d7e827b8d973906763cf1a855ce4719292f5" +dependencies = [ + "aws-http", + "aws-sdk-sso", + "aws-sdk-sts", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-json", + "aws-smithy-types", + "aws-types", + "bytes", + "hex", + "http", + "hyper", + "ring", + "time 0.3.28", + "tokio", + "tower", + "tracing", + "zeroize", +] [[package]] -name = "base64" -version = "0.21.3" +name = "aws-endpoint" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +checksum = "253d7cd480bfa59a5323390e9e91885a8f06a275e0517d81eeb1070b6aa7d271" +dependencies = [ + "aws-smithy-http", + "aws-smithy-types", + "aws-types", + "http", + "regex", + "tracing", +] [[package]] -name = "bindgen" -version = "0.64.0" +name = "aws-http" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" +checksum = "4cd1b83859383e46ea8fda633378f9f3f02e6e3a446fd89f0240b5c3662716c9" dependencies = [ - "bitflags 1.3.2", - "cexpr", - "clang-sys", + "aws-smithy-http", + "aws-smithy-types", + "aws-types", + "bytes", + "http", + "http-body", "lazy_static", - "lazycell", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 1.0.109", + "percent-encoding", + "pin-project-lite", + "tracing", ] [[package]] -name = "bit_field" -version = "0.10.2" +name = "aws-sdk-s3" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" +checksum = "c4d240ff751efc65099d18f6b0fb80360b31a298cec7b392c511692bec4a6e21" +dependencies = [ + "aws-endpoint", + "aws-http", + "aws-sig-auth", + "aws-sigv4", + "aws-smithy-async", + "aws-smithy-checksums", + "aws-smithy-client", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "bytes", + "bytes-utils", + "fastrand 1.9.0", + "http", + "http-body", + "tokio-stream", + "tower", + "tracing", +] [[package]] -name = "bitflags" -version = "1.3.2" +name = "aws-sdk-sso" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "bf03342c2b3f52b180f484e60586500765474f2bfc7dcd4ffe893a7a1929db1d" +dependencies = [ + "aws-endpoint", + "aws-http", + "aws-sig-auth", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-json", + "aws-smithy-types", + "aws-types", + "bytes", + "http", + "tokio-stream", + "tower", +] [[package]] -name = "bitflags" -version = "2.4.0" +name = "aws-sdk-sts" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "aa1de4e07ea87a30a317c7b563b3a40fd18a843ad794216dda81672b6e174bce" +dependencies = [ + "aws-endpoint", + "aws-http", + "aws-sig-auth", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-query", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "bytes", + "http", + "tower", + "tracing", +] [[package]] -name = "bitreader" -version = "0.3.7" +name = "aws-sig-auth" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f10043e4864d975e7f197f993ec4018636ad93946724b2571c4474d51845869b" +checksum = "6126c4ff918e35fb9ae1bf2de71157fad36f0cc6a2b1d0f7197ee711713700fc" dependencies = [ - "cfg-if", + "aws-sigv4", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-types", + "http", + "tracing", ] [[package]] -name = "block" -version = "0.1.6" +name = "aws-sigv4" +version = "0.52.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +checksum = "cd1ee2d9e6e268a77bdf3a0dc2cc8767401627e60abaa32883aaa3d8b47428e9" +dependencies = [ + "aws-smithy-eventstream", + "aws-smithy-http", + "bytes", + "form_urlencoded", + "hex", + "hmac", + "http", + "once_cell", + "percent-encoding", + "regex", + "sha2 0.10.7", + "time 0.3.28", + "tracing", +] [[package]] -name = "block-buffer" -version = "0.10.4" +name = "aws-smithy-async" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "3e6a895d68852dd1564328e63ef1583e5eb307dd2a5ebf35d862a5c402957d5e" dependencies = [ - "generic-array", + "futures-util", + "pin-project-lite", + "tokio", + "tokio-stream", ] [[package]] -name = "blocking" +name = "aws-smithy-checksums" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b847d960abc993319d77b52e82971e2bbdce94f6192df42142e14ed5c9c917" +dependencies = [ + "aws-smithy-http", + "aws-smithy-types", + "bytes", + "crc32c", + "crc32fast", + "hex", + "http", + "http-body", + "md-5", + "pin-project-lite", + "sha1 0.10.5", + "sha2 0.10.7", + "tracing", +] + +[[package]] +name = "aws-smithy-client" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f505bf793eb3e6d7c166ef1275c27b4b2cd5361173fe950ac8e2cfc08c29a7ef" +dependencies = [ + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-types", + "bytes", + "fastrand 1.9.0", + "http", + "http-body", + "hyper", + "hyper-rustls 0.23.2", + "lazy_static", + "pin-project-lite", + "tokio", + "tower", + "tracing", +] + +[[package]] +name = "aws-smithy-eventstream" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751c99da757aecc1408ab6b2d65e9493220a5e7a68bcafa4f07b6fd1bc473f1" +dependencies = [ + "aws-smithy-types", + "bytes", + "crc32fast", +] + +[[package]] +name = "aws-smithy-http" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37e4b4304b7ea4af1af3e08535100eb7b6459d5a6264b92078bf85176d04ab85" +dependencies = [ + "aws-smithy-eventstream", + "aws-smithy-types", + "bytes", + "bytes-utils", + "futures-core", + "http", + "http-body", + "hyper", + "once_cell", + "percent-encoding", + "pin-project-lite", + "pin-utils", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "aws-smithy-http-tower" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86072ecc4dc4faf3e2071144285cfd539263fe7102b701d54fb991eafb04af8" +dependencies = [ + "aws-smithy-http", + "aws-smithy-types", + "bytes", + "http", + "http-body", + "pin-project-lite", + "tower", + "tracing", +] + +[[package]] +name = "aws-smithy-json" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3ddd9275b167bc59e9446469eca56177ec0b51225632f90aaa2cd5f41c940e" +dependencies = [ + "aws-smithy-types", +] + +[[package]] +name = "aws-smithy-query" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b19d2e0b3ce20e460bad0d0d974238673100edebba6978c2c1aadd925602f7" +dependencies = [ + "aws-smithy-types", + "urlencoding", +] + +[[package]] +name = "aws-smithy-types" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "987b1e37febb9bd409ca0846e82d35299e572ad8279bc404778caeb5fc05ad56" +dependencies = [ + "base64-simd", + "itoa 1.0.9", + "num-integer", + "ryu", + "time 0.3.28", +] + +[[package]] +name = "aws-smithy-xml" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ce3791e14eec75ffac851a5a559f1ce6b31843297f42cc8bfba82714a6a5d8" +dependencies = [ + "xmlparser", +] + +[[package]] +name = "aws-types" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c05adca3e2bcf686dd2c47836f216ab52ed7845c177d180c84b08522c1166a3" +dependencies = [ + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-types", + "http", + "rustc_version 0.4.0", + "tracing", + "zeroize", +] + +[[package]] +name = "az" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" + +[[package]] +name = "base64" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" + +[[package]] +name = "base64-simd" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" +dependencies = [ + "simd-abstraction", +] + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bcder" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab26f019795af36086f2ca879aeeaae7566bdfd2fe0821a0328d3fdd9d1da2d9" +dependencies = [ + "bytes", + "smallvec", +] + +[[package]] +name = "bindgen" +version = "0.64.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 1.0.109", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + +[[package]] +name = "bitcode" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fab8eb922a99ab601facde7ae07200e811cdc2ae1df604ffd6c2b7c976dd3fff" +dependencies = [ + "bitcode_derive", + "bytemuck", + "from_bytes_or_zeroed", + "residua-zigzag", + "serde", +] + +[[package]] +name = "bitcode_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2ab471e684e2f6f3c3071361e2c30e41d7543f505658daae3ceb89c202d933e" +dependencies = [ + "packagemerge", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "bitfield" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + +[[package]] +name = "bitreader" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f10043e4864d975e7f197f993ec4018636ad93946724b2571c4474d51845869b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blocking" version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" @@ -469,6 +1150,16 @@ dependencies = [ "log", ] +[[package]] +name = "blowfish" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e412e2cd0f2b2d93e02543ceae7917b3c70331573df19ee046bcbc35e45e87d7" +dependencies = [ + "byteorder", + "cipher", +] + [[package]] name = "brotli" version = "3.3.4" @@ -535,6 +1226,43 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +[[package]] +name = "bytes-utils" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e47d3a8076e283f3acd27400535992edb3ba4b5bb72f8891ad8fbe7932a7d4b9" +dependencies = [ + "bytes", + "either", +] + +[[package]] +name = "bytesize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "cairo-rs" version = "0.16.7" @@ -560,6 +1288,78 @@ dependencies = [ "system-deps", ] +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-lock" +version = "8.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031718ddb8f78aa5def78a09e90defe30151d1f6c672f937af4dd916429ed996" +dependencies = [ + "semver 1.0.18", + "serde", + "toml 0.5.11", + "url", +] + +[[package]] +name = "cargo-platform" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.18", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cargo_toml" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bfbc36312494041e2cdd5f06697b7e89d4b76f42773a0b5556ac290ff22acc2" +dependencies = [ + "serde", + "toml 0.5.11", +] + +[[package]] +name = "cast5" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b07d673db1ccf000e90f54b819db9e75a8348d6eb056e9b8ab53231b7a9911" +dependencies = [ + "cipher", +] + +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] + [[package]] name = "cc" version = "1.0.83" @@ -582,7 +1382,16 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom", + "nom 7.1.3", +] + +[[package]] +name = "cfb-mode" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "738b8d467867f80a71351933f70461f5b56f24d5c93e0cf216e59229c968d330" +dependencies = [ + "cipher", ] [[package]] @@ -601,6 +1410,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "charset" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18e9079d1a12a2cc2bffb5db039c43661836ead4082120d5844f02555aca2d46" +dependencies = [ + "base64 0.13.1", + "encoding_rs", +] + [[package]] name = "chfft" version = "0.3.4" @@ -633,6 +1452,16 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cca491388666e04d7248af3f60f0c40cfb0991c72205595d7c396e3510207d1a" +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "clang-sys" version = "1.6.1" @@ -722,6 +1551,22 @@ dependencies = [ "objc", ] +[[package]] +name = "codemap" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e769b5c8c8283982a987c6e948e540254f1058d5a74b8794914d4ef5fc2a24" + +[[package]] +name = "codemap-diagnostic" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc20770be05b566a963bf91505e60412c4a2d016d1ef95c5512823bb085a8122" +dependencies = [ + "codemap", + "termcolor", +] + [[package]] name = "color_quant" version = "1.1.0" @@ -764,6 +1609,31 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "console" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.45.0", +] + +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "convert_case" version = "0.4.0" @@ -787,9 +1657,15 @@ checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" dependencies = [ "percent-encoding", "time 0.3.28", - "version_check", + "version_check 0.9.4", ] +[[package]] +name = "cookie-factory" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396de984970346b0d9e93d1415082923c679e5ae5c3ee3dcbd104f5610af126b" + [[package]] name = "cookie_store" version = "0.19.1" @@ -890,6 +1766,18 @@ dependencies = [ "windows 0.37.0", ] +[[package]] +name = "cpio-archive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfef44f9459c423c720aba9ec27e0dc88b9878c3749b726aa78e1f427e96c8fa" +dependencies = [ + "chrono", + "is_executable", + "simple-file-manifest", + "thiserror", +] + [[package]] name = "cpufeatures" version = "0.2.9" @@ -899,6 +1787,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc24" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd121741cf3eb82c08dd3023eb55bf2665e5f60ec20f89760cf836ae4562e6a0" + +[[package]] +name = "crc32c" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8f48d60e5b4d2c53d5c2b1d8a58c849a70ae5e5509b08a48d047e3b65714a74" +dependencies = [ + "rustc_version 0.4.0", +] + [[package]] name = "crc32fast" version = "1.3.2" @@ -988,6 +1891,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -998,6 +1913,23 @@ dependencies = [ "typenum", ] +[[package]] +name = "cryptographic-message-syntax" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2b86e4bad3ab0d837044f5e49fa4ec70d8e29e8bb2d822b8186cf1d71bce55" +dependencies = [ + "bcder", + "bytes", + "chrono", + "hex", + "pem", + "reqwest", + "ring", + "signature", + "x509-certificate", +] + [[package]] name = "css-minify" version = "0.3.1" @@ -1006,7 +1938,7 @@ checksum = "874c6e2d19f8d4a285083b11a3241bfbe01ac3ed85f26e1e6b34888d960552bd" dependencies = [ "derive_more", "indexmap 1.9.3", - "nom", + "nom 7.1.3", ] [[package]] @@ -1055,12 +1987,66 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + [[package]] name = "data-encoding" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +[[package]] +name = "debug-ignore" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe7ed1d93f4553003e20b629abe9085e1e81b1429520f897f8f8860bc6dfc21" + [[package]] name = "deflate" version = "1.0.0" @@ -1071,6 +2057,17 @@ dependencies = [ "gzip-header", ] +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "deranged" version = "0.3.8" @@ -1078,16 +2075,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] -name = "derivative" -version = "2.2.0" +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" dependencies = [ + "darling", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "derive_builder_macro" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1101,14 +2129,58 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "des" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdd80ce8ce993de27e9f063a444a4d53ce8e8db4c1f00cc03af5ad5a9867a1e" +dependencies = [ + "cipher", +] + +[[package]] +name = "dialoguer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +dependencies = [ + "console", + "shell-words", + "tempfile", + "zeroize", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + [[package]] name = "digest" version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer", + "block-buffer 0.10.4", + "const-oid", "crypto-common", + "subtle", ] [[package]] @@ -1117,7 +2189,16 @@ version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" dependencies = [ - "dirs-sys", + "dirs-sys 0.4.1", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys 0.3.7", ] [[package]] @@ -1130,6 +2211,17 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dirs-sys" version = "0.4.1" @@ -1165,6 +2257,23 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + [[package]] name = "dtoa" version = "1.0.9" @@ -1180,12 +2289,58 @@ dependencies = [ "dtoa", ] +[[package]] +name = "duct" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ae3fc31835f74c2a7ceda3aeede378b0ae2e74c8f1c36559fcc9ae2a4e7d3e" +dependencies = [ + "libc", + "once_cell", + "os_pipe", + "shared_child", +] + [[package]] name = "dunce" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der", + "elliptic-curve", + "signature", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + [[package]] name = "ego-tree" version = "0.6.2" @@ -1198,6 +2353,41 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "ena" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +dependencies = [ + "log", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "encoding_rs" version = "0.8.33" @@ -1240,6 +2430,19 @@ dependencies = [ "syn 2.0.29", ] +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -1378,6 +2581,16 @@ dependencies = [ "log", ] +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "field-offset" version = "0.3.6" @@ -1400,6 +2613,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "find-winsdk" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8cbf17b871570c1f8612b763bac3e86290602bcf5dc3c5ce657e0e1e9071d9e" +dependencies = [ + "serde", + "serde_derive", + "winreg 0.5.1", +] + [[package]] name = "fixed" version = "1.23.1" @@ -1412,6 +2636,12 @@ dependencies = [ "typenum", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" version = "1.0.27" @@ -1465,6 +2695,28 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "from_bytes_or_zeroed" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d25934a78435889223e575c7b0fc36a290c5a312e7a7ae901f10587792e142a" + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "futf" version = "0.1.5" @@ -1664,7 +2916,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", - "version_check", + "version_check 0.9.4", ] [[package]] @@ -1749,6 +3001,19 @@ dependencies = [ "winapi", ] +[[package]] +name = "git2" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2994bee4a3a6a51eb90c218523be382fd7ea09b16380b9312e9dbe955ff7c7d1" +dependencies = [ + "bitflags 1.3.2", + "libc", + "libgit2-sys", + "log", + "url", +] + [[package]] name = "glib" version = "0.16.9" @@ -1813,6 +3078,28 @@ dependencies = [ "system-deps", ] +[[package]] +name = "goblin" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6b4de4a8eb6c46a8c77e1d3be942cb9a8bf073c22374578e5ba4b08ed0ff68" +dependencies = [ + "log", + "plain", + "scroll", +] + +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "gtk" version = "0.16.2" @@ -1868,6 +3155,38 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "guppy" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f822a2716041492e071691606474f5a7e4fa7c2acbfd7da7b29884fb448291c7" +dependencies = [ + "camino", + "cargo_metadata", + "cfg-if", + "debug-ignore", + "fixedbitset", + "guppy-workspace-hack", + "indexmap 1.9.3", + "itertools 0.10.5", + "nested", + "once_cell", + "pathdiff", + "petgraph", + "semver 1.0.18", + "serde", + "serde_json", + "smallvec", + "static_assertions", + "target-spec", +] + +[[package]] +name = "guppy-workspace-hack" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92620684d99f750bae383ecb3be3748142d6095760afd5cbcf2261e9a279d780" + [[package]] name = "gzip-header" version = "1.0.0" @@ -1906,6 +3225,20 @@ dependencies = [ "crunchy", ] +[[package]] +name = "handlebars" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "hash32" version = "0.2.1" @@ -1946,6 +3279,15 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "hermit-abi" version = "0.3.2" @@ -1958,6 +3300,24 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "home" version = "0.5.5" @@ -2021,6 +3381,12 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "hyper" version = "0.14.27" @@ -2045,6 +3411,22 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +dependencies = [ + "http", + "hyper", + "log", + "rustls 0.20.9", + "rustls-native-certs", + "tokio", + "tokio-rustls 0.23.4", + "webpki-roots 0.22.6", +] + [[package]] name = "hyper-rustls" version = "0.24.1" @@ -2054,9 +3436,9 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls", + "rustls 0.21.7", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -2093,6 +3475,12 @@ dependencies = [ "flate2", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.3.0" @@ -2162,13 +3550,29 @@ dependencies = [ ] [[package]] -name = "indexmap" -version = "2.0.0" +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "indoc" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" + +[[package]] +name = "inout" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "equivalent", - "hashbrown 0.14.0", + "block-padding", + "generic-array", ] [[package]] @@ -2186,7 +3590,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.2", "libc", "windows-sys 0.48.0", ] @@ -2203,11 +3607,35 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.2", "rustix 0.38.10", "windows-sys 0.48.0", ] +[[package]] +name = "is_executable" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa9acdc6d67b75e626ad644734e8bc6df893d9cd2a834129065d3dd6158ea9c8" +dependencies = [ + "winapi", +] + +[[package]] +name = "itertools" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a9b56eb56058f43dc66e58f40a214b2ccbc9f3df51861b63d51dec7b65bc3f" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.8" @@ -2306,6 +3734,44 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonwebtoken" +version = "8.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" +dependencies = [ + "base64 0.21.3", + "pem", + "ring", + "serde", + "serde_json", + "simple_asn1", +] + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "konst" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330f0e13e6483b8c34885f7e6c9f19b1a7bd449c673fbb948a51c99d66ef74f4" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + [[package]] name = "kuchikiki" version = "0.8.2" @@ -2319,11 +3785,45 @@ dependencies = [ "selectors 0.22.0", ] +[[package]] +name = "lalrpop" +version = "0.19.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +dependencies = [ + "ascii-canvas", + "bit-set", + "diff", + "ena", + "is-terminal", + "itertools 0.10.5", + "lalrpop-util", + "petgraph", + "regex", + "regex-syntax 0.6.29", + "string_cache", + "term", + "tiny-keccak", + "unicode-xid", +] + +[[package]] +name = "lalrpop-util" +version = "0.19.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +dependencies = [ + "regex", +] + [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] [[package]] name = "lazycell" @@ -2354,6 +3854,18 @@ version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +[[package]] +name = "libgit2-sys" +version = "0.14.2+1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f3d95f6b51075fe9810a7ae22c7095f12b98005ab364d8544797a825ce946a4" +dependencies = [ + "cc", + "libc", + "libz-sys", + "pkg-config", +] + [[package]] name = "libloading" version = "0.7.4" @@ -2374,6 +3886,39 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "libm" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + +[[package]] +name = "libz-sys" +version = "1.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "line-wrap" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" +dependencies = [ + "safemem", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -2428,6 +3973,20 @@ name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +dependencies = [ + "serde", +] + +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] [[package]] name = "mac" @@ -2444,6 +4003,17 @@ dependencies = [ "libc", ] +[[package]] +name = "mailparse" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b56570f5f8c0047260d1c8b5b331f62eb9c660b9dd4071a8c46f8c7d3f280aa" +dependencies = [ + "charset", + "data-encoding", + "quoted_printable", +] + [[package]] name = "malloc_buf" version = "0.0.6" @@ -2484,12 +4054,30 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "md-5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "memchr" version = "2.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5486aed0026218e61b8a01d5fbd5a0a134649abb71a0e53b7bc088529dced86e" +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -2508,6 +4096,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + [[package]] name = "memoffset" version = "0.9.0" @@ -2517,6 +4114,17 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memory-module-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bbdce2925c681860b08875119254fb5543dbf6337c56ff93afebeed9c686da3" +dependencies = [ + "cc", + "libc", + "winapi", +] + [[package]] name = "metaflac" version = "0.2.5" @@ -2544,6 +4152,26 @@ dependencies = [ "unicase", ] +[[package]] +name = "minicbor" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7005aaf257a59ff4de471a9d5538ec868a21586534fff7f85dd97d4043a6139" +dependencies = [ + "minicbor-derive", +] + +[[package]] +name = "minicbor-derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1154809406efdb7982841adb6311b3d095b46f78342dd646736122fe6b19e267" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "minify-html" version = "0.11.1" @@ -2780,6 +4408,12 @@ dependencies = [ "jni-sys", ] +[[package]] +name = "nested" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b420f638f07fe83056b55ea190bb815f609ec5a35e7017884a10f78839c9e" + [[package]] name = "new_debug_unreachable" version = "1.0.4" @@ -2817,6 +4451,16 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" +[[package]] +name = "nom" +version = "4.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" +dependencies = [ + "memchr", + "version_check 0.1.5", +] + [[package]] name = "nom" version = "7.1.3" @@ -2856,6 +4500,24 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.5", + "serde", + "smallvec", + "zeroize", +] + [[package]] name = "num-complex" version = "0.4.4" @@ -2886,6 +4548,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-rational" version = "0.4.1" @@ -2906,6 +4579,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -2914,7 +4588,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.2", "libc", ] @@ -3037,6 +4711,15 @@ dependencies = [ "byteorder", ] +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs", +] + [[package]] name = "once_cell" version = "1.18.0" @@ -3074,7 +4757,7 @@ dependencies = [ "tempfile", "tinyfiledialogs", "trash", - "tungstenite", + "tungstenite 0.20.0", "urlencoding", "walkdir", "webbrowser", @@ -3098,6 +4781,7 @@ dependencies = [ "log", "onetagger-platforms", "onetagger-player", + "onetagger-python", "onetagger-shared", "onetagger-tag", "onetagger-tagger", @@ -3179,6 +4863,35 @@ dependencies = [ "urlencoding", ] +[[package]] +name = "onetagger-python" +version = "0.1.0" +dependencies = [ + "anyhow", + "bitcode", + "chrono", + "dunce", + "log", + "onetagger-shared", + "onetagger-tagger", + "pyembed", + "pyo3", + "serde", + "serde_json", +] + +[[package]] +name = "onetagger-python-builder" +version = "0.1.0" +dependencies = [ + "anyhow", + "pyoxidizer", + "regex", + "ureq", + "walkdir", + "zip", +] + [[package]] name = "onetagger-renamer" version = "0.1.0" @@ -3224,6 +4937,7 @@ dependencies = [ "metaflac", "mp4ameta", "once_cell", + "pyo3", "riff", "serde", ] @@ -3236,6 +4950,7 @@ dependencies = [ "chrono", "log", "onetagger-tag", + "pyo3", "regex", "serde", "serde_json", @@ -3243,6 +4958,12 @@ dependencies = [ "unidecode", ] +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + [[package]] name = "opener" version = "0.6.1" @@ -3254,6 +4975,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + [[package]] name = "option-ext" version = "0.2.0" @@ -3264,10 +4991,62 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" name = "ordered-stream" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "os_pipe" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "outref" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" + +[[package]] +name = "p12" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4873306de53fe82e7e484df31e1e947d61514b6ea2ed6cd7b45d63006fd9224" +dependencies = [ + "cbc", + "cipher", + "des", + "getrandom 0.2.10", + "hmac", + "lazy_static", + "rc2", + "sha1 0.10.5", + "yasna", +] + +[[package]] +name = "p256" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" +dependencies = [ + "ecdsa", + "elliptic-curve", +] + +[[package]] +name = "packagemerge" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0efcf6ee55f8f7a24333bc8d1dd0e541a6cedf903dbc07ae6479d7f8ff32ed08" dependencies = [ - "futures-core", - "pin-project-lite", + "itertools 0.4.19", ] [[package]] @@ -3280,7 +5059,7 @@ dependencies = [ "arbitrary-int", "fixed", "heapless", - "nom", + "nom 7.1.3", ] [[package]] @@ -3358,24 +5137,183 @@ dependencies = [ "memchr", ] +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +[[package]] +name = "path-dedot" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d55e486337acb9973cdea3ec5638c1b3bcb22e573b2b7b41969e0c744d5a15e" +dependencies = [ + "once_cell", +] + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +dependencies = [ + "camino", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", + "hmac", + "password-hash", + "sha2 0.10.7", +] + [[package]] name = "peeking_take_while" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "pem-rfc7468" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +[[package]] +name = "pest" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "pest_meta" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" +dependencies = [ + "once_cell", + "pest", + "sha2 0.10.7", +] + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.0.0", +] + +[[package]] +name = "pgp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "991e3f098483f52c454c7cb16720adc010c2966a8845d3c34aad589cb86d3196" +dependencies = [ + "aes", + "base64 0.13.1", + "bitfield", + "block-padding", + "blowfish", + "buf_redux", + "byteorder", + "cast5", + "cfb-mode", + "chrono", + "cipher", + "crc24", + "derive_builder", + "des", + "digest 0.10.7", + "ed25519-dalek", + "flate2", + "generic-array", + "hex", + "log", + "md-5", + "nom 4.2.3", + "num-bigint-dig", + "num-derive", + "num-traits", + "rand 0.8.5", + "ripemd", + "rsa", + "sha1 0.10.5", + "sha2 0.10.7", + "sha3", + "signature", + "smallvec", + "thiserror", + "twofish", + "x25519-dalek", + "zeroize", +] + [[package]] name = "phf" version = "0.8.0" @@ -3542,12 +5480,54 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs1" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff33bdbdfc54cc98a2eca766ebdec3e1b8fb7387523d5c9c9a2891da856f719" +dependencies = [ + "der", + "pkcs8", + "spki", + "zeroize", +] + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "plist" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdc0001cfea3db57a2e24bc0d818e9e20e554b5f97fabb9bc231dc240269ae06" +dependencies = [ + "base64 0.21.3", + "indexmap 1.9.3", + "line-wrap", + "quick-xml", + "serde", + "time 0.3.28", +] + [[package]] name = "png" version = "0.17.10" @@ -3609,7 +5589,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "version_check", + "version_check 0.9.4", ] [[package]] @@ -3620,34 +5600,257 @@ checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2", "quote", - "version_check", + "version_check 0.9.4", +] + +[[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.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "pulldown-cmark" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +dependencies = [ + "bitflags 1.3.2", + "getopts", + "memchr", + "unicase", +] + +[[package]] +name = "pyembed" +version = "0.25.0-pre" +source = "git+https://github.com/indygreg/PyOxidizer.git#b78b0cb75f4317c45408bbc9a569c062c482c679" +dependencies = [ + "anyhow", + "dunce", + "libc", + "once_cell", + "pyo3", + "pyo3-build-config 0.18.3", + "python-oxidized-importer", + "python-packaging 0.16.0 (git+https://github.com/indygreg/PyOxidizer.git)", +] + +[[package]] +name = "pyo3" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b1ac5b3731ba34fdaa9785f8d74d17448cd18f30cf19e0c7e7b1fdb5272109" +dependencies = [ + "cfg-if", + "chrono", + "indoc", + "libc", + "memoffset 0.8.0", + "parking_lot", + "pyo3-build-config 0.18.3", + "pyo3-ffi", + "pyo3-macros", + "serde", + "unindent", +] + +[[package]] +name = "pyo3-build-config" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28fcd1e73f06ec85bf3280c48c67e731d8290ad3d730f8be9dc07946923005c8" +dependencies = [ + "once_cell", + "target-lexicon", +] + +[[package]] +name = "pyo3-build-config" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cb946f5ac61bb61a5014924910d936ebd2b23b705f7a4a3c40b05c720b079a3" +dependencies = [ + "once_cell", + "target-lexicon", +] + +[[package]] +name = "pyo3-ffi" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd4d7c5337821916ea2a1d21d1092e8443cf34879e53a0ac653fbb98f44ff65c" +dependencies = [ + "libc", + "pyo3-build-config 0.18.3", +] + +[[package]] +name = "pyo3-macros" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d39c55dab3fc5a4b25bbd1ac10a2da452c4aca13bb450f22818a002e29648d" +dependencies = [ + "proc-macro2", + "pyo3-macros-backend", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pyo3-macros-backend" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97daff08a4c48320587b5224cc98d609e3c27b6d437315bd40b605c98eeb5918" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pyoxidizer" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23c54ba069fc4f4744eb4eddf1f5bdefc842738eb016779ebc314afa14e6d8ce" +dependencies = [ + "anyhow", + "apple-sdk", + "ar", + "cargo-lock", + "cargo_toml", + "cc", + "clap", + "codemap", + "codemap-diagnostic", + "dirs", + "duct", + "env_logger", + "fs2", + "git2", + "glob", + "guppy", + "handlebars", + "hex", + "itertools 0.10.5", + "linked-hash-map", + "log", + "once_cell", + "path-dedot", + "pyo3-build-config 0.17.3", + "python-packaging 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "python-packed-resources 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all", + "rustc_version 0.4.0", + "semver 1.0.18", + "serde", + "serde_json", + "sha2 0.10.7", + "shlex", + "simple-file-manifest", + "starlark", + "starlark-dialect-build-targets", + "tar", + "tempfile", + "tugger", + "tugger-binary-analysis", + "tugger-code-signing", + "tugger-common", + "tugger-rust-toolchain", + "tugger-windows", + "tugger-wix", + "url", + "uuid", + "version-compare", + "walkdir", + "which", + "zstd 0.12.4", +] + +[[package]] +name = "python-oxidized-importer" +version = "0.9.0" +source = "git+https://github.com/indygreg/PyOxidizer.git#b78b0cb75f4317c45408bbc9a569c062c482c679" +dependencies = [ + "anyhow", + "memmap2", + "memory-module-sys", + "once_cell", + "pyo3", + "python-packaging 0.16.0 (git+https://github.com/indygreg/PyOxidizer.git)", + "python-packed-resources 0.12.0 (git+https://github.com/indygreg/PyOxidizer.git)", + "simple-file-manifest", + "winapi", + "zip", +] + +[[package]] +name = "python-packaging" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177802e8a6b8cc825dd37b8edfc37e617653d1d9b4c4a063f355f6c7a5c17351" +dependencies = [ + "anyhow", + "base64 0.20.0", + "byteorder", + "encoding_rs", + "itertools 0.10.5", + "mailparse", + "once_cell", + "python-packed-resources 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex", + "sha2 0.10.7", + "simple-file-manifest", + "spdx", + "time 0.3.28", + "walkdir", + "zip", +] + +[[package]] +name = "python-packaging" +version = "0.16.0" +source = "git+https://github.com/indygreg/PyOxidizer.git#b78b0cb75f4317c45408bbc9a569c062c482c679" +dependencies = [ + "anyhow", + "byteorder", + "encoding_rs", + "itertools 0.10.5", + "mailparse", + "once_cell", + "python-packed-resources 0.12.0 (git+https://github.com/indygreg/PyOxidizer.git)", + "regex", + "simple-file-manifest", + "spdx", + "walkdir", ] [[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.66" +name = "python-packed-resources" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "caf0dc168f0aaf231920fa01d7d1cc1ac021ac63ab4bb7a8831282d4a7569064" dependencies = [ - "unicode-ident", + "anyhow", + "byteorder", ] [[package]] -name = "pulldown-cmark" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +name = "python-packed-resources" +version = "0.12.0" +source = "git+https://github.com/indygreg/PyOxidizer.git#b78b0cb75f4317c45408bbc9a569c062c482c679" dependencies = [ - "bitflags 1.3.2", - "getopts", - "memchr", - "unicase", + "anyhow", + "byteorder", ] [[package]] @@ -3665,6 +5868,15 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-xml" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81b9228215d82c7b61490fec1de287136b5de6f5700f6e58ea9ad61a7964ca51" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.33" @@ -3674,6 +5886,18 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "quoted_printable" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3866219251662ec3b26fc217e3e05bf9c4f84325234dfb96bf0bf840889e49" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + [[package]] name = "rand" version = "0.7.3" @@ -3755,6 +5979,35 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rasn" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "417c93c4470c2637fd27307f046653c70a957f374caae89cb5c9fb35a5fdf147" +dependencies = [ + "bitvec", + "bytes", + "chrono", + "konst", + "nom 7.1.3", + "num-bigint", + "num-traits", + "rasn-derive", + "snafu", +] + +[[package]] +name = "rasn-derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e1c39006ee96ffe7c83f656a5d20269366098a3feb35ad4a7c022e3784643cb" +dependencies = [ + "itertools 0.10.5", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "raw-window-handle" version = "0.4.3" @@ -3792,6 +6045,27 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "rc2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62c64daa8e9438b84aaae55010a93f396f8e60e3911590fcba770d04643fc1dd" +dependencies = [ + "cipher", +] + +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem", + "ring", + "time 0.3.28", + "yasna", +] + [[package]] name = "redlux" version = "0.6.0" @@ -3841,7 +6115,7 @@ dependencies = [ "aho-corasick 1.0.5", "memchr", "regex-automata", - "regex-syntax", + "regex-syntax 0.7.5", ] [[package]] @@ -3852,15 +6126,34 @@ checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" dependencies = [ "aho-corasick 1.0.5", "memchr", - "regex-syntax", + "regex-syntax 0.7.5", ] +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +[[package]] +name = "remove_dir_all" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882f368737489ea543bc5c340e6f3d34a28c39980bd9a979e47322b26f60ac40" +dependencies = [ + "libc", + "log", + "num_cpus", + "rayon", + "winapi", +] + [[package]] name = "reqwest" version = "0.11.20" @@ -3876,7 +6169,7 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls", + "hyper-rustls 0.24.1", "ipnet", "js-sys", "log", @@ -3884,22 +6177,28 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.21.7", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", "webpki-roots 0.25.2", - "winreg", + "winreg 0.50.0", ] +[[package]] +name = "residua-zigzag" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b37805477eee599a61753230f511ae94d737f69b536e468e294723ad5f1b75f" + [[package]] name = "riff" version = "2.0.0" @@ -3921,6 +6220,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "rodio" version = "0.16.0" @@ -3958,6 +6266,27 @@ dependencies = [ "url", ] +[[package]] +name = "rsa" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "094052d5470cbcef561cb848a7209968c9f12dfa6d668f4bca048ac5de51099c" +dependencies = [ + "byteorder", + "digest 0.10.7", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core 0.6.4", + "signature", + "smallvec", + "subtle", + "zeroize", +] + [[package]] name = "rspotify" version = "0.11.7" @@ -3974,7 +6303,7 @@ dependencies = [ "rspotify-model", "serde", "serde_json", - "sha2", + "sha2 0.10.7", "thiserror", "url", ] @@ -4042,6 +6371,15 @@ dependencies = [ "semver 1.0.18", ] +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom 7.1.3", +] + [[package]] name = "rustix" version = "0.37.23" @@ -4069,6 +6407,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "rustls" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + [[package]] name = "rustls" version = "0.21.7" @@ -4081,6 +6431,18 @@ dependencies = [ "sct", ] +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.3" @@ -4137,6 +6499,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -4160,6 +6531,26 @@ dependencies = [ "tendril", ] +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + [[package]] name = "sct" version = "0.7.0" @@ -4170,6 +6561,43 @@ dependencies = [ "untrusted", ] +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "selectors" version = "0.22.0" @@ -4223,6 +6651,9 @@ name = "semver" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +dependencies = [ + "serde", +] [[package]] name = "semver-parser" @@ -4239,6 +6670,18 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-xml-rs" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb3aa78ecda1ebc9ec9847d5d3aba7d618823446a049ba2491940506da6e2782" +dependencies = [ + "log", + "serde", + "thiserror", + "xml-rs", +] + [[package]] name = "serde_derive" version = "1.0.188" @@ -4293,6 +6736,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" +dependencies = [ + "indexmap 2.0.0", + "itoa 1.0.9", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "servo_arc" version = "0.1.1" @@ -4329,7 +6785,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -4338,6 +6794,19 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + [[package]] name = "sha2" version = "0.10.7" @@ -4346,9 +6815,35 @@ checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "shared_child" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" +dependencies = [ + "libc", + "winapi", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "shlex" version = "1.1.0" @@ -4385,12 +6880,49 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "simd-abstraction" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987" +dependencies = [ + "outref", +] + [[package]] name = "simd-adler32" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "simple-file-manifest" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dd19be0257552dd56d1bb6946f89f193c6e5b9f13cc9327c4bc84a357507c74" + +[[package]] +name = "simple_asn1" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +dependencies = [ + "num-bigint", + "num-traits", + "thiserror", + "time 0.3.28", +] + [[package]] name = "siphasher" version = "0.3.11" @@ -4418,10 +6950,32 @@ dependencies = [ ] [[package]] -name = "smallvec" -version = "1.11.0" +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "snafu" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4de37ad025c587a29e8f3f5605c00f70b98715ef90b9061a815b9e59e9042d6" +dependencies = [ + "doc-comment", + "snafu-derive", +] + +[[package]] +name = "snafu-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "990079665f075b699031e9c08fd3ab99be5029b96f3b78dc0709e8f77e4efebf" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "socket2" @@ -4488,6 +7042,27 @@ dependencies = [ "system-deps", ] +[[package]] +name = "spake2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7139ade210556eca57dfc299ec2454846ab6be09232eb1139a36e285ae7fd48e" +dependencies = [ + "curve25519-dalek", + "hkdf", + "rand_core 0.5.1", + "sha2 0.10.7", +] + +[[package]] +name = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", +] + [[package]] name = "spin" version = "0.5.2" @@ -4503,12 +7078,50 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "starlark" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "972d5fa34b7f75433d13e69f0ff0fb7e0497103b826ebd8af8934103ad2fed19" +dependencies = [ + "codemap", + "codemap-diagnostic", + "lalrpop", + "lalrpop-util", + "linked-hash-map", +] + +[[package]] +name = "starlark-dialect-build-targets" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f58b23085347a69eaf5fed98586fb4f9feeb5b6e9b2c8b3085eb0bb50d6ca12" +dependencies = [ + "anyhow", + "codemap", + "codemap-diagnostic", + "linked-hash-map", + "log", + "path-dedot", + "starlark", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -4618,6 +7231,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + [[package]] name = "syn" version = "1.0.109" @@ -4640,6 +7259,18 @@ dependencies = [ "unicode-ident", ] +[[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.109", + "unicode-xid", +] + [[package]] name = "sysinfo" version = "0.29.9" @@ -4728,12 +7359,40 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "target-lexicon" version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" +[[package]] +name = "target-spec" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf4306559bd50cb358e7af5692694d6f6fad95cf2c0bea2571dd419f5298e12" +dependencies = [ + "cfg-expr", + "guppy-workspace-hack", + "target-lexicon", +] + [[package]] name = "tempfile" version = "3.8.0" @@ -4758,6 +7417,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + [[package]] name = "thin-slice" version = "0.1.1" @@ -4845,6 +7524,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tiny_http" version = "0.12.0" @@ -4898,13 +7586,35 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls 0.20.9", + "tokio", + "webpki", +] + [[package]] name = "tokio-rustls" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.7", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite", "tokio", ] @@ -4953,77 +7663,311 @@ dependencies = [ ] [[package]] -name = "toml_edit" -version = "0.19.14" +name = "toml_edit" +version = "0.19.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +dependencies = [ + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "trash" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af3663fb8f476d674b9c61d1d2796acec725bef6bec4b41402a904252a25971e" +dependencies = [ + "chrono", + "libc", + "log", + "objc", + "once_cell", + "scopeguard", + "url", + "windows 0.44.0", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "tugger" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35f9c3c9de887f45079959f4bee8f434b69fd9725656ba4ec7938adb88391b9d" +dependencies = [ + "anyhow", + "apple-bundles", + "atty", + "codemap", + "codemap-diagnostic", + "console", + "dialoguer", + "linked-hash-map", + "log", + "plist", + "python-packaging 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "simple-file-manifest", + "starlark", + "starlark-dialect-build-targets", + "tar", + "tempfile", + "time 0.3.28", + "tugger-apple", + "tugger-code-signing", + "tugger-common", + "tugger-snapcraft", + "tugger-windows", + "tugger-wix", + "walkdir", +] + +[[package]] +name = "tugger-apple" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c79259da13e96069a46051491c42444e4c11e9400c35351f4fbf37fedbc2245" +dependencies = [ + "anyhow", + "goblin", + "scroll", + "thiserror", +] + +[[package]] +name = "tugger-binary-analysis" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d2aab9ee28a8116f4371ae3f83fb4b6787f52d5cf20904863ef4767ec3ae51f" +dependencies = [ + "anyhow", + "byteorder", + "goblin", + "once_cell", + "version-compare", +] + +[[package]] +name = "tugger-code-signing" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e50a45fa070d66c2ad8fb208e23d04240df0ab104ead709445a4814a9917f347" +dependencies = [ + "anyhow", + "apple-bundles", + "apple-codesign", + "bcder", + "cryptographic-message-syntax", + "goblin", + "log", + "p12", + "reqwest", + "simple-file-manifest", + "tempfile", + "thiserror", + "tugger-windows-codesign", + "x509-certificate", + "yasna", +] + +[[package]] +name = "tugger-common" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90d950380afdb1a6bbe74f29485a04e821869dfad11f5929ff1c5b1dac09d02" +dependencies = [ + "anyhow", + "fs2", + "glob", + "hex", + "log", + "once_cell", + "reqwest", + "sha2 0.10.7", + "tempfile", + "url", + "zip", +] + +[[package]] +name = "tugger-rust-toolchain" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "3e6b6ad138ac16eff678163cbfa292815323079ee37d334c8f7740517369e77f" dependencies = [ - "indexmap 2.0.0", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", + "anyhow", + "flate2", + "fs2", + "hex", + "log", + "once_cell", + "pgp", + "sha2 0.10.7", + "simple-file-manifest", + "tar", + "toml 0.5.11", + "tugger-common", + "xz2", + "zstd 0.12.4", ] [[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.37" +name = "tugger-snapcraft" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "f16e0f1ebcc74026050c1ddf974f7e02a5f19884d29c1ce74a4f4a0f15115457" dependencies = [ - "cfg-if", - "pin-project-lite", - "tracing-attributes", - "tracing-core", + "anyhow", + "duct", + "log", + "remove_dir_all", + "serde", + "serde_yaml", + "simple-file-manifest", + "tugger-common", ] [[package]] -name = "tracing-attributes" -version = "0.1.26" +name = "tugger-windows" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "e9f181ac4fc7f8facfd418824d13045cd068ee73de44319a6116868c22789782" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", + "anyhow", + "duct", + "find-winsdk", + "glob", + "once_cell", + "semver 1.0.18", + "tugger-common", + "winapi", ] [[package]] -name = "tracing-core" -version = "0.1.31" +name = "tugger-windows-codesign" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "ed3f09f8bdace495373cec3fc607bc39f00720a984ba82e310cc9382462fd364" dependencies = [ - "once_cell", + "anyhow", + "duct", + "log", + "p12", + "rcgen", + "time 0.3.28", + "tugger-common", + "tugger-windows", + "yasna", ] [[package]] -name = "trash" -version = "3.0.6" +name = "tugger-wix" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af3663fb8f476d674b9c61d1d2796acec725bef6bec4b41402a904252a25971e" +checksum = "cab015af5e0a8e588cf8d7fa0cf2d09de60f9a8cb47762eff8f57b1412246cc1" dependencies = [ - "chrono", - "libc", + "anyhow", + "duct", "log", - "objc", "once_cell", - "scopeguard", + "simple-file-manifest", + "tugger-common", + "tugger-windows", + "tugger-windows-codesign", "url", - "windows 0.44.0", + "uuid", + "xml-rs", ] [[package]] -name = "try-lock" -version = "0.2.4" +name = "tungstenite" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" +dependencies = [ + "base64 0.13.1", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand 0.8.5", + "rustls 0.20.9", + "rustls-native-certs", + "sha1 0.10.5", + "thiserror", + "url", + "utf-8", + "webpki", +] [[package]] name = "tungstenite" @@ -5044,6 +7988,15 @@ dependencies = [ "utf-8", ] +[[package]] +name = "twofish" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78e83a30223c757c3947cd144a31014ff04298d8719ae10d03c31c0448c8013" +dependencies = [ + "cipher", +] + [[package]] name = "twoway" version = "0.1.8" @@ -5059,6 +8012,12 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + [[package]] name = "uds_windows" version = "1.0.2" @@ -5075,7 +8034,7 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ - "version_check", + "version_check 0.9.4", ] [[package]] @@ -5111,12 +8070,30 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "unidecode" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "402bb19d8e03f1d1a7450e2bd613980869438e0666331be3e073089124aa1adc" +[[package]] +name = "unindent" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1766d682d402817b5ac4490b3c3002d91dfa0d22812f341609f97b08757359c" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" + [[package]] name = "untrusted" version = "0.7.1" @@ -5132,9 +8109,10 @@ dependencies = [ "base64 0.21.3", "cookie", "cookie_store", + "flate2", "log", "once_cell", - "rustls", + "rustls 0.21.7", "rustls-webpki 0.100.2", "serde", "serde_json", @@ -5178,14 +8156,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ "getrandom 0.2.10", + "sha1_smol", ] +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version-compare" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" + [[package]] name = "version_check" version = "0.9.4" @@ -5372,6 +8363,25 @@ dependencies = [ "system-deps", ] +[[package]] +name = "webpki" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0e74f82d49d545ad128049b7e88f6576df2da6b02e9ce565c6f533be576957e" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + [[package]] name = "webpki-roots" version = "0.23.1" @@ -5732,6 +8742,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a27a759395c1195c4cc5cda607ef6f8f6498f64e78f7900f5de0a127a424704a" +dependencies = [ + "serde", + "winapi", +] + [[package]] name = "winreg" version = "0.50.0" @@ -5778,7 +8798,7 @@ dependencies = [ "once_cell", "serde", "serde_json", - "sha2", + "sha2 0.10.7", "soup3", "tao", "thiserror", @@ -5790,6 +8810,15 @@ dependencies = [ "windows-implement", ] +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + [[package]] name = "x11" version = "2.21.0" @@ -5811,6 +8840,54 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "x25519-dalek" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +dependencies = [ + "curve25519-dalek", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "x509" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3cec94c3999f31341553f358ef55f65fc031291a022cd42ec0ce7219560c76" +dependencies = [ + "chrono", + "cookie-factory", +] + +[[package]] +name = "x509-certificate" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90961fdd7cce5ded2f3bfa356a09fa95eba44582ab9d10ea619b93c02f42a4f0" +dependencies = [ + "bcder", + "bytes", + "chrono", + "der", + "hex", + "pem", + "ring", + "signature", + "spki", + "thiserror", +] + +[[package]] +name = "xattr" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" +dependencies = [ + "libc", +] + [[package]] name = "xdg-home" version = "1.0.0" @@ -5821,6 +8898,36 @@ dependencies = [ "winapi", ] +[[package]] +name = "xml-rs" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47430998a7b5d499ccee752b41567bc3afc57e1327dc855b1a2aa44ce29b5fa1" + +[[package]] +name = "xmlparser" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd" + +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time 0.3.28", +] + [[package]] name = "zbus" version = "3.14.1" @@ -5887,6 +8994,106 @@ dependencies = [ "zvariant", ] +[[package]] +name = "zeroize" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2", + "sha1 0.10.5", + "time 0.3.28", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "zip_structs" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce824a6bfffe8942820fa36d24973b7c83a40896749a42e33de0abdd11750ee5" +dependencies = [ + "byteorder", + "bytesize", + "thiserror", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe 6.0.6", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.8+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "zune-inflate" version = "0.2.54" diff --git a/Cargo.toml b/Cargo.toml index 09424e0f..ea3eecd8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,14 +7,14 @@ members = [ "crates/onetagger-shared", "crates/onetagger-player", "crates/onetagger-tagger", + "crates/onetagger-python", "crates/onetagger-renamer", "crates/onetagger-autotag", "crates/onetagger-playlist", "crates/onetagger-platforms", + "crates/onetagger-python-builder", ] -exclude = ["android", "android/onetagger-android"] - # Optimize for size [profile.release] opt-level = 3 diff --git a/crates/onetagger-autotag/Cargo.toml b/crates/onetagger-autotag/Cargo.toml index bd7f9736..ffda1b59 100644 --- a/crates/onetagger-autotag/Cargo.toml +++ b/crates/onetagger-autotag/Cargo.toml @@ -27,7 +27,8 @@ reqwest = { version = "0.11", features = ["json", "blocking", "rustls-tls"], def songrec = { git = "https://github.com/Marekkon5/SongRec.git" } onetagger-tag = { path = "../onetagger-tag" } +onetagger-python = { path = "../onetagger-python" } onetagger-tagger = { path = "../onetagger-tagger" } onetagger-player = { path = "../onetagger-player" } onetagger-shared = { path = "../onetagger-shared" } -onetagger-platforms = { path = "../onetagger-platforms" } +onetagger-platforms = { path = "../onetagger-platforms" } \ No newline at end of file diff --git a/crates/onetagger-autotag/src/lib.rs b/crates/onetagger-autotag/src/lib.rs index 858eb09f..1e2d19c7 100644 --- a/crates/onetagger-autotag/src/lib.rs +++ b/crates/onetagger-autotag/src/lib.rs @@ -33,6 +33,7 @@ pub mod audiofeatures; // Re-exports pub use platforms::{AUTOTAGGER_PLATFORMS, AutotaggerPlatforms}; +pub use onetagger_python::python_process; lazy_static::lazy_static! { /// Stop tagging global variable @@ -46,17 +47,18 @@ pub trait TaggerConfigExt { impl TaggerConfigExt for TaggerConfig { fn custom_default() -> TaggerConfig { let mut custom = HashMap::new(); - for platform in &AUTOTAGGER_PLATFORMS.0 { - if !platform.platform.custom_options.options.is_empty() { + let autotagger_platforms = AUTOTAGGER_PLATFORMS.lock().unwrap(); + for platform in &autotagger_platforms.0 { + if !platform.info.platform.custom_options.options.is_empty() { let mut options = HashMap::new(); - for option in &platform.platform.custom_options.options { + for option in &platform.info.platform.custom_options.options { options.insert(option.id.to_string(), option.value.json_value()); } - custom.insert(platform.platform.id.to_string(), serde_json::to_value(options).unwrap()); + custom.insert(platform.info.platform.id.to_string(), serde_json::to_value(options).unwrap()); } } let mut default = TaggerConfig::default(); - default.custom = custom; + default.custom = custom.into(); default } } @@ -460,9 +462,9 @@ impl AudioFileInfoImpl for AudioFileInfo { fn load_duration(&mut self) { // Mark as loaded - self.duration = Some(Duration::ZERO); + self.duration = Some(Duration::ZERO.into()); if let Ok(source) = AudioSources::from_path(&self.path) { - self.duration = Some(Duration::from_millis(source.duration() as u64)) + self.duration = Some(Duration::from_millis(source.duration() as u64).into()) } else { warn!("Failed loading duration from file! {:?}", self.path); } @@ -502,7 +504,7 @@ impl AudioFileInfoImpl for AudioFileInfo { format: AudioFileFormat::from_extension(&path.as_ref().extension().unwrap_or_default().to_string_lossy()).unwrap(), path: path.as_ref().to_owned(), isrc: shazam_track.isrc, - duration: Some(Duration::from_millis(duration as u64)), + duration: Some(Duration::from_millis(duration as u64).into()), track_number: None, tagged: FileTaggedStatus::Untagged, tags: Default::default(), @@ -619,7 +621,8 @@ impl Tagger { } // Get tagger - let mut tagger = match AUTOTAGGER_PLATFORMS.get_builder(platform) { + let mut autotagger_platforms = AUTOTAGGER_PLATFORMS.lock().unwrap(); + let tagger = match autotagger_platforms.get_builder(platform) { Some(tagger) => tagger, None => { error!("Invalid platform: {platform}"); @@ -631,7 +634,7 @@ impl Tagger { if platform_info.max_threads > 0 && platform_info.max_threads < config.threads { threads = platform_info.max_threads; } - let rx = match Tagger::tag_dir(&files, &mut tagger, &config, threads) { + let rx = match Tagger::tag_dir(&files, tagger, &config, threads) { Some(t) => t, None => { error!("Failed creating platform: {platform:?}, skipping..."); @@ -894,7 +897,7 @@ impl Tagger { } // Tag all files with threads specified in config - pub fn tag_dir(files: &Vec, tagger: &mut Box, config: &TaggerConfig, threads: u16) -> Option> { + pub fn tag_dir(files: &Vec, tagger: &mut Box, config: &TaggerConfig, threads: u16) -> Option> { info!("Starting tagging: {} files, {} threads!", files.len(), threads); let (tx, rx) = unbounded(); let (file_tx, file_rx): (Sender, Receiver) = unbounded(); @@ -998,7 +1001,8 @@ pub fn manual_tagger(path: impl AsRef, config: &TaggerConfig) -> Result p, None => { warn!("Invalid platform: {platform}"); @@ -1006,6 +1010,15 @@ pub fn manual_tagger(path: impl AsRef, config: &TaggerConfig) -> Result s, + Err(e) => { + error!("Failed creating platform source for platform: {platform}. {e}"); + continue; + } + }; + // Spawn thread to match track let mut config = config.clone(); config.fetch_all_results = true; @@ -1013,15 +1026,6 @@ pub fn manual_tagger(path: impl AsRef, config: &TaggerConfig) -> Result s, - Err(e) => { - error!("Failed creating platform source for platform: {platform}. {e}"); - tx.send((platform, Err(e))).ok(); - return; - } - }; // Match let r = s.match_track(&info, &config).map(|mut m| { m.dedup(); m }); tx.send((platform, r)).ok(); @@ -1040,7 +1044,8 @@ pub fn manual_tagger_apply(mut matches: Vec, path: impl AsRef, // Extend each match for m in matches.iter_mut() { // Get platform - let mut p = match AUTOTAGGER_PLATFORMS.get_builder(&m.track.platform) { + let mut autotagger_platforms = AUTOTAGGER_PLATFORMS.lock().unwrap(); + let p = match autotagger_platforms.get_builder(&m.track.platform) { Some(p) => p, None => { warn!("Invalid platform: {}", m.track.platform); diff --git a/crates/onetagger-autotag/src/platforms.rs b/crates/onetagger-autotag/src/platforms.rs index 793bee86..10c1a8ab 100644 --- a/crates/onetagger-autotag/src/platforms.rs +++ b/crates/onetagger-autotag/src/platforms.rs @@ -2,6 +2,7 @@ use anyhow::Error; use std::ffi::c_void; use std::path::PathBuf; use std::io::Cursor; +use std::sync::{Arc, Mutex}; use base64::Engine; use libloading::{Library, Symbol}; use onetagger_platforms::{beatport, junodownload, spotify, traxsource, discogs, itunes, musicbrainz, beatsource, bpmsupreme, bandcamp, deezer, musixmatch}; @@ -13,17 +14,16 @@ use onetagger_tagger::{AutotaggerSourceBuilder, PlatformInfo, AutotaggerSource, lazy_static::lazy_static! { /// Globally loaded all platforms - pub static ref AUTOTAGGER_PLATFORMS: AutotaggerPlatforms = AutotaggerPlatforms::all(); + pub static ref AUTOTAGGER_PLATFORMS: Arc> = Arc::new(Mutex::new(AutotaggerPlatforms::all())); } /// For passing platform list into UI -#[derive(Serialize, Deserialize)] pub struct AutotaggerPlatforms(pub Vec); impl AutotaggerPlatforms { /// Get all the available platforms - pub fn all() -> AutotaggerPlatforms { + fn all() -> AutotaggerPlatforms { let mut output = vec![]; // Built-ins @@ -46,76 +46,70 @@ impl AutotaggerPlatforms { Ok(_) => {}, Err(e) => warn!("Failed loading custom platforms: {e}") }; + match platforms.load_python() { + Ok(_) => {}, + Err(e) => warn!("Failed loading Python platforms: {e}"), + } + platforms } /// Get the source - pub fn get_builder(&self, id: &str) -> Option> { - let platform = self.0.iter().find(|p| p.id == id)?; - if platform.built_in { - let platform: Box = match platform.id.as_ref() { - "beatport" => Box::new(beatport::BeatportBuilder::new()), - "discogs" => Box::new(discogs::DiscogsBuilder::new()), - "beatsource" => Box::new(beatsource::BeatsourceBuilder::new()), - "itunes" => Box::new(itunes::ITunesBuilder::new()), - "junodownload" => Box::new(junodownload::JunoDownloadBuilder::new()), - "musicbrainz" => Box::new(musicbrainz::MusicBrainzBuilder::new()), - "spotify" => Box::new(spotify::SpotifyBuilder::new()), - "traxsource" => Box::new(traxsource::TraxsourceBuilder::new()), - "bpmsupreme" => Box::new(bpmsupreme::BPMSupremeBuilder::new()), - "bandcamp" => Box::new(bandcamp::BandcampBuilder::new()), - "deezer" => Box::new(deezer::DeezerBuilder::new()), - "musixmatch" => Box::new(musixmatch::MusixmatchBuilder::new()), - _ => unreachable!() - }; - Some(platform) - } else { - // Custom platform - Some(Box::new(platform.custom.as_ref().unwrap().get_builder().unwrap())) - } + pub fn get_builder(&mut self, id: &str) -> Option<&mut Box> { + let platform = self.0.iter_mut().find(|p| p.info.id == id)?; + Some(&mut platform.platform) } /// Add a builtin platform to output list fn add_builtin(output: &mut Vec) { let info = P::new().info(); output.push(AutotaggerPlatform { - id: info.id.clone(), - built_in: true, - icon: match Self::reencode_image(info.icon) { - Ok(s) => s, - Err(e) => { - warn!("Failed generating icon for platform id: {}. {e}", info.id); - String::new() - } + info: AutotaggerPlatformInfo { + id: info.id.clone(), + built_in: true, + icon: match Self::reencode_image(info.icon) { + Ok(s) => s, + Err(e) => { + warn!("Failed generating icon for platform id: {}. {e}", info.id); + String::new() + } + }, + supported_tags: info.supported_tags.clone(), + requires_auth: info.requires_auth, + platform: info, }, - supported_tags: info.supported_tags.clone(), - requires_auth: info.requires_auth, - platform: info, - custom: None + platform: Box::new(P::new()) }) } /// Prepare image for the UI - fn reencode_image(data: &'static [u8]) -> Result { + fn reencode_image(data: &[u8]) -> Result { let img = ImageReader::new(Cursor::new(data)).with_guessed_format()?.decode()?; let mut buf = vec![]; img.write_to(&mut Cursor::new(&mut buf), ImageOutputFormat::Png)?; Ok(format!("data:image/png;charset=utf-8;base64,{}", base64::engine::general_purpose::STANDARD.encode(buf))) } - /// Load custom platforms - fn load_custom(&mut self) -> Result<(), Error> { - // Path + /// Get custom platforms dir + fn platforms_dir() -> Result { let folder = Settings::get_folder()?.join("platforms"); if !folder.exists() { - std::fs::create_dir(folder)?; - return Ok(()) + std::fs::create_dir(&folder)?; } + Ok(folder) + } + + /// Load custom platforms + fn load_custom(&mut self) -> Result<(), Error> { + let folder = Self::platforms_dir()?; for entry in std::fs::read_dir(folder)? { let entry = entry?; + if entry.path().is_dir() { + continue; + } match CustomPlatform::open_platform(&entry.path()) { Ok(p) => { - info!("Loaded custom platform: {}@{}", p.id, p.platform.version); + info!("Loaded custom platform: {}@{}", p.info.id, p.info.platform.version); self.0.push(p); }, Err(e) => { @@ -127,12 +121,50 @@ impl AutotaggerPlatforms { Ok(()) } + + /// Load python custom platforms + fn load_python(&mut self) -> Result<(), Error> { + let folder = Self::platforms_dir()?; + onetagger_python::setup()?; + + for entry in std::fs::read_dir(folder)?.filter_map(|e| e.ok()).filter(|e| e.path().is_dir()) { + let platform = onetagger_python::load_python_platform(entry.path())?; + + // Load icon + let icon = match Self::reencode_image(&std::fs::read(&entry.path().join("icon.png")).unwrap_or(vec![])) { + Ok(icon) => icon, + Err(e) => { + warn!("Failed generating icon for platform: {:?} {e}", entry.path()); + String::new() + }, + }; + + // Generate info + let info = AutotaggerPlatformInfo { + id: entry.file_name().to_string_lossy().to_string(), + built_in: false, + platform: platform.info.info.to_owned(), + icon, + requires_auth: platform.info.info.requires_auth, + supported_tags: platform.info.info.supported_tags.clone(), + }; + + self.0.push(AutotaggerPlatform { info, platform: Box::new(platform) }); + } + Ok(()) + } +} + +/// Autotagger Platform +pub struct AutotaggerPlatform { + pub info: AutotaggerPlatformInfo, + pub platform: Box } /// For passing platform list into UI -#[derive(Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct AutotaggerPlatform { +pub struct AutotaggerPlatformInfo { pub id: String, pub built_in: bool, pub platform: PlatformInfo, @@ -140,12 +172,7 @@ pub struct AutotaggerPlatform { pub icon: String, pub requires_auth: bool, pub supported_tags: Vec, - - /// For custom platforms - #[serde(skip)] - custom: Option -} - +} /// Wrapper for loaded custom platform @@ -192,19 +219,21 @@ impl CustomPlatform { let filename = path.file_name().ok_or(anyhow!("Invalid filename"))?.to_str().ok_or(anyhow!("Invalid filename"))?.to_string(); let lib = Self::open(path)?; Ok(AutotaggerPlatform { - id: filename, - built_in: false, - platform: lib.info.clone(), - icon: match AutotaggerPlatforms::reencode_image(lib.info.icon) { - Ok(i) => i, - Err(e) => { - warn!("Failed loading custom platform icon: {e}"); - String::new() + info: AutotaggerPlatformInfo { + id: filename, + built_in: false, + platform: lib.info.clone(), + icon: match AutotaggerPlatforms::reencode_image(lib.info.icon) { + Ok(i) => i, + Err(e) => { + warn!("Failed loading custom platform icon: {e}"); + String::new() + }, }, + supported_tags: lib.info.supported_tags.clone(), + requires_auth: lib.info.requires_auth, }, - supported_tags: lib.info.supported_tags.clone(), - requires_auth: lib.info.requires_auth, - custom: Some(lib), + platform: Box::new(lib) }) } diff --git a/crates/onetagger-cli/build.rs b/crates/onetagger-cli/build.rs index 64964b0e..023037a9 100644 --- a/crates/onetagger-cli/build.rs +++ b/crates/onetagger-cli/build.rs @@ -1,4 +1,7 @@ fn main() { + // Required for Python + println!("cargo:rustc-link-arg=-Wl,-export-dynamic"); + // Set Windows icon #[cfg(windows)] { diff --git a/crates/onetagger-platforms/src/bandcamp.rs b/crates/onetagger-platforms/src/bandcamp.rs index 2b923ecb..993236d5 100644 --- a/crates/onetagger-platforms/src/bandcamp.rs +++ b/crates/onetagger-platforms/src/bandcamp.rs @@ -83,6 +83,7 @@ impl AutotaggerSource for Bandcamp { } +#[derive(Debug, Clone)] pub struct BandcampBuilder; impl AutotaggerSourceBuilder for BandcampBuilder { diff --git a/crates/onetagger-platforms/src/beatport.rs b/crates/onetagger-platforms/src/beatport.rs index 104503b3..b40088fa 100644 --- a/crates/onetagger-platforms/src/beatport.rs +++ b/crates/onetagger-platforms/src/beatport.rs @@ -222,7 +222,7 @@ impl BeatportTrackResult { true => self.mix_name, false => None }, - duration: Duration::from_millis(self.length.unwrap_or(0)), + duration: Duration::from_millis(self.length.unwrap_or(0)).into(), isrc: self.isrc, thumbnail: self.release.map(|r| r.release_image_uri).flatten(), genres: self.genre.map(|g| g.into_iter().map(|g| g.genre_name).collect()).unwrap_or(vec![]), @@ -258,7 +258,7 @@ impl BeatportTrack { ], track_id: Some(self.id.to_string()), release_id: self.release.id.to_string(), - duration: Duration::from_millis(self.length_ms.unwrap_or(0)), + duration: Duration::from_millis(self.length_ms.unwrap_or(0)).into(), remixers: self.remixers.into_iter().map(|r| r.name).collect(), track_number: self.number.map(|n| TrackNumber::Number(n as i32)), isrc: self.isrc, @@ -409,6 +409,7 @@ impl AutotaggerSource for Beatport { } /// For creating Beatport instances +#[derive(Debug, Clone)] pub struct BeatportBuilder { access_token: Arc>> } diff --git a/crates/onetagger-platforms/src/beatsource.rs b/crates/onetagger-platforms/src/beatsource.rs index 43fd1b9a..b21df5f1 100644 --- a/crates/onetagger-platforms/src/beatsource.rs +++ b/crates/onetagger-platforms/src/beatsource.rs @@ -118,7 +118,7 @@ impl BeatsourceTrack { catalog_number: Some(self.catalog_number), track_id: Some(self.id.to_string()), release_id: self.release.id.to_string(), - duration: self.length_ms.map(|ms| Duration::from_millis(ms)).unwrap_or(Duration::ZERO), + duration: self.length_ms.map(|ms| Duration::from_millis(ms)).unwrap_or(Duration::ZERO).into(), remixers: self.remixers.into_iter().map(|r| r.name).collect(), release_date: NaiveDate::parse_from_str(&self.publish_date, "%Y-%m-%d").ok(), isrc: self.isrc, @@ -223,6 +223,7 @@ impl BeatsourceTokenManager { } } +#[derive(Debug, Clone)] pub struct BeatsourceBuilder { token_manager: BeatsourceTokenManager } diff --git a/crates/onetagger-platforms/src/bpmsupreme.rs b/crates/onetagger-platforms/src/bpmsupreme.rs index 2ec67bed..fed50021 100644 --- a/crates/onetagger-platforms/src/bpmsupreme.rs +++ b/crates/onetagger-platforms/src/bpmsupreme.rs @@ -204,6 +204,7 @@ impl BPMMusicLibrary { } } +#[derive(Debug, Clone)] pub struct BPMSupremeBuilder { token: Option, library: BPMMusicLibrary diff --git a/crates/onetagger-platforms/src/deezer.rs b/crates/onetagger-platforms/src/deezer.rs index 2485908e..8067de22 100644 --- a/crates/onetagger-platforms/src/deezer.rs +++ b/crates/onetagger-platforms/src/deezer.rs @@ -175,7 +175,7 @@ impl Into for DeezerTrack { catalog_number: Some(self.id.to_string()), track_id: Some(self.id.to_string()), release_id: self.album.id.to_string(), - duration: Duration::from_secs(self.duration as u64), + duration: Duration::from_secs(self.duration as u64).into(), explicit: self.explicit_lyrics.or(self.explicit_content_lyrics.map(|i| i == 1)), thumbnail: Some(Deezer::image_url("cover", &self.album.md5_image, 150)), art: Some(self.album.md5_image), @@ -261,6 +261,7 @@ pub struct DeezerGenres { pub data: Vec } +#[derive(Debug, Clone)] pub struct DeezerBuilder; impl AutotaggerSourceBuilder for DeezerBuilder { diff --git a/crates/onetagger-platforms/src/discogs.rs b/crates/onetagger-platforms/src/discogs.rs index 6105ce92..fd1acba8 100644 --- a/crates/onetagger-platforms/src/discogs.rs +++ b/crates/onetagger-platforms/src/discogs.rs @@ -432,7 +432,7 @@ impl ReleaseMaster { catalog_number, track_id: None, release_id: self.id.to_string(), - duration: MatchingUtils::parse_duration(&self.tracks[track_index].duration).unwrap_or(Duration::ZERO), + duration: MatchingUtils::parse_duration(&self.tracks[track_index].duration).unwrap_or(Duration::ZERO).into(), track_number: Some(track_number), disc_number, track_total: Some(self.tracks.len() as u16), @@ -443,6 +443,7 @@ impl ReleaseMaster { } } +#[derive(Debug, Clone)] pub struct DiscogsBuilder {} impl AutotaggerSourceBuilder for DiscogsBuilder { diff --git a/crates/onetagger-platforms/src/itunes.rs b/crates/onetagger-platforms/src/itunes.rs index 92127b50..652cb5fa 100644 --- a/crates/onetagger-platforms/src/itunes.rs +++ b/crates/onetagger-platforms/src/itunes.rs @@ -119,7 +119,7 @@ impl SearchResult { url: track_view_url.to_string(), track_id: Some(track_id.to_string()), release_id: collection_id.map(|c| c.to_string()).unwrap_or_default(), - duration: track_time_millis.map(|d| Duration::from_millis(d)).unwrap_or(Duration::ZERO), + duration: track_time_millis.map(|d| Duration::from_millis(d)).unwrap_or(Duration::ZERO).into(), genres: vec![primary_genre_name.to_string()], release_date: release_date.as_ref().map(|release_date| NaiveDate::parse_from_str(&release_date[0..10], "%Y-%m-%d").ok()).flatten(), track_number: track_number.map(|t| t.into()), @@ -142,6 +142,7 @@ pub enum TrackKind { Other } +#[derive(Debug, Clone)] pub struct ITunesBuilder; impl AutotaggerSourceBuilder for ITunesBuilder { diff --git a/crates/onetagger-platforms/src/junodownload.rs b/crates/onetagger-platforms/src/junodownload.rs index ff6cab20..69dad3ac 100644 --- a/crates/onetagger-platforms/src/junodownload.rs +++ b/crates/onetagger-platforms/src/junodownload.rs @@ -155,7 +155,7 @@ impl JunoDownload { catalog_number: catalog_number.clone(), other: vec![], release_id: release_id.clone(), - duration, + duration: duration.into(), track_number: Some(TrackNumber::Number((track_index + 1) as i32)), track_total: Some(track_total), thumbnail: Some(album_art_small.to_string()), @@ -186,6 +186,7 @@ impl AutotaggerSource for JunoDownload { } +#[derive(Debug, Clone)] pub struct JunoDownloadBuilder; impl AutotaggerSourceBuilder for JunoDownloadBuilder { diff --git a/crates/onetagger-platforms/src/musicbrainz.rs b/crates/onetagger-platforms/src/musicbrainz.rs index f6627cea..cb13c901 100644 --- a/crates/onetagger-platforms/src/musicbrainz.rs +++ b/crates/onetagger-platforms/src/musicbrainz.rs @@ -164,7 +164,7 @@ impl Into for Recording { url: format!("https://musicbrainz.org/recording/{}", self.id), track_id: Some(self.id), release_id: release.map(|r| r.id.to_string()).unwrap_or(String::new()), - duration: self.length.map(|l| Duration::from_millis(l)).unwrap_or(Duration::ZERO), + duration: self.length.map(|l| Duration::from_millis(l)).unwrap_or(Duration::ZERO).into(), release_year: self.first_release_date.clone().map(|d| (d.len() >= 4).then(|| d[0..4].parse().ok()).flatten()).flatten(), release_date: self.first_release_date.map(|d| NaiveDate::parse_from_str(&d, "%Y-%m-%d").ok()).flatten(), isrc: self.isrcs.map(|v| v.first().map(String::from)).flatten(), @@ -278,6 +278,7 @@ pub struct BrowseReleases { pub releases: Vec } +#[derive(Debug, Clone)] pub struct MusicBrainzBuilder; impl AutotaggerSourceBuilder for MusicBrainzBuilder { diff --git a/crates/onetagger-platforms/src/musixmatch.rs b/crates/onetagger-platforms/src/musixmatch.rs index c620ea20..b200dc4d 100644 --- a/crates/onetagger-platforms/src/musixmatch.rs +++ b/crates/onetagger-platforms/src/musixmatch.rs @@ -9,7 +9,7 @@ use serde::de::DeserializeOwned; use serde_json::Value; use onetagger_tagger::{AutotaggerSource, AudioFileInfo, TaggerConfig, Track, Lyrics, LyricsLine, LyricsLinePart, AutotaggerSourceBuilder, PlatformInfo, PlatformCustomOptions, supported_tags, TrackMatch}; -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct Musixmatch { client: Client, token: Arc>> @@ -272,12 +272,12 @@ pub struct RichsyncLine { impl Into for RichsyncLine { fn into(self) -> LyricsLine { LyricsLine { - start: Some(Duration::from_secs_f32(self.ts)), - end: Some(Duration::from_secs_f32(self.ts)), + start: Some(Duration::from_secs_f32(self.ts).into()), + end: Some(Duration::from_secs_f32(self.ts).into()), text: self.x, parts: self.l.into_iter().map(|p| LyricsLinePart { text: p.c, - start: Some(Duration::from_secs_f32(self.ts + p.o)), + start: Some(Duration::from_secs_f32(self.ts + p.o).into()), end: None, }).collect() } @@ -300,11 +300,12 @@ pub struct SubtitleLine { impl Into for SubtitleLine { fn into(self) -> LyricsLine { - LyricsLine { text: self.line, start: Some(self.timestamp), end: None, parts: vec![] } + LyricsLine { text: self.line, start: Some(self.timestamp.into()), end: None, parts: vec![] } } } /// 1T source builder +#[derive(Debug, Clone)] pub struct MusixmatchBuilder { mxm: Musixmatch } diff --git a/crates/onetagger-platforms/src/spotify.rs b/crates/onetagger-platforms/src/spotify.rs index 4fe93261..16c5a8f1 100644 --- a/crates/onetagger-platforms/src/spotify.rs +++ b/crates/onetagger-platforms/src/spotify.rs @@ -255,7 +255,7 @@ fn full_track_to_track(track: FullTrack) -> Track { url: format!("https://open.spotify.com/track/{}", track.id.as_ref().map(|i| i.id()).unwrap_or("")), track_id: track.id.map(|i| i.id().to_string()), release_id: track.album.id.map(|i| i.id().to_string()).unwrap_or(String::new()), - duration: track.duration.to_std().unwrap(), + duration: track.duration.to_std().unwrap().into(), track_number: Some(TrackNumber::Number(track.track_number as i32)), isrc: track.external_ids.into_iter().find(|(k, _)| k == "isrc").map(|(_, v)| v.to_string()), release_year: track.album.release_date.map(|d| if d.len() > 4 { d[0..4].to_string().parse().ok() } else { None }).flatten(), @@ -266,6 +266,7 @@ fn full_track_to_track(track: FullTrack) -> Track { } /// For creating instance of Spotify AT plugin +#[derive(Debug, Clone)] pub struct SpotifyBuilder; impl AutotaggerSourceBuilder for SpotifyBuilder { diff --git a/crates/onetagger-platforms/src/traxsource.rs b/crates/onetagger-platforms/src/traxsource.rs index 83259f35..cbec909b 100644 --- a/crates/onetagger-platforms/src/traxsource.rs +++ b/crates/onetagger-platforms/src/traxsource.rs @@ -108,7 +108,7 @@ impl Traxsource { other: vec![], track_id: Some(track_id), release_id: String::new(), - duration, + duration: duration.into(), ..Default::default() }) } @@ -207,6 +207,7 @@ impl AutotaggerSource for Traxsource { } +#[derive(Debug, Clone)] pub struct TraxsourceBuilder; impl AutotaggerSourceBuilder for TraxsourceBuilder { diff --git a/crates/onetagger-python-builder/Cargo.toml b/crates/onetagger-python-builder/Cargo.toml new file mode 100644 index 00000000..214fd5a4 --- /dev/null +++ b/crates/onetagger-python-builder/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "onetagger-python-builder" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +zip = "0.6" +ureq = "2.7" +regex = "1.9" +anyhow = "1.0" +walkdir = "2.3" +pyoxidizer = "0.24" \ No newline at end of file diff --git a/crates/onetagger-python-builder/build.rs b/crates/onetagger-python-builder/build.rs new file mode 100644 index 00000000..44266dce --- /dev/null +++ b/crates/onetagger-python-builder/build.rs @@ -0,0 +1,3 @@ +fn main() { + println!("cargo:rustc-env=TARGET={}", std::env::var("TARGET").unwrap()); +} \ No newline at end of file diff --git a/crates/onetagger-python-builder/src/main.rs b/crates/onetagger-python-builder/src/main.rs new file mode 100644 index 00000000..bce2a611 --- /dev/null +++ b/crates/onetagger-python-builder/src/main.rs @@ -0,0 +1,80 @@ +use std::path::Path; +use std::io::{BufWriter, BufReader}; +use std::fs::File; +use anyhow::Error; +use regex::Regex; +use walkdir::WalkDir; +use zip::{ZipWriter, CompressionMethod}; +use zip::write::FileOptions; + +const PYTHON_VERSION: &'static str = "3.10"; + +fn main() { + setup_all("crates/onetagger-python/pyembedded").expect("Failed"); + println!("Done"); +} + +/// Do all setups +fn setup_all(out_dir: impl AsRef) -> Result<(), Error> { + // Create outdir + if !out_dir.as_ref().exists() { + std::fs::create_dir_all(&out_dir)?; + } + + // Pyoxidizer + println!("Setting up pyoxidizer..."); + setup_pyoxidizer(&out_dir, PYTHON_VERSION)?; + println!("Zipping stdlib..."); + zip_stdlib(out_dir.as_ref().join("stdlib"), out_dir.as_ref().join("stdlib.zip"))?; + + // Patch & copy config + println!("Copy config..."); + let re = Regex::new("packed_resources: .*").unwrap(); + let config = std::fs::read_to_string(out_dir.as_ref().join("default_python_config.rs"))?; + let config = re.replace(&config, "packed_resources: vec![],\n"); + std::fs::write(out_dir.as_ref().join("config.rs"), config.as_bytes())?; + + // Write python version + println!("Write version..."); + std::fs::write(out_dir.as_ref().join("VERSION"), PYTHON_VERSION)?; + + // Download pip + println!("Downloading pip..."); + std::io::copy( + &mut ureq::get("https://bootstrap.pypa.io/pip/pip.pyz").call()?.into_reader(), + &mut BufWriter::new(File::create(out_dir.as_ref().join("pip.pyz"))?) + )?; + + // Clean + println!("Cleanup..."); + std::fs::remove_dir_all(out_dir.as_ref().join("stdlib"))?; + std::fs::remove_dir_all(out_dir.as_ref().join("tcl"))?; + std::fs::remove_file(out_dir.as_ref().join("default_python_config.rs"))?; + + Ok(()) +} + +/// Setup python embedding +fn setup_pyoxidizer(path: impl AsRef, version: &str) -> Result<(), Error> { + pyoxidizerlib::projectmgmt::generate_python_embedding_artifacts( + &pyoxidizerlib::environment::Environment::new()?, + env!("TARGET"), + "standalone", + Some(version), + path.as_ref() + )?; + Ok(()) +} + +/// Zip python stdlib +fn zip_stdlib(path: impl AsRef, out: impl AsRef) -> Result<(), Error> { + let prefix = path.as_ref().canonicalize()?; + let mut zip = ZipWriter::new(BufWriter::new(File::create(&out)?)); + for entry in WalkDir::new(&path).into_iter().filter_map(|e| e.ok()).filter(|e| e.path().is_file()) { + let name = entry.path().canonicalize()?.strip_prefix(&prefix)?.to_owned(); + zip.start_file(name.to_string_lossy(), FileOptions::default().compression_method(CompressionMethod::Deflated).compression_level(Some(9)))?; + std::io::copy(&mut BufReader::new(File::open(entry.path())?), &mut zip)?; + } + zip.finish()?; + Ok(()) +} \ No newline at end of file diff --git a/crates/onetagger-python/Cargo.toml b/crates/onetagger-python/Cargo.toml new file mode 100644 index 00000000..b845f806 --- /dev/null +++ b/crates/onetagger-python/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "onetagger-python" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +dunce = "1.0" +chrono = "0.4" +anyhow = "1.0" +serde_json = "1.0" + +log = { version = "0.4", features = ["serde"] } +pyo3 = { version = "0.18", features = ["chrono", "serde"] } +serde = { version = "1.0", features = ["derive"] } +bitcode = { version = "0.4", features = ["serde"] } +pyembed = { git = "https://github.com/indygreg/PyOxidizer.git" } + +onetagger-tagger = { path = "../onetagger-tagger", features = ["python"] } +onetagger-shared = { path = "../onetagger-shared" } \ No newline at end of file diff --git a/crates/onetagger-python/build.rs b/crates/onetagger-python/build.rs new file mode 100644 index 00000000..6a1859c8 --- /dev/null +++ b/crates/onetagger-python/build.rs @@ -0,0 +1,5 @@ +fn main() { + //! Important, fixes python modules + println!("cargo:rustc-link-arg=-Wl,-export-dynamic"); +} + diff --git a/crates/onetagger-python/src/lib.rs b/crates/onetagger-python/src/lib.rs new file mode 100644 index 00000000..200a9d44 --- /dev/null +++ b/crates/onetagger-python/src/lib.rs @@ -0,0 +1,169 @@ +#[macro_use] extern crate log; +#[macro_use] extern crate anyhow; + +use std::path::{Path, PathBuf}; +use std::io::BufReader; +use std::fs::File; +use std::process::{Command, Stdio}; +use anyhow::Error; +use onetagger_shared::Settings; +use onetagger_tagger::{PlatformInfo, AutotaggerSourceBuilder, TaggerConfig, AutotaggerSource, AudioFileInfo, Track, TrackMatch}; +use pyembed::{MainPythonInterpreter, OxidizedPythonInterpreterConfig}; +use serde::{Serialize, Deserialize}; +use subprocess::{SubprocessWrap, PythonResponse, PythonRequest}; + +mod module; +mod subprocess; + +/// Re-Export python process +pub use subprocess::python_process; + +/// Python Standard Library ZIP +const PYTHON_STDLIB: &[u8] = include_bytes!("../pyembedded/stdlib.zip"); +const PYTHON_VERSION: &'static str = include_str!("../pyembedded/VERSION"); +const PIP_PYZ: &[u8] = include_bytes!("../pyembedded/pip.pyz"); + +/// Setup Python +pub fn setup() -> Result<(), Error> { + let dir = Settings::get_folder()?; + + // Check python version + let version_file = dir.join("PYTHON_VERSION"); + let version = match version_file.exists() { + true => { + std::fs::read_to_string(&version_file)? + }, + false => { + std::fs::write(version_file, PYTHON_VERSION)?; + String::new() + } + }; + // Write stdlib & pip + if version != PYTHON_VERSION { + info!("Writing python stdlib for {}", PYTHON_VERSION); + std::fs::write(dir.join("python_stdlib.zip"), PYTHON_STDLIB)?; + std::fs::write(dir.join("pip.pyz"), PIP_PYZ)?; + } + + Ok(()) +} + +/// Get standard library path +fn stdlib_path() -> Result { + Ok(dunce::canonicalize(Settings::get_folder()?.join("python_stdlib.zip"))?) +} + + +/// pip install packages +fn pip_install(mut config: OxidizedPythonInterpreterConfig, requirements: &[String]) -> Result<(), Error> { + let pip_path = dunce::canonicalize(Settings::get_folder()?.join("pip.pyz"))?; + // Params + config.interpreter_config.run_filename = Some(pip_path.clone()); + config.interpreter_config.argv = Some(vec![ + "pip.pyz".into(), + "pip.pyz".into(), + "install".into(), + "pip".into(), + "setuptools".into(), + "wheel".into() + ]); + config.interpreter_config.argv.as_mut().unwrap().extend(requirements.iter().map(|r| r.into())); + + // Run + let interpreter = MainPythonInterpreter::new(config)?; + let r = interpreter.py_runmain(); + if r != 0 { + return Err(anyhow!("pip install failed with code: {r}")); + } + Ok(()) +} + +/// Platform info for Python +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct PythonPlatformInfo { + /// Python requirements + pub requirements: Vec, + + /// Main python file + pub main: String, + + #[serde(flatten)] + pub info: PlatformInfo, +} + +/// Load python platform from path +pub fn load_python_platform(path: impl AsRef) -> Result { + let info: PythonPlatformInfo = serde_json::from_reader(BufReader::new(File::open(path.as_ref().join("info.json"))?))?; + // Create python dir + std::fs::create_dir_all(path.as_ref().join(".python"))?; + Ok(PythonPlatformBuilder { info, path: dunce::canonicalize(path)? }) +} + +pub struct PythonPlatformBuilder { + pub info: PythonPlatformInfo, + path: PathBuf +} + +impl AutotaggerSourceBuilder for PythonPlatformBuilder { + fn new() -> Self where Self: Sized { + panic!("Not used / Python platforms should be loaded externally"); + } + + fn get_source(&mut self, _config: &TaggerConfig) -> Result, Error> { + // Install packages + let config = module::pyoxidizer_config(&self.path.join(".python"), stdlib_path()?)?; + info!("Running pip install {:?}", self.info.requirements); + pip_install(config.clone(), &self.info.requirements)?; + + // Load code + let code = std::fs::read_to_string(self.path.join(&self.info.main))?; + + // Spawn subprocess + let child = Command::new(std::env::current_exe()?) + .stdout(Stdio::piped()) + .stdin(Stdio::piped()) + .stderr(Stdio::inherit()) + .arg("--python-subprocess") + .spawn()?; + let mut wrap = SubprocessWrap::new(child); + debug!("Pre init"); + wrap.send(&PythonRequest::Init { path: self.path.join(".python"), code })?; + debug!("Post init"); + // Receive init ok or error + wrap.recv()?; + debug!("init ok"); + + Ok(Box::new(PythonPlatform { subprocess: wrap })) + } + + fn info(&self) -> PlatformInfo { + // Cap thread count + let mut info = self.info.info.clone(); + info.max_threads = 1; + info + } +} + +pub struct PythonPlatform { + subprocess: SubprocessWrap +} + +impl AutotaggerSource for PythonPlatform { + fn match_track(&mut self, info: &AudioFileInfo, config: &TaggerConfig) -> Result, Error> { + debug!("Pre match"); + self.subprocess.send(&PythonRequest::MatchTrack { info: info.clone(), config: config.clone() })?; + debug!("Post match"); + if let PythonResponse::MatchTrack { result } = self.subprocess.recv()? { + return result.map_err(|e| anyhow!("{e}")); + } + unreachable!() + } + + fn extend_track(&mut self, track: &mut Track, config: &TaggerConfig) -> Result<(), Error> { + self.subprocess.send(&PythonRequest::ExtendTrack { track: track.to_owned(), config: config.clone() })?; + if let PythonResponse::ExtendTrack { result } = self.subprocess.recv()? { + *track = result.map_err(|e| anyhow!("{e}"))?; + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/onetagger-python/src/module.rs b/crates/onetagger-python/src/module.rs new file mode 100644 index 00000000..d0fe8bae --- /dev/null +++ b/crates/onetagger-python/src/module.rs @@ -0,0 +1,75 @@ +use std::path::Path; +use anyhow::Error; +use onetagger_tagger::{Track, AudioFileInfo, TaggerConfig, SpotifyConfig, MultipleMatchesSort, + TrackMatch, MatchReason, StylesOptions, FileTaggedStatus, SupportedTag, TagSeparators, + AudioFileFormat, FrameName, Lyrics, LyricsLine, LyricsLinePart}; +use pyembed::OxidizedPythonInterpreterConfig; +use pyo3::prelude::*; + +/// Get pyoxidizer config +pub fn pyoxidizer_config<'a>(dir: impl AsRef, stdlib: impl AsRef) -> Result, Error> { + mod pyoxidizer_config { + include!("../pyembedded/config.rs"); + } + let mut config = pyoxidizer_config::default_python_config(); + + config.interpreter_config.filesystem_encoding = Some("utf-8".to_string()); + config.tcl_library = None; + config.packed_resources = vec![]; + config.filesystem_importer = true; + config.oxidized_importer = false; + config.interpreter_config.isolated = Some(true); + config.interpreter_config.use_environment = Some(false); + config.interpreter_config.home = Some(dunce::canonicalize(dir)?); + config.interpreter_config.module_search_paths = Some(vec![dunce::canonicalize(stdlib)?]); + config.interpreter_config.run_filename = None; + config.interpreter_config.argv = Some(vec![]); + + Ok(config) +} + +/// Register modules +pub fn setup() { + pyo3::append_to_inittab!(onetagger); +} + +/// 1t Python Module +#[pymodule] +fn onetagger(_py: Python<'_>, module: &PyModule) -> PyResult<()> { + #[pyfn(module)] + fn info(s: &str) { + info!("{s}"); + } + #[pyfn(module)] + fn warn(s: &str) { + warn!("{s}"); + } + #[pyfn(module)] + fn error(s: &str) { + error!("{s}"); + } + #[pyfn(module)] + fn debug(s: &str) { + debug!("{s}"); + } + + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + module.add_class::()?; + + Ok(()) +} + diff --git a/crates/onetagger-python/src/subprocess.rs b/crates/onetagger-python/src/subprocess.rs new file mode 100644 index 00000000..7350e23a --- /dev/null +++ b/crates/onetagger-python/src/subprocess.rs @@ -0,0 +1,204 @@ +use std::io::{Read, Write, BufReader, BufRead}; +use std::path::PathBuf; +use std::process::{ChildStdin, ChildStdout, Child}; +use anyhow::Error; +use log::{Record, Metadata, Log, LevelFilter, Level}; +use onetagger_tagger::{AudioFileInfo, TaggerConfig, Track, TrackMatch}; +use pyembed::MainPythonInterpreter; +use pyo3::types::PyTuple; +use serde::{Serialize, Deserialize}; +use serde::de::DeserializeOwned; +use pyo3::prelude::*; + +use crate::stdlib_path; + +static PYTHON_SUBPROCESS_LOG: PythonSubprocessLog = PythonSubprocessLog; + +/// Request sent from parent process +#[derive(Debug, Clone, Serialize, Deserialize)] +pub enum PythonRequest { + /// Initialize the python interpreter + Init { path: PathBuf, code: String }, + + /// Exit + Exit, + + MatchTrack { info: AudioFileInfo, config: TaggerConfig }, + ExtendTrack { track: Track, config: TaggerConfig }, +} + +/// Response from child process +#[derive(Debug, Clone, Serialize, Deserialize)] +pub enum PythonResponse { + Log { level: Level, message: String }, + Error { error: String }, + InitOk, + + MatchTrack { result: Result, String> }, + ExtendTrack { result: Result } +} + +/// Start python process +pub fn python_process() { + // Logging + log::set_logger(&PYTHON_SUBPROCESS_LOG) + .map(|()| log::set_max_level(LevelFilter::Debug)) + .ok(); + + // Wait for init path + let (path, code) = loop { + match read_stdin() { + Ok(PythonRequest::Init { path, code }) => break (path, code), + Ok(PythonRequest::Exit) => return, + Err(e) => { error!("{e}"); return }, + _ => {} + } + }; + + // Respond + write_stdout(&PythonResponse::InitOk).ok(); + + // Run interpreter + match python_interpreter(path, &code) { + Ok(_) => {}, + Err(e) => { + error!("Python failed: {e}"); + write_stdout(&PythonResponse::Error { error: e.to_string() }).ok(); + }, + } +} + +/// Start and run python interpreter +fn python_interpreter(path: PathBuf, code: &str) -> Result<(), Error> { + crate::module::setup(); + let config = crate::module::pyoxidizer_config(path, stdlib_path()?)?; + let interpreter = MainPythonInterpreter::new(config)?; + interpreter.with_gil(|py| -> Result<(), Error> { + // Load utils + let _util = PyModule::from_code(py, include_str!("util.py"), "", "")?; + + // Load module + let module = PyModule::from_code(py, code, "", "")?; + let match_track = module.getattr("match_track")?; + let extend_track = module.getattr("extend_track")?; + + + + // Read loop + while let Ok(request) = read_stdin() { + match request { + // Ignore + PythonRequest::Init { .. } => {}, + PythonRequest::Exit => return Ok(()), + + PythonRequest::MatchTrack { info, config } => { + write_stdout(&PythonResponse::MatchTrack { + result: call_py::<(AudioFileInfo, TaggerConfig), Vec>(match_track, (info, config)).map_err(|e| e.to_string()) + })?; + }, + PythonRequest::ExtendTrack { track, config } => { + write_stdout(&PythonResponse::ExtendTrack { + result: call_py::<(Track, TaggerConfig), Track>(extend_track, (track, config)).map_err(|e| e.to_string()) + })?; + }, + } + } + Ok(()) + })?; + Ok(()) +} + +/// Call python function and extract result +fn call_py<'a, A, R: FromPyObject<'a>>(f: &'a PyAny, a: impl IntoPy>) -> Result { + Ok(f.call1(a)?.extract()?) +} + +pub struct SubprocessWrap { + stdin: ChildStdin, + stdout: ChildStdout, + pub child: Child +} + +impl SubprocessWrap { + /// Wrap a subprocess + pub fn new(mut child: Child) -> SubprocessWrap { + Self { stdin: child.stdin.take().unwrap(), stdout: child.stdout.take().unwrap(), child } + } + + /// Send message + pub fn send(&mut self, r: &PythonRequest) -> Result<(), Error> { + write_message(&mut self.stdin, r)?; + Ok(()) + } + + /// Receive message + pub fn recv(&mut self) -> Result { + loop { + let response: PythonResponse = read_message(&mut self.stdout)?; + debug!("{response:?}"); + match response { + PythonResponse::Log { level, message } => { + match level { + Level::Error => error!("{message}"), + Level::Warn => warn!("{message}"), + Level::Info => info!("{message}"), + Level::Debug => debug!("{message}"), + Level::Trace => trace!("{message}"), + } + }, + PythonResponse::Error { error } => return Err(anyhow!("{error}")), + r => return Ok(r) + } + } + } +} + +/// Read and deserialize message +fn read_message(read: &mut R) -> Result { + let mut size_buf = [0u8; 4]; + read.read_exact(&mut size_buf)?; + debug!("len: {:?}", size_buf); + let size = u32::from_be_bytes(size_buf) as usize; + let mut buf = vec![0u8; size]; + read.read_exact(&mut buf)?; + Ok(bitcode::deserialize(&buf)?) +} + +/// Read from stdin +fn read_stdin() -> Result { + let mut stdin = std::io::stdin().lock(); + Ok(read_message(&mut stdin)?) +} + +/// Serialize and write message +fn write_message(write: &mut W, msg: &S) -> Result<(), Error> { + let buf = bitcode::serialize(msg)?; + let len = (buf.len() as u32).to_be_bytes(); + write.write_all(&len)?; + write.write_all(&buf)?; + write.flush()?; + Ok(()) +} + +/// Write message to stdout +fn write_stdout(msg: &PythonResponse) -> Result<(), Error> { + let mut stdout = std::io::stdout().lock(); + write_message(&mut stdout, msg)?; + Ok(()) +} + +struct PythonSubprocessLog; + +impl Log for PythonSubprocessLog { + fn enabled(&self, _metadata: &Metadata) -> bool { + true + } + + fn log(&self, record: &Record) { + write_stdout(&PythonResponse::Log { level: record.level(), message: format!("{}", record.args()) }).ok(); + } + + fn flush(&self) { + + } +} \ No newline at end of file diff --git a/crates/onetagger-python/src/util.py b/crates/onetagger-python/src/util.py new file mode 100644 index 00000000..e89f7b61 --- /dev/null +++ b/crates/onetagger-python/src/util.py @@ -0,0 +1,21 @@ +import io +import sys +import onetagger + +# stdout -> log +class OneTaggerInfoLog(io.TextIOBase): + def __init__(self): + pass + def write(self, v): + if v.strip() != '': + onetagger.info(v) +sys.stdout = OneTaggerInfoLog() + +# stderr -> log +class OneTaggerErrorLog(io.TextIOBase): + def __init__(self): + pass + def write(self, v): + if v.strip() != '': + onetagger.error(v) +sys.stderr = OneTaggerInfoLog() diff --git a/crates/onetagger-shared/src/lib.rs b/crates/onetagger-shared/src/lib.rs index 9ebc6595..55223585 100644 --- a/crates/onetagger-shared/src/lib.rs +++ b/crates/onetagger-shared/src/lib.rs @@ -41,6 +41,7 @@ pub fn setup() { Dispatch::new() .level(LevelFilter::Warn) + .level_for("onetagger_python", level) .level_for("onetagger_shared", level) .level_for("onetagger_autotag", level) .level_for("onetagger_platforms", level) diff --git a/crates/onetagger-tag/Cargo.toml b/crates/onetagger-tag/Cargo.toml index a1224df2..9dcc0f9c 100644 --- a/crates/onetagger-tag/Cargo.toml +++ b/crates/onetagger-tag/Cargo.toml @@ -18,8 +18,10 @@ mp4ameta = { version = "0.11", optional = true } metaflac = { version = "0.2.5", optional = true } once_cell = { version = "1.17", optional = true } +pyo3 = { version = "0.18", features = ["chrono", "serde"], optional = true } serde = { version = "1.0", features = ["derive"] } [features] default = ["tag"] +python = ["pyo3"] tag = ["id3", "mp4ameta", "metaflac", "base64", "log", "riff", "lofty", "once_cell"] \ No newline at end of file diff --git a/crates/onetagger-tag/src/lib.rs b/crates/onetagger-tag/src/lib.rs index 127e86e5..55d38ca6 100644 --- a/crates/onetagger-tag/src/lib.rs +++ b/crates/onetagger-tag/src/lib.rs @@ -5,6 +5,7 @@ #[macro_use] extern crate anyhow; use serde::{Serialize, Deserialize}; +use std::ops::{Deref, DerefMut}; use std::path::PathBuf; use std::time::Duration; use anyhow::Error; @@ -25,6 +26,9 @@ pub mod vorbis; #[cfg(feature = "tag")] mod wav; +#[cfg(feature = "python")] +use pyo3::prelude::*; + // Supported extensions pub static EXTENSIONS : [&'static str; 11] = ["mp3", "flac", "aif", "aiff", "m4a", "mp4", "wav", "ogg", "opus", "spx", "oga"]; @@ -157,6 +161,7 @@ pub trait TagImpl { } #[derive(Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] pub struct TagSeparators { pub id3: String, pub vorbis: Option, @@ -175,6 +180,7 @@ impl Default for TagSeparators { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] pub enum AudioFileFormat { FLAC, AIFF, MP3, MP4, WAV, OGG } @@ -196,6 +202,7 @@ impl AudioFileFormat { /// Tag fields from UI #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] #[serde(rename_all = "camelCase")] #[repr(C)] pub struct FrameName { @@ -505,6 +512,7 @@ impl TagChanges { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] #[serde(rename_all = "camelCase")] #[repr(C)] pub struct Lyrics { @@ -551,21 +559,68 @@ impl Lyrics { } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] #[serde(rename_all = "camelCase")] #[repr(C)] pub struct LyricsLine { pub text: String, - pub start: Option, - pub end: Option, + pub start: Option, + pub end: Option, /// Optional pub parts: Vec } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] #[serde(rename_all = "camelCase")] #[repr(C)] pub struct LyricsLinePart { pub text: String, - pub start: Option, - pub end: Option + pub start: Option, + pub end: Option +} + +/// Duration which can be used in Python as well +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, Default)] +#[repr(transparent)] +pub struct OTDuration(pub Duration); + +impl Deref for OTDuration { + type Target = Duration; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl DerefMut for OTDuration { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +impl Into for OTDuration { + fn into(self) -> Duration { + self.0 + } +} + +impl From for OTDuration { + fn from(value: Duration) -> Self { + Self(value) + } +} + +#[cfg(feature = "python")] +impl IntoPy for OTDuration { + fn into_py(self, py: Python<'_>) -> PyObject { + self.0.as_secs_f64().to_object(py) + } +} + +#[cfg(feature = "python")] +impl<'a> FromPyObject<'a> for OTDuration { + fn extract(ob: &'a PyAny) -> PyResult { + Ok(OTDuration(Duration::from_secs_f64(ob.extract()?))) + } } \ No newline at end of file diff --git a/crates/onetagger-tagger/Cargo.toml b/crates/onetagger-tagger/Cargo.toml index 64b2b961..529786e0 100644 --- a/crates/onetagger-tagger/Cargo.toml +++ b/crates/onetagger-tagger/Cargo.toml @@ -14,6 +14,11 @@ strsim = "0.10" unidecode = "0.3" serde_json = "1.0" +pyo3 = { version = "0.18", features = ["chrono", "serde"], optional = true } serde = { version = "1.0", features = ["derive"] } -onetagger-tag = { path = "../onetagger-tag", default-features = false } \ No newline at end of file +onetagger-tag = { path = "../onetagger-tag", default-features = false } + +[features] +default = [] +python = ["pyo3", "onetagger-tag/python"] \ No newline at end of file diff --git a/crates/onetagger-tagger/src/custom.rs b/crates/onetagger-tagger/src/custom.rs index a1ff6544..ddd4abab 100644 --- a/crates/onetagger-tagger/src/custom.rs +++ b/crates/onetagger-tagger/src/custom.rs @@ -4,7 +4,7 @@ use log::{Record, Level, RecordBuilder}; use crate::TrackMatch; /// Version of supported custom platform -pub const CUSTOM_PLATFORM_COMPATIBILITY: i32 = 39; +pub const CUSTOM_PLATFORM_COMPATIBILITY: i32 = 40; /// Logging from plugins #[no_mangle] diff --git a/crates/onetagger-tagger/src/lib.rs b/crates/onetagger-tagger/src/lib.rs index 77a39151..ba40df40 100644 --- a/crates/onetagger-tagger/src/lib.rs +++ b/crates/onetagger-tagger/src/lib.rs @@ -5,6 +5,7 @@ use anyhow::Error; use std::collections::HashMap; use std::any::Any; use std::cmp::Ordering; +use std::ops::Deref; use std::path::PathBuf; use std::time::Duration; use chrono::NaiveDate; @@ -15,6 +16,9 @@ use serde_json::Value; use strsim::normalized_levenshtein; use unidecode::unidecode; +#[cfg(feature = "python")] +use pyo3::prelude::*; + pub mod custom; const ATTRIBUTES_TO_REMOVE: [&'static str; 23] = ["(intro)", "(clean)", "(intro clean)", "(dirty)", "(intro dirty)", "(clean extended)", @@ -22,9 +26,10 @@ const ATTRIBUTES_TO_REMOVE: [&'static str; 23] = ["(intro)", "(clean)", "(intro "(radio edit)", "(ck cut)", "(super cut)", "(mega cutz)", "(snip hitz)", "(jd live cut)", "(djcity intro)", "(vdj jd edit)"]; // Re-export -pub use onetagger_tag::{TagSeparators, FrameName, AudioFileFormat, Field, Lyrics, LyricsLine, LyricsLinePart}; +pub use onetagger_tag::{TagSeparators, FrameName, AudioFileFormat, Field, Lyrics, LyricsLine, LyricsLinePart, OTDuration}; #[derive(Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] #[serde(rename_all = "camelCase")] pub struct TaggerConfig { // Global @@ -82,7 +87,7 @@ pub struct TaggerConfig { pub fetch_all_results: bool, /// Platform specific. Format: `{ platform: { custom_option: value }}` - pub custom: HashMap, + pub custom: PlatformTaggerConfig, pub spotify: Option, } @@ -143,7 +148,7 @@ impl Default for TaggerConfig { post_command: None, styles_custom_tag: Some(FrameName::same("STYLE")), spotify: None, - custom: HashMap::new(), + custom: Default::default(), include_subfolders: true, track_number_leading_zeroes: 0, enable_shazam: false, @@ -163,7 +168,48 @@ impl Default for TaggerConfig { } } +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[repr(transparent)] +pub struct PlatformTaggerConfig(pub HashMap); + +impl Deref for PlatformTaggerConfig { + type Target = HashMap; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl From> for PlatformTaggerConfig { + fn from(value: HashMap) -> Self { + Self(value) + } +} + +impl Into> for PlatformTaggerConfig { + fn into(self) -> HashMap { + self.0 + } +} + +#[cfg(feature = "python")] +impl IntoPy for PlatformTaggerConfig { + fn into_py(self, py: Python<'_>) -> PyObject { + None::<()>.into_py(py) + } +} + +#[cfg(feature = "python")] +impl<'a> FromPyObject<'a> for PlatformTaggerConfig { + fn extract(_ob: &'a PyAny) -> PyResult { + // TODO: Unimplemented + Ok(Self::default()) + } +} + + #[derive(Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] #[serde(rename_all = "camelCase")] pub struct SpotifyConfig { pub client_id: String, @@ -172,6 +218,7 @@ pub struct SpotifyConfig { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] pub enum MultipleMatchesSort { Default, Oldest, @@ -184,7 +231,19 @@ impl Default for MultipleMatchesSort { } } +impl From for MultipleMatchesSort { + fn from(value: String) -> Self { + match value.as_str() { + "default" => MultipleMatchesSort::Default, + "oldest" => MultipleMatchesSort::Oldest, + "newest" => MultipleMatchesSort::Newest, + _ => MultipleMatchesSort::Default + } + } +} + #[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] #[repr(C)] pub struct Track { /// Use platform id @@ -207,7 +266,7 @@ pub struct Track { pub other: Vec<(FrameName, Vec)>, pub track_id: Option, pub release_id: String, - pub duration: Duration, + pub duration: OTDuration, pub remixers: Vec, pub track_number: Option, pub track_total: Option, @@ -229,7 +288,14 @@ pub struct Track { pub thumbnail: Option, } +#[cfg_attr(feature = "python", pymethods)] impl Track { + #[cfg(feature = "python")] + #[new] + fn new() -> Track { + Track::default() + } + /// Get title with version pub fn full_title(&self) -> String { if let Some(v) = self.version.as_ref() { @@ -242,7 +308,9 @@ impl Track { self.title.to_string() } } +} +impl Track { /// Merge with other track pub fn merge(mut self, other: Track) -> Track { /// Merge 2 arrays @@ -274,10 +342,9 @@ impl Track { } - - /// Matched track #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] #[repr(C)] pub struct TrackMatch { pub accuracy: f64, @@ -285,6 +352,15 @@ pub struct TrackMatch { pub reason: MatchReason } +#[cfg(feature = "python")] +#[pymethods] +impl TrackMatch { + #[new] + fn new_py(track: Track, accuracy: f32, reason: Option) -> TrackMatch { + TrackMatch { accuracy: accuracy as f64, track, reason: reason.unwrap_or(MatchReason::Fuzzy) } + } +} + impl TrackMatch { /// Create new instance pub fn new(accuracy: f64, track: Track) -> TrackMatch { @@ -310,6 +386,7 @@ impl PartialOrd for TrackMatch { /// Why was this track matched #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Ord, PartialOrd)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] #[repr(C)] #[serde(rename_all = "camelCase")] pub enum MatchReason { @@ -353,8 +430,29 @@ impl ToString for TrackNumber { } } +#[cfg(feature = "python")] +impl IntoPy for TrackNumber { + fn into_py(self, py: Python<'_>) -> PyObject { + match self { + TrackNumber::Number(n) => n.to_object(py), + TrackNumber::Custom(n) => n.to_object(py), + } + } +} + +#[cfg(feature = "python")] +impl<'a> FromPyObject<'a> for TrackNumber { + fn extract(ob: &'a PyAny) -> PyResult { + match ob.extract::() { + Ok(s) => return Ok(TrackNumber::Custom(s)), + Err(_) => return Ok(TrackNumber::Number(ob.extract::()?)), + } + } +} + /// For Discogs & Beatport #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] #[serde(rename_all = "camelCase")] #[repr(C)] pub enum StylesOptions { @@ -374,6 +472,22 @@ impl Default for StylesOptions { } } +impl From for StylesOptions { + fn from(value: String) -> Self { + match value.as_str() { + "default" => StylesOptions::Default, + "onlyGenres" => StylesOptions::OnlyGenres, + "onlyStyles" => StylesOptions::OnlyStyles, + "mergeToGenres" => StylesOptions::MergeToGenres, + "mergeToStyles" => StylesOptions::MergeToStyles, + "stylesToGenre" => StylesOptions::StylesToGenre, + "genresToStyle" => StylesOptions::GenresToStyle, + "customTag" => StylesOptions::CustomTag, + _ => StylesOptions::Default + } + } +} + pub const CAMELOT_NOTES: [(&str, &str); 35] = [ ("Abm", "1A"), ("G#m", "1A"), @@ -437,7 +551,7 @@ impl LyricsExt for Lyrics { if let Some(artist) = track.artists.first() { output.push_str(&format!("[ar:{artist}]\n")); } - if track.duration != Duration::ZERO { + if *track.duration != Duration::ZERO { output.push_str(&format!("[length: {}:{:02}]\n", track.duration.as_secs() / 60, track.duration.as_secs() % 60)); } output.push('\n'); @@ -449,13 +563,13 @@ impl LyricsExt for Lyrics { if let Some(start) = line.start { // Write normal if !enhanced || line.parts.is_empty() { - output.push_str(&format!("[{}]{}\n", format_lrc_ts(start), line.text)); + output.push_str(&format!("[{}]{}\n", format_lrc_ts(*start), line.text)); } else { // Write enhanced - output.push_str(&format!("[{}]", format_lrc_ts(start))); + output.push_str(&format!("[{}]", format_lrc_ts(*start))); for part in &line.parts { if let Some(start) = part.start { - output.push_str(&format!(" <{}> {}", format_lrc_ts(start), part.text)); + output.push_str(&format!(" <{}> {}", format_lrc_ts(*start), part.text)); } else { output.push_str(&format!(" {}", part.text)); } @@ -475,7 +589,8 @@ impl LyricsExt for Lyrics { } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] #[repr(C)] pub struct AudioFileInfo { pub title: Option, @@ -483,7 +598,7 @@ pub struct AudioFileInfo { pub format: AudioFileFormat, pub path: PathBuf, pub isrc: Option, - pub duration: Option, + pub duration: Option, pub track_number: Option, pub tagged: FileTaggedStatus, pub tags: HashMap> @@ -529,7 +644,8 @@ impl AudioFileInfo { } /// If the file was already tagged with OneTagger -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Copy)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] pub enum FileTaggedStatus { /// Not tagged with 1T Untagged, @@ -601,6 +717,7 @@ pub struct PlatformInfo { /// All the different tags a platform can support #[derive(Debug, Clone, Serialize, Deserialize, Copy, PartialEq, Eq)] +#[cfg_attr(feature = "python", pyclass(set_all, get_all))] #[serde(rename_all = "camelCase")] #[repr(C)] pub enum SupportedTag { @@ -1019,7 +1136,7 @@ impl MatchingUtils { } let duration = *info.duration.as_ref().unwrap(); // No duration available - if duration == Duration::ZERO || track.duration == Duration::ZERO { + if *duration == Duration::ZERO || *track.duration == Duration::ZERO { return true; } let diff = (duration.as_secs() as i64 - track.duration.as_secs() as i64).abs() as u64; diff --git a/crates/onetagger/build.rs b/crates/onetagger/build.rs index 64964b0e..023037a9 100644 --- a/crates/onetagger/build.rs +++ b/crates/onetagger/build.rs @@ -1,4 +1,7 @@ fn main() { + // Required for Python + println!("cargo:rustc-link-arg=-Wl,-export-dynamic"); + // Set Windows icon #[cfg(windows)] { diff --git a/crates/onetagger/src/main.rs b/crates/onetagger/src/main.rs index ba62dd66..35a42bb1 100644 --- a/crates/onetagger/src/main.rs +++ b/crates/onetagger/src/main.rs @@ -18,6 +18,12 @@ mod quicktag; mod tageditor; fn main() { + // Python subprocess + if std::env::args().any(|a| a == "--python-subprocess") { + onetagger_autotag::python_process(); + std::process::exit(0); + } + // Setup 1T onetagger_shared::setup(); let cli = Cli::parse(); diff --git a/crates/onetagger/src/socket.rs b/crates/onetagger/src/socket.rs index 9df862dc..918e088c 100644 --- a/crates/onetagger/src/socket.rs +++ b/crates/onetagger/src/socket.rs @@ -1,5 +1,6 @@ use std::collections::HashMap; use anyhow::Error; +use onetagger_autotag::platforms::AutotaggerPlatformInfo; use std::net::{TcpListener, TcpStream}; use std::env; use std::sync::atomic::Ordering; @@ -15,7 +16,7 @@ use serde::{Serialize, Deserialize}; use dunce::canonicalize; use onetagger_tag::{TagChanges, TagSeparators, Tag, Field}; use onetagger_tagger::{TaggerConfig, AudioFileInfo, TrackMatch}; -use onetagger_autotag::{Tagger, AutotaggerPlatforms, AudioFileInfoImpl, TaggerConfigExt}; +use onetagger_autotag::{Tagger, AudioFileInfoImpl, TaggerConfigExt}; use onetagger_autotag::audiofeatures::{AudioFeaturesConfig, AudioFeatures}; use onetagger_platforms::spotify::Spotify; use onetagger_player::{AudioSources, AudioPlayer}; @@ -93,7 +94,7 @@ impl TaggerConfigs { TaggerConfigs::AutoTagger(c) => { let mut c = c.clone(); // don't leak secrets - c.custom = HashMap::new(); + c.custom = HashMap::new().into(); c.spotify = None; info!("AutoTagger config: {:?}", c); }, @@ -130,7 +131,7 @@ struct InitData { version: &'static str, os: &'static str, start_context: StartContext, - platforms: &'static AutotaggerPlatforms, + platforms: Vec, renamer_docs: FullDocs, commit: &'static str, work_dir: PathBuf, @@ -145,7 +146,7 @@ impl InitData { version: crate::VERSION, os: env::consts::OS, start_context, - platforms: &onetagger_autotag::AUTOTAGGER_PLATFORMS, + platforms: onetagger_autotag::AUTOTAGGER_PLATFORMS.lock().unwrap().0.iter().map(|p| p.info.clone()).collect(), renamer_docs: FullDocs::get().html(), commit: COMMIT, work_dir: std::env::current_dir().unwrap_or_default(),