diff --git a/Cargo.lock b/Cargo.lock index a774b637a..3add26f82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1527,11 +1527,8 @@ dependencies = [ [[package]] name = "directories-next" version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" dependencies = [ - "cfg-if", - "dirs-sys-next", + "directories", ] [[package]] @@ -1546,17 +1543,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "displaydoc" version = "0.2.4" @@ -4806,8 +4792,6 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "option-ext" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "overload" diff --git a/Cargo.toml b/Cargo.toml index 04051ff29..71e0f83ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,6 +67,9 @@ members = [ "tests/coordinator", "tests/full-stack", "tests/reproducible-runtime", + + "patches/option-ext", + "patches/directories-next", ] # Always compile Monero (and a variety of dependencies) with optimizations due @@ -93,12 +96,17 @@ panic = "unwind" # https://github.com/rust-lang-nursery/lazy-static.rs/issues/201 lazy_static = { git = "https://github.com/rust-lang-nursery/lazy-static.rs", rev = "5735630d46572f1e5377c8f2ba0f79d18f53b10c" } -# subxt *can* pull these off crates.io yet there's no benefit to this -sp-core-hashing = { git = "https://github.com/serai-dex/substrate" } -sp-std = { git = "https://github.com/serai-dex/substrate" } - +# Needed due to dockertest's usage of `Rc`s when we need `Arc`s dockertest = { git = "https://github.com/kayabaNerve/dockertest-rs", branch = "arc" } +# directories-next was created because directories was unmaintained +# directories-next is now unmaintained while directories is maintained +# The directories author pulls in ridiculously pointless crates and prefers +# copyleft licenses +# The following two patches resolve everything +option-ext = { path = "patches/option-ext" } +directories-next = { path = "patches/directories-next" } + [workspace.lints.clippy] unwrap_or_default = "allow" borrow_as_ptr = "deny" diff --git a/patches/directories-next/Cargo.toml b/patches/directories-next/Cargo.toml new file mode 100644 index 000000000..8c2b21dce --- /dev/null +++ b/patches/directories-next/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "directories-next" +version = "2.0.0" +description = "Patch from directories-next back to directories" +license = "MIT" +repository = "https://github.com/serai-dex/serai/tree/develop/patches/directories-next" +authors = ["Luke Parker "] +keywords = [] +edition = "2021" +rust-version = "1.74" + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + +[dependencies] +directories = "5" diff --git a/patches/directories-next/src/lib.rs b/patches/directories-next/src/lib.rs new file mode 100644 index 000000000..fb4871e65 --- /dev/null +++ b/patches/directories-next/src/lib.rs @@ -0,0 +1 @@ +pub use directories::*; diff --git a/patches/option-ext/Cargo.toml b/patches/option-ext/Cargo.toml new file mode 100644 index 000000000..6f039c31c --- /dev/null +++ b/patches/option-ext/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "option-ext" +version = "0.2.0" +description = "Non-MPL option-ext with the exactly needed API for directories" +license = "MIT" +repository = "https://github.com/serai-dex/serai/tree/develop/patches/option-ext" +authors = ["Luke Parker "] +keywords = [] +edition = "2021" +rust-version = "1.74" + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] diff --git a/patches/option-ext/src/lib.rs b/patches/option-ext/src/lib.rs new file mode 100644 index 000000000..b075111ce --- /dev/null +++ b/patches/option-ext/src/lib.rs @@ -0,0 +1,8 @@ +pub trait OptionExt { + fn contains(&self, x: &T) -> bool; +} +impl OptionExt for Option { + fn contains(&self, x: &T) -> bool { + self.as_ref() == Some(x) + } +}