From 35150ee209f93780decb42a32109668031ef2c8c Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Tue, 17 Oct 2023 13:21:39 +0200 Subject: [PATCH] Modernize some crate dependencies (#1325) This replaces the `lazy_static` and `parking_lot` crates with `once_cell` and `std` types. Also does a `cargo update` for good measure. --- Cargo.lock | 246 +++++++++--------- crates/symbolicator-native/Cargo.toml | 2 +- .../src/symbolication/apple.rs | 9 +- crates/symbolicator-service/Cargo.toml | 4 +- .../src/caching/memory.rs | 7 +- crates/symbolicator-service/src/metrics.rs | 33 +-- crates/symbolicator-service/src/utils/http.rs | 30 ++- crates/symbolicator-sources/Cargo.toml | 2 +- crates/symbolicator-sources/src/paths.rs | 68 ++--- crates/symsorter/Cargo.toml | 4 +- crates/symsorter/src/config.rs | 20 +- crates/symsorter/src/utils.rs | 6 +- 12 files changed, 209 insertions(+), 222 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2072578db..93549ced0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,9 +29,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -157,14 +157,14 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] name = "async-compression" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb42b2197bf15ccb092b62c74515dbd8b86d0effd934795f6687c93b6e679a2c" +checksum = "f658e2baef915ba0f26f1f7c42bfb8e12f532a01f449a090ded75ae7a07e9ba2" dependencies = [ "brotli", "flate2", @@ -185,13 +185,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -716,7 +716,7 @@ version = "0.68.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "cexpr", "clang-sys", "lazy_static", @@ -729,7 +729,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.37", + "syn 2.0.38", "which", ] @@ -741,9 +741,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "block-buffer" @@ -816,9 +816,9 @@ checksum = "ad152d03a2c813c80bb94fedbf3a3f02b28f793e39e7c214c8a0bcc196343de7" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -883,9 +883,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" dependencies = [ "serde", ] @@ -898,7 +898,7 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.19", + "semver 1.0.20", "serde", "serde_json", ] @@ -991,7 +991,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -1222,10 +1222,11 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" dependencies = [ + "powerfmt", "serde", ] @@ -1353,25 +1354,14 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", "libc", "windows-sys 0.48.0", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "error-chain" version = "0.12.4" @@ -1431,9 +1421,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -1478,7 +1468,7 @@ dependencies = [ "pmutil", "proc-macro2", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -1537,7 +1527,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -1917,9 +1907,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.33.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aa511b2e298cd49b1856746f6bb73e17036bcd66b25f5e92cdcdbec9bd75686" +checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" dependencies = [ "console", "lazy_static", @@ -1977,7 +1967,7 @@ dependencies = [ "pmutil", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2028,9 +2018,9 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] @@ -2172,9 +2162,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.148" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" @@ -2194,9 +2184,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" @@ -2340,7 +2330,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b23ab3a13de24f89fa3060579288f142ac4d138d37eec8a398ba59b0ca4d577" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "debugid", "num-derive", "num-traits", @@ -2564,13 +2554,13 @@ dependencies = [ [[package]] name = "num-derive" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e6a0fd4f737c707bd9086cc16c925f294943eb62eb71499e9fd4cf71f8b9f4e" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2585,9 +2575,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -2632,7 +2622,7 @@ version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "cfg-if", "foreign-types", "libc", @@ -2649,7 +2639,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2824,7 +2814,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2874,7 +2864,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2909,9 +2899,15 @@ checksum = "52a40bc70c2c58040d2d8b167ba9a5ff59fc9dab7ad44771cfde3dcfde7a09c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2931,7 +2927,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2950,9 +2946,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -3130,14 +3126,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.6" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.9", - "regex-syntax 0.7.5", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -3151,13 +3147,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.9" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] @@ -3168,9 +3164,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" @@ -3265,16 +3261,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.19", + "semver 1.0.20", ] [[package]] name = "rustix" -version = "0.38.15" +version = "0.38.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f9da0cbd88f9f09e7814e388301c8414c51c62aa6ce1e4b5c551d49d96e531" +checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", @@ -3383,7 +3379,7 @@ checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -3430,9 +3426,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" dependencies = [ "serde", ] @@ -3580,22 +3576,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -3688,9 +3684,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b21f559e07218024e7e9f90f96f601825397de0e25420135f7f952453fed0b" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -3723,9 +3719,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" +checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" [[package]] name = "simple_asn1" @@ -3783,7 +3779,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -3906,7 +3902,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -3967,7 +3963,7 @@ version = "0.106.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebf4d6804b1da4146c4c0359d129e3dd43568d321f69d7953d9abbca4ded76ba" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "is-macro", "num-bigint", "scoped-tls", @@ -4020,7 +4016,7 @@ dependencies = [ "pmutil", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -4032,7 +4028,7 @@ dependencies = [ "pmutil", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -4056,7 +4052,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -4284,11 +4280,11 @@ dependencies = [ "chrono", "futures", "insta", - "lazy_static", "minidump", "minidump-processor", "minidump-unwind", "moka", + "once_cell", "regex", "sentry", "serde", @@ -4325,10 +4321,8 @@ dependencies = [ "idna 0.4.0", "ipnetwork", "jsonwebtoken", - "lazy_static", "moka", "once_cell", - "parking_lot 0.12.1", "rand", "reqwest", "sentry", @@ -4359,7 +4353,7 @@ dependencies = [ "aws-types", "glob", "insta", - "lazy_static", + "once_cell", "serde", "serde_yaml", "symbolic", @@ -4439,7 +4433,7 @@ dependencies = [ "chrono", "clap", "console", - "lazy_static", + "once_cell", "rayon", "regex", "serde", @@ -4463,9 +4457,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -4546,7 +4540,7 @@ checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -4561,14 +4555,15 @@ dependencies = [ [[package]] name = "time" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", "itoa", "libc", "num_threads", + "powerfmt", "serde", "time-core", "time-macros", @@ -4606,9 +4601,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", "bytes", @@ -4629,14 +4624,14 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] name = "tokio-metrics" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4b2fc67d5dec41db679b9b052eb572269616926040b7831e32c8a152df77b84" +checksum = "eace09241d62c98b7eeb1107d4c5c64ca3bd7da92e8c218c153ab3a78f9be112" dependencies = [ "futures-util", "pin-project-lite", @@ -4745,7 +4740,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "bytes", "futures-core", "futures-util", @@ -4778,11 +4773,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -4791,20 +4785,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -5128,7 +5122,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -5162,7 +5156,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5445,9 +5439,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.15" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" dependencies = [ "memchr", ] @@ -5523,30 +5517,28 @@ dependencies = [ [[package]] name = "zstd" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "6.0.6" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" dependencies = [ - "libc", "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/crates/symbolicator-native/Cargo.toml b/crates/symbolicator-native/Cargo.toml index a5ca718b3..cf5a04389 100644 --- a/crates/symbolicator-native/Cargo.toml +++ b/crates/symbolicator-native/Cargo.toml @@ -12,11 +12,11 @@ apple-crash-report-parser = "0.5.1" async-trait = "0.1.53" chrono = { version = "0.4.19", features = ["serde"] } futures = "0.3.12" -lazy_static = "1.4.0" minidump = "0.18.0" minidump-processor = "0.18.0" minidump-unwind = "0.18.0" moka = { version = "0.12.1", features = ["future", "sync"] } +once_cell = "1.18.0" regex = "1.5.5" sentry = { version = "0.31.7", features = ["tracing"] } serde = { version = "1.0.137", features = ["derive", "rc"] } diff --git a/crates/symbolicator-native/src/symbolication/apple.rs b/crates/symbolicator-native/src/symbolication/apple.rs index 38a66e18c..3337752b7 100644 --- a/crates/symbolicator-native/src/symbolication/apple.rs +++ b/crates/symbolicator-native/src/symbolication/apple.rs @@ -4,6 +4,7 @@ use std::sync::Arc; use anyhow::{Context, Result}; use apple_crash_report_parser::AppleCrashReport; use chrono::{DateTime, Utc}; +use once_cell::sync::Lazy; use regex::Regex; use symbolic::common::{Arch, CodeId, DebugId}; use symbolicator_service::types::{RawObjectInfo, Scope, ScrapingConfig}; @@ -136,10 +137,10 @@ impl SymbolicationActor { } } -lazy_static::lazy_static! { - /// Format sent by Unreal Engine on macOS - static ref OS_MACOS_REGEX: Regex = Regex::new(r"^Mac OS X (?P\d+\.\d+\.\d+)( \((?P[a-fA-F0-9]+)\))?$").unwrap(); -} +/// Format sent by Unreal Engine on macOS +static OS_MACOS_REGEX: Lazy = Lazy::new(|| { + Regex::new(r"^Mac OS X (?P\d+\.\d+\.\d+)( \((?P[a-fA-F0-9]+)\))?$").unwrap() +}); #[derive(Debug)] struct AppleCrashReportState { diff --git a/crates/symbolicator-service/Cargo.toml b/crates/symbolicator-service/Cargo.toml index d2b859c86..6c0bbc7b0 100644 --- a/crates/symbolicator-service/Cargo.toml +++ b/crates/symbolicator-service/Cargo.toml @@ -25,10 +25,8 @@ humantime-serde = "1.1.1" idna = "0.4.0" ipnetwork = "0.20.0" jsonwebtoken = "8.1.0" -lazy_static = "1.4.0" moka = { version = "0.12.1", features = ["future", "sync"] } once_cell = "1.17.1" -parking_lot = "0.12.0" rand = "0.8.5" reqwest = { version = "0.11.0", features = ["gzip", "brotli", "deflate", "json", "stream", "trust-dns"] } sentry = { version = "0.31.7", features = ["tracing"] } @@ -46,7 +44,7 @@ tracing = "0.1.34" url = { version = "2.2.0", features = ["serde"] } uuid = { version = "1.0.0", features = ["v4", "serde"] } zip = { version = "0.6.4", default-features = false, features = ["deflate"] } -zstd = "0.12.1" +zstd = "0.13.0" [dev-dependencies] sha-1 = "0.10.0" diff --git a/crates/symbolicator-service/src/caching/memory.rs b/crates/symbolicator-service/src/caching/memory.rs index 873174026..c0b95b71b 100644 --- a/crates/symbolicator-service/src/caching/memory.rs +++ b/crates/symbolicator-service/src/caching/memory.rs @@ -1,11 +1,10 @@ use std::collections::HashSet; use std::path::Path; use std::sync::atomic::Ordering; -use std::sync::Arc; +use std::sync::{Arc, Mutex}; use std::time::{Duration, Instant}; use futures::future::BoxFuture; -use parking_lot::Mutex; use sentry::{Hub, SentryFutureExt}; use symbolic::common::ByteView; use tempfile::NamedTempFile; @@ -372,7 +371,7 @@ impl Cacher { fn spawn_refresh(&self, cache_key: CacheKey, request: T) { let name = self.config.name(); - let mut refreshes = self.refreshes.lock(); + let mut refreshes = self.refreshes.lock().unwrap(); if refreshes.contains(&cache_key) { return; } @@ -391,7 +390,7 @@ impl Cacher { let refreshes = Arc::clone(&self.refreshes); CallOnDrop::new(move || { max_lazy_refreshes.fetch_add(1, Ordering::Relaxed); - refreshes.lock().remove(&key); + refreshes.lock().unwrap().remove(&key); }) }; diff --git a/crates/symbolicator-service/src/metrics.rs b/crates/symbolicator-service/src/metrics.rs index 4657e633d..aecf05b06 100644 --- a/crates/symbolicator-service/src/metrics.rs +++ b/crates/symbolicator-service/src/metrics.rs @@ -1,18 +1,15 @@ //! Provides access to the metrics sytem. use std::collections::BTreeMap; use std::net::ToSocketAddrs; -use std::ops::{Deref, DerefMut}; -use std::sync::Arc; +use std::ops::Deref; +use std::sync::OnceLock; use cadence::{Metric, MetricBuilder, StatsdClient, UdpMetricSink}; -use parking_lot::RwLock; -lazy_static::lazy_static! { - static ref METRICS_CLIENT: RwLock>> = RwLock::new(None); -} +static METRICS_CLIENT: OnceLock = OnceLock::new(); thread_local! { - static CURRENT_CLIENT: Option> = METRICS_CLIENT.read().clone(); + static CURRENT_CLIENT: Option<&'static MetricsClient> = METRICS_CLIENT.get(); } /// The metrics prelude that is necessary to use the client. @@ -50,17 +47,6 @@ impl Deref for MetricsClient { } } -impl DerefMut for MetricsClient { - fn deref_mut(&mut self) -> &mut StatsdClient { - &mut self.statsd_client - } -} - -/// Set a new statsd client. -pub fn set_client(client: MetricsClient) { - *METRICS_CLIENT.write() = Some(Arc::new(client)); -} - /// Tell the metrics system to report to statsd. pub fn configure_statsd(prefix: &str, host: A, tags: BTreeMap) { let addrs: Vec<_> = host.to_socket_addrs().unwrap().collect(); @@ -71,10 +57,13 @@ pub fn configure_statsd(prefix: &str, host: A, tags: BTreeMap< socket.set_nonblocking(true).unwrap(); let sink = UdpMetricSink::from(&addrs[..], socket).unwrap(); let statsd_client = StatsdClient::from_sink(prefix, sink); - set_client(MetricsClient { - statsd_client, - tags, - }); + + METRICS_CLIENT + .set(MetricsClient { + statsd_client, + tags, + }) + .unwrap(); } /// Invoke a callback with the current statsd client. diff --git a/crates/symbolicator-service/src/utils/http.rs b/crates/symbolicator-service/src/utils/http.rs index 24657852b..9a170b467 100644 --- a/crates/symbolicator-service/src/utils/http.rs +++ b/crates/symbolicator-service/src/utils/http.rs @@ -3,18 +3,34 @@ use std::net::IpAddr; use std::time::Duration; use ipnetwork::Ipv4Network; +use once_cell::sync::Lazy; use reqwest::Url; use crate::config::Config; -lazy_static::lazy_static! { - static ref RESERVED_IP_BLOCKS: Vec = vec![ +static RESERVED_IP_BLOCKS: Lazy> = Lazy::new(|| { + [ // https://en.wikipedia.org/wiki/Reserved_IP_addresses#IPv4 - "0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", - "192.0.0.0/29", "192.0.2.0/24", "192.88.99.0/24", "192.168.0.0/16", "198.18.0.0/15", - "198.51.100.0/24", "224.0.0.0/4", "240.0.0.0/4", "255.255.255.255/32", - ].into_iter().map(|x| x.parse().unwrap()).collect(); -} + "0.0.0.0/8", + "10.0.0.0/8", + "100.64.0.0/10", + "127.0.0.0/8", + "169.254.0.0/16", + "172.16.0.0/12", + "192.0.0.0/29", + "192.0.2.0/24", + "192.88.99.0/24", + "192.168.0.0/16", + "198.18.0.0/15", + "198.51.100.0/24", + "224.0.0.0/4", + "240.0.0.0/4", + "255.255.255.255/32", + ] + .into_iter() + .map(|x| x.parse().unwrap()) + .collect() +}); fn is_external_ip(ip: std::net::IpAddr) -> bool { let addr = match ip { diff --git a/crates/symbolicator-sources/Cargo.toml b/crates/symbolicator-sources/Cargo.toml index 742c061ae..dfb3d2142 100644 --- a/crates/symbolicator-sources/Cargo.toml +++ b/crates/symbolicator-sources/Cargo.toml @@ -10,11 +10,11 @@ license = "MIT" anyhow = "1.0.68" aws-types = "0.56.0" glob = "0.3.0" -lazy_static = "1.4.0" serde = { version = "1.0.137", features = ["derive", "rc"] } symbolic = "12.4.0" url = { version = "2.2.0", features = ["serde"] } [dev-dependencies] insta = { version = "1.18.0", features = ["redactions", "yaml"] } +once_cell = "1.18.0" serde_yaml = "0.9.14" diff --git a/crates/symbolicator-sources/src/paths.rs b/crates/symbolicator-sources/src/paths.rs index 1dbbc6d49..02106b133 100644 --- a/crates/symbolicator-sources/src/paths.rs +++ b/crates/symbolicator-sources/src/paths.rs @@ -581,40 +581,40 @@ pub fn matches_path_patterns(object_id: &ObjectId, patterns: &[Glob]) -> bool { mod tests { use super::*; - lazy_static::lazy_static! { - static ref PE_OBJECT_ID: ObjectId = ObjectId { - code_id: Some("5ab380779000".parse().unwrap()), - code_file: Some("C:\\projects\\breakpad-tools\\windows\\Release\\crash.exe".into()), - debug_id: Some("3249d99d-0c40-4931-8610-f4e4fb0b6936-1".parse().unwrap()), - debug_file: Some("C:\\projects\\breakpad-tools\\windows\\Release\\crash.pdb".into()), - debug_checksum: None, - object_type: ObjectType::Pe, - }; - static ref MACHO_OBJECT_ID: ObjectId = ObjectId { - code_id: None, - code_file: Some("/Users/travis/build/getsentry/breakpad-tools/macos/build/./crash".into()), - debug_id: Some("67e9247c-814e-392b-a027-dbde6748fcbf".parse().unwrap()), - debug_file: Some("crash".into()), - debug_checksum: None, - object_type: ObjectType::Macho, - }; - static ref ELF_OBJECT_ID: ObjectId = ObjectId { - code_id: Some("dfb85de42daffd09640c8fe377d572de3e168920".parse().unwrap()), - code_file: Some("/lib/x86_64-linux-gnu/libm-2.23.so".into()), - debug_id: Some("e45db8df-af2d-09fd-640c-8fe377d572de".parse().unwrap()), - debug_file: Some("/lib/x86_64-linux-gnu/libm-2.23.so".into()), - debug_checksum: None, - object_type: ObjectType::Elf, - }; - static ref WASM_OBJECT_ID: ObjectId = ObjectId { - code_id: Some("67e9247c814e392ba027dbde6748fcbf".parse().unwrap()), - code_file: None, - debug_id: Some("67e9247c-814e-392b-a027-dbde6748fcbf".parse().unwrap()), - debug_file: Some("file://foo.invalid/demo.wasm".into()), - debug_checksum: None, - object_type: ObjectType::Wasm, - }; - } + use once_cell::sync::Lazy; + + static PE_OBJECT_ID: Lazy = Lazy::new(|| ObjectId { + code_id: Some("5ab380779000".parse().unwrap()), + code_file: Some("C:\\projects\\breakpad-tools\\windows\\Release\\crash.exe".into()), + debug_id: Some("3249d99d-0c40-4931-8610-f4e4fb0b6936-1".parse().unwrap()), + debug_file: Some("C:\\projects\\breakpad-tools\\windows\\Release\\crash.pdb".into()), + debug_checksum: None, + object_type: ObjectType::Pe, + }); + static MACHO_OBJECT_ID: Lazy = Lazy::new(|| ObjectId { + code_id: None, + code_file: Some("/Users/travis/build/getsentry/breakpad-tools/macos/build/./crash".into()), + debug_id: Some("67e9247c-814e-392b-a027-dbde6748fcbf".parse().unwrap()), + debug_file: Some("crash".into()), + debug_checksum: None, + object_type: ObjectType::Macho, + }); + static ELF_OBJECT_ID: Lazy = Lazy::new(|| ObjectId { + code_id: Some("dfb85de42daffd09640c8fe377d572de3e168920".parse().unwrap()), + code_file: Some("/lib/x86_64-linux-gnu/libm-2.23.so".into()), + debug_id: Some("e45db8df-af2d-09fd-640c-8fe377d572de".parse().unwrap()), + debug_file: Some("/lib/x86_64-linux-gnu/libm-2.23.so".into()), + debug_checksum: None, + object_type: ObjectType::Elf, + }); + static WASM_OBJECT_ID: Lazy = Lazy::new(|| ObjectId { + code_id: Some("67e9247c814e392ba027dbde6748fcbf".parse().unwrap()), + code_file: None, + debug_id: Some("67e9247c-814e-392b-a027-dbde6748fcbf".parse().unwrap()), + debug_file: Some("file://foo.invalid/demo.wasm".into()), + debug_checksum: None, + object_type: ObjectType::Wasm, + }); fn pattern(x: &str) -> Glob { Glob(x.parse().unwrap()) diff --git a/crates/symsorter/Cargo.toml b/crates/symsorter/Cargo.toml index 3a0f48dc4..17319f9c1 100644 --- a/crates/symsorter/Cargo.toml +++ b/crates/symsorter/Cargo.toml @@ -10,7 +10,7 @@ anyhow = "1.0.57" chrono = { version = "0.4.19", default-features = false, features = ["clock", "serde", "std"] } clap = { version = "4.3.2", features = ["derive"] } console = "0.15.0" -lazy_static = "1.4.0" +once_cell = "1.18.0" rayon = "1.5.2" regex = "1.5.5" serde = { version = "1.0.137", features = ["derive"] } @@ -19,4 +19,4 @@ symbolic = { version = "12.4.0", features = ["debuginfo-serde"] } walkdir = "2.3.1" # NOTE: zip:0.6 by default depends on a version of zstd which conflicts with our other dependencies zip = { version = "0.6.2", default-features = false, features = ["deflate", "bzip2"] } -zstd = "0.12.1" +zstd = "0.13.0" diff --git a/crates/symsorter/src/config.rs b/crates/symsorter/src/config.rs index 5399201ee..aa5281b4e 100644 --- a/crates/symsorter/src/config.rs +++ b/crates/symsorter/src/config.rs @@ -1,10 +1,7 @@ -use lazy_static::lazy_static; use std::path::PathBuf; -use std::sync::{Arc, Mutex}; +use std::sync::OnceLock; -lazy_static! { - static ref CONFIG: Mutex> = Mutex::new(Arc::new(Default::default())); -} +static CONFIG: OnceLock = OnceLock::new(); #[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Default, Clone)] pub struct RunConfig { @@ -19,17 +16,14 @@ pub struct RunConfig { } impl RunConfig { - pub fn get() -> Arc { - CONFIG.lock().unwrap().clone() + pub fn get() -> &'static RunConfig { + CONFIG.get_or_init(RunConfig::default) } pub fn configure R, R>(f: F) -> R { - let mut config = RunConfig::get(); - let rv = { - let mutable_config = Arc::make_mut(&mut config); - f(mutable_config) - }; - *CONFIG.lock().unwrap() = config; + let mut config = RunConfig::default(); + let rv = f(&mut config); + CONFIG.set(config).unwrap(); rv } } diff --git a/crates/symsorter/src/utils.rs b/crates/symsorter/src/utils.rs index 75a9d6a3d..9c1109668 100644 --- a/crates/symsorter/src/utils.rs +++ b/crates/symsorter/src/utils.rs @@ -4,15 +4,13 @@ use std::io::Cursor; use std::path::{Path, PathBuf}; use anyhow::{anyhow, bail, Result}; -use lazy_static::lazy_static; +use once_cell::sync::Lazy; use regex::Regex; use symbolic::common::ByteView; use symbolic::debuginfo::sourcebundle::{SourceBundleWriter, SourceFileDescriptor}; use symbolic::debuginfo::{Archive, FileEntry, FileFormat, Object, ObjectKind}; -lazy_static! { - static ref BAD_CHARS_RE: Regex = Regex::new(r"[^a-zA-Z0-9.,-]+").unwrap(); -} +static BAD_CHARS_RE: Lazy = Lazy::new(|| Regex::new(r"[^a-zA-Z0-9.,-]+").unwrap()); /// Console logging for the symsorter app. #[macro_export]