From 7cbbf919d55feea31401bb435f27a9e4a0631829 Mon Sep 17 00:00:00 2001 From: videogame hacker Date: Sun, 12 Sep 2021 02:04:30 +0100 Subject: [PATCH] MSVC sucks lol --- Cargo.lock | 18 ++++++++---------- Cargo.toml | 10 +++++++--- README.md | 2 ++ olm-sys-win.patch | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 olm-sys-win.patch diff --git a/Cargo.lock b/Cargo.lock index d615900..f8e40ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1366,8 +1366,6 @@ dependencies = [ [[package]] name = "olm-sys" version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "067ed86d3c0ab5d9009601082cd16a438e2104174f956d38fc81e0ad56f5696b" dependencies = [ "cmake", ] @@ -2173,18 +2171,18 @@ checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" [[package]] name = "serde" -version = "1.0.127" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.127" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" +checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" dependencies = [ "proc-macro2 1.0.28", "quote 1.0.9", @@ -2216,9 +2214,9 @@ dependencies = [ [[package]] name = "serenity" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b68c1f5dbe25b32516f3f104726a9e8e3a96cf5960a106213241738ffe108f81" +checksum = "6275d443266aedf2be507a245ddc23db0c07b1b99774e16f3c879e96a78b067a" dependencies = [ "async-trait", "async-tungstenite", @@ -2555,9 +2553,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7b349f11a7047e6d1276853e612d152f5e8a352c61917887cc2169e2366b4c" +checksum = "b4efe6fc2395938c8155973d7be49fe8d03a843726e285e100a8a383cc0154ce" dependencies = [ "autocfg", "bytes 1.0.1", diff --git a/Cargo.toml b/Cargo.toml index ca124db..24ad372 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,9 +7,13 @@ edition = "2018" bincode = "1.3.3" discord_message_format = { git = "https://git.lavender.software/charlotte/discord-message-format.git" } matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk.git" } -serde = { version = "1.0.127", features = ["derive"] } -serenity = "0.10.8" +serde = { version = "1.0.129", features = ["derive"] } +serenity = "0.10.9" sled = "0.34.6" -tokio = { version = "1.8.0", features = ["full"] } +tokio = { version = "1.10.1", features = ["full"] } tracing = "0.1.26" url = "2.2.2" + +[patch.crates-io] +olm-sys = { path = "./target/patch/olm-sys-1.1.2" } +# You gotta apply the patch or simply clone olm-sys to that location :> diff --git a/README.md b/README.md index 97e4055..7edc73e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # phoebe bridgers + +olm-sys is patched using `olm-sys-win.patch` to let it build on windows :) diff --git a/olm-sys-win.patch b/olm-sys-win.patch new file mode 100644 index 0000000..03c3e75 --- /dev/null +++ b/olm-sys-win.patch @@ -0,0 +1,38 @@ +--- olm/tests/test_base64.cpp 2021-09-12 01:51:01.587794700 +0100 ++++ olm/tests/test_base64.cpp 2021-09-12 01:52:11.937270600 +0100 +@@ -1,6 +1,8 @@ + #include "olm/base64.hh" + #include "olm/base64.h" + #include "unittest.hh" ++#include ++#include + + int main() { + +@@ -68,7 +70,6 @@ + + { + TestCase test_case("Decoding base64 of invalid length fails with -1"); +-#include + std::uint8_t input[] = "SGVsbG8gV29ybGQab"; + std::size_t input_length = sizeof(input) - 1; + +@@ -76,14 +77,12 @@ + * Nothing will be written to the output buffer anyway because the input is + * invalid. */ + std::size_t buf_length = olm::decode_base64_length(input_length + 1); +-std::uint8_t output[buf_length]; +-std::uint8_t expected_output[buf_length]; +-memset(output, 0, buf_length); +-memset(expected_output, 0, buf_length); ++std::vector output(buf_length, 0); ++std::vector expected_output(buf_length, 0); + +-std::size_t output_length = ::_olm_decode_base64(input, input_length, output); ++std::size_t output_length = ::_olm_decode_base64(input, input_length, output.data()); + assert_equals(std::size_t(-1), output_length); +-assert_equals(0, memcmp(output, expected_output, buf_length)); ++assert_equals(0, memcmp(output.data(), expected_output.data(), buf_length)); + } + + }