From 7650805c60cec2fe09cd2a59cb665731f5cca140 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sat, 27 Aug 2022 16:18:56 +0300 Subject: [PATCH] Bring stripped binary size down to 7MiB --- Cargo.lock | 354 ++++------------------------------------------- Cargo.toml | 46 +++--- melib/Cargo.toml | 42 +++--- 3 files changed, 72 insertions(+), 370 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e7d458df..0fadcdc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,17 +28,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "async-broadcast" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d26004fe83b2d1cd3a97609b21e39f9a31535822210fe83205d2ce48866ea61" -dependencies = [ - "event-listener", - "futures-core", - "parking_lot", -] - [[package]] name = "async-channel" version = "1.6.1" @@ -131,17 +120,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "async-recursion" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "async-stream" version = "0.3.3" @@ -169,17 +147,6 @@ version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" -[[package]] -name = "async-trait" -version = "0.1.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "atomic-waker" version = "1.0.0" @@ -233,12 +200,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - [[package]] name = "bytes" version = "1.2.1" @@ -430,14 +391,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] -name = "derivative" -version = "2.2.0" +name = "dbus" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "6f8bcdd56d2e5c4ed26a529c5a9029f5db8290d433497506f958eae3be148eb6" dependencies = [ - "proc-macro2", - "quote", - "syn", + "libc", + "libdbus-sys", + "winapi 0.3.9", ] [[package]] @@ -554,27 +515,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "enumflags2" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75d4cd21b95383444831539909fbb14b9dc3fdceb2a6f5d36577329a1f55ccb" -dependencies = [ - "enumflags2_derive", - "serde", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "event-listener" version = "2.5.3" @@ -807,26 +747,20 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ "ahash", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashlink" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" +checksum = "d452c155cb93fecdfb02a73dd57b5d8e442c2063bd7aac72f1bc5e4263a43086" dependencies = [ - "hashbrown 0.11.2", + "hashbrown", ] [[package]] @@ -847,12 +781,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - [[package]] name = "http" version = "0.2.8" @@ -882,7 +810,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown 0.12.3", + "hashbrown", "serde", ] @@ -996,6 +924,15 @@ version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +[[package]] +name = "libdbus-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c185b5b7ad900923ef3a8ff594083d4d9b5aea80bb4f32b8342363138c0d456b" +dependencies = [ + "pkg-config", +] + [[package]] name = "libloading" version = "0.7.3" @@ -1018,9 +955,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.24.2" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "898745e570c7d0453cc1fbc4a701eb6c662ed54e8fec8b7d14be137ebeeb9d14" +checksum = "9f0455f2c1bc9a7caa792907026e469c1d91761fb0ea37cbb16427c77280cf35" dependencies = [ "pkg-config", "vcpkg", @@ -1047,16 +984,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "lock_api" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" version = "0.4.17" @@ -1108,7 +1035,7 @@ dependencies = [ "libc", "linkify", "melib", - "nix 0.24.2", + "nix", "notify", "notify-rust", "num_cpus", @@ -1148,7 +1075,7 @@ dependencies = [ "libc", "libloading", "native-tls", - "nix 0.24.2", + "nix", "nom", "notify", "rusqlite", @@ -1271,19 +1198,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "nix" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" -dependencies = [ - "bitflags", - "cc", - "cfg-if 1.0.0", - "libc", - "memoffset", -] - [[package]] name = "nix" version = "0.24.2" @@ -1330,12 +1244,9 @@ version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a995a3d2834cefa389218e7a35156e8ce544bc95f836900da01ee0b26a07e9d4" dependencies = [ + "dbus", "mac-notification-sys", - "serde", "winrt-notification", - "zbus", - "zvariant", - "zvariant_derive", ] [[package]] @@ -1443,45 +1354,12 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "ordered-stream" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44630c059eacfd6e08bdaa51b1db2ce33119caa4ddc1235e923109aa5f25ccb1" -dependencies = [ - "futures-core", - "pin-project-lite", -] - [[package]] name = "parking" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall", - "smallvec", - "windows-sys", -] - [[package]] name = "pcre2" version = "0.2.3" @@ -1562,22 +1440,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "ppv-lite86" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" - -[[package]] -name = "proc-macro-crate" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" -dependencies = [ - "thiserror", - "toml", -] - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1620,36 +1482,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom", -] - [[package]] name = "redox_syscall" version = "0.2.16" @@ -1707,16 +1539,15 @@ dependencies = [ [[package]] name = "rusqlite" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85127183a999f7db96d1a976a309eebbfb6ea3b0b400ddd8340190129de6eb7a" +checksum = "01e213bc3ecb39ac32e81e51ebe31fd888a940515173e3a18a35f8c6e896422a" dependencies = [ "bitflags", "fallible-iterator", "fallible-streaming-iterator", "hashlink", "libsqlite3-sys", - "memchr", "smallvec", ] @@ -1779,9 +1610,6 @@ name = "serde" version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" -dependencies = [ - "serde_derive", -] [[package]] name = "serde_derive" @@ -1805,26 +1633,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_repr" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ad84e47328a31223de7fed7a4f5087f2d6ddfe586cf3ca25b7a165bc0a5aed" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", -] - [[package]] name = "sha1_smol" version = "1.0.0" @@ -1907,12 +1715,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "structopt" version = "0.3.26" @@ -2124,16 +1926,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "uds_windows" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" -dependencies = [ - "tempfile", - "winapi 0.3.9", -] - [[package]] name = "unicode-bidi" version = "0.3.8" @@ -2397,93 +2189,3 @@ name = "xml-rs" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" - -[[package]] -name = "zbus" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d8f1a037b2c4a67d9654dc7bdfa8ff2e80555bbefdd3c1833c1d1b27c963a6b" -dependencies = [ - "async-broadcast", - "async-channel", - "async-executor", - "async-io", - "async-lock", - "async-recursion", - "async-task", - "async-trait", - "byteorder", - "derivative", - "dirs", - "enumflags2", - "event-listener", - "futures-core", - "futures-sink", - "futures-util", - "hex", - "lazy_static", - "nix 0.23.1", - "once_cell", - "ordered-stream", - "rand", - "serde", - "serde_repr", - "sha1", - "static_assertions", - "tracing", - "uds_windows", - "winapi 0.3.9", - "zbus_macros", - "zbus_names", - "zvariant", -] - -[[package]] -name = "zbus_macros" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8fb5186d1c87ae88cf234974c240671238b4a679158ad3b94ec465237349a6" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "regex", - "syn", -] - -[[package]] -name = "zbus_names" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a408fd8a352695690f53906dc7fd036be924ec51ea5e05666ff42685ed0af5" -dependencies = [ - "serde", - "static_assertions", - "zvariant", -] - -[[package]] -name = "zvariant" -version = "3.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bd68e4e6432ef19df47d7e90e2e72b5e7e3d778e0ae3baddf12b951265cc758" -dependencies = [ - "byteorder", - "enumflags2", - "libc", - "serde", - "static_assertions", - "zvariant_derive", -] - -[[package]] -name = "zvariant_derive" -version = "3.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08e977eaa3af652f63d479ce50d924254ad76722a6289ec1a1eac3231ca30430" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] diff --git a/Cargo.toml b/Cargo.toml index d45e1d9d..6570a04d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,42 +26,42 @@ path = "src/main.rs" #path = "src/async.rs" [dependencies] -xdg = "2.1.0" -crossbeam = "^0.8" -signal-hook = "^0.3" -signal-hook-registry = "1.2.0" -nix = "^0.24" +async-task = "^4.2.0" +bincode = { version = "^1.3.0", default-features = false } +bitflags = "1.0" +crossbeam = { version = "^0.8" } +flate2 = { version = "1.0.16", optional = true } +futures = "0.3.5" +indexmap = { version = "^1.6", features = ["serde-1", ] } +libc = { version = "0.2.125", default-features = false, features = ["extra_traits",] } +linkify = { version = "^0.8", default-features = false } melib = { path = "melib", version = "0.7.2" } +nix = { version = "^0.24", default-features = false } +notify = { version = "4.0.1", default-features = false } # >:c +num_cpus = "1.12.0" +pcre2 = { version = "0.2.3", optional = true } serde = "1.0.71" serde_derive = "1.0.71" serde_json = "1.0" -toml = { version = "0.5.6", features = ["preserve_order", ] } -indexmap = { version = "^1.6", features = ["serde-1", ] } -linkify = "^0.8" -notify = "4.0.1" # >:c -termion = "1.5.1" -bincode = "^1.3.0" -unicode-segmentation = "1.2.1" # >:c -libc = {version = "0.2.125", features = ["extra_traits",]} +signal-hook = { version = "^0.3", default-features = false } +signal-hook-registry = { version = "1.2.0", default-features = false } smallvec = { version = "^1.5.0", features = ["serde", ] } -bitflags = "1.0" -pcre2 = { version = "0.2.3", optional = true } structopt = { version = "0.3.14", default-features = false } svg_crate = { version = "^0.10", optional = true, package = "svg" } -futures = "0.3.5" -async-task = "^4.2.0" -num_cpus = "1.12.0" -flate2 = { version = "1.0.16", optional = true } +termion = { version = "1.5.1", default-features = false } +toml = { version = "0.5.6", default-features = false, features = ["preserve_order", ] } +unicode-segmentation = "1.2.1" # >:c +xdg = "2.1.0" [target.'cfg(target_os="linux")'.dependencies] -notify-rust = { version = "^4", optional = true } +notify-rust = { version = "^4", default-features = false, features = ["dbus", ], optional = true } [build-dependencies] -syn = { version = "1.0.92", features = [] } -quote = "^1.0" -proc-macro2 = "1.0.37" flate2 = { version = "1.0.16", optional = true } +proc-macro2 = "1.0.37" +quote = "^1.0" +syn = { version = "1.0.92", features = [] } [dev-dependencies] regex = "1" diff --git a/melib/Cargo.toml b/melib/Cargo.toml index 99312729..1d383d38 100644 --- a/melib/Cargo.toml +++ b/melib/Cargo.toml @@ -10,7 +10,7 @@ homepage = "https://meli.delivery" repository = "https://git.meli.delivery/meli/meli.git" description = "mail library" keywords = ["mail", "mua", "maildir", "imap", "jmap"] -categories = [ "email", "parser-implementations"] +categories = ["email", "parser-implementations"] license = "GPL-3.0-or-later" readme = "README.md" @@ -19,34 +19,34 @@ name = "melib" path = "src/lib.rs" [dependencies] +async-stream = "^0.3" +base64 = { version = "^0.13", optional = true } +bincode = { version = "^1.3.0", default-features = false } bitflags = "1.0" -data-encoding = "2.1.1" -encoding = "0.2.33" -nom = { version = "7" } +data-encoding = { version = "2.1.1" } +encoding = { version = "0.2.33", default-features = false } +flate2 = { version = "1.0.16", optional = true } +futures = "0.3.5" + +indexmap = { version = "^1.5", default-features = false, features = ["serde-1", ] } +isahc = { version = "^1.7.2", optional = true, default-features = false, features = ["http2", "json", "text-decoding"] } +libc = { version = "0.2.125", features = ["extra_traits",] } -indexmap = { version = "^1.5", features = ["serde-1", ] } +libloading = "^0.7" +native-tls = { version = "0.2.3", default-features = false, optional = true } +nix = "^0.24" +nom = { version = "7" } notify = { version = "4.0.15", optional = true } -xdg = "2.1.0" -native-tls = { version ="0.2.3", optional=true } +rusqlite = { version = "^0.28", default-features = false, optional = true } serde = { version = "1.0.71", features = ["rc", ] } serde_derive = "1.0.71" -bincode = "^1.3.0" -uuid = { version = "^1", features = ["serde", "v4", "v5"] } - -unicode-segmentation = { version = "1.2.1", optional = true } -libc = {version = "0.2.125", features = ["extra_traits",]} -isahc = { version = "^1.7.2", optional = true, default-features = false, features = ["http2", "json", "text-decoding"]} serde_json = { version = "1.0", optional = true, features = ["raw_value",] } smallvec = { version = "^1.5.0", features = ["serde", ] } -nix = "^0.24" -rusqlite = {version = "^0.27", optional = true } - -libloading = "^0.7" -futures = "0.3.5" smol = "1.0.0" -async-stream = "^0.3" -base64 = { version = "^0.13", optional = true } -flate2 = { version = "1.0.16", optional = true } + +unicode-segmentation = { version = "1.2.1", default-features = false, optional = true } +uuid = { version = "^1", features = ["serde", "v4", "v5"] } +xdg = "2.1.0" xdg-utils = "^0.4.0" [features]