From 7a349fdc58bb1322991a7b403178b8dccedf2e59 Mon Sep 17 00:00:00 2001 From: strawberry Date: Thu, 2 Jan 2025 18:55:52 -0500 Subject: [PATCH] use latest sccache, bump nix flake lock, cache everything in rust-cache Signed-off-by: strawberry --- .github/workflows/ci.yml | 12 +++++++----- Cargo.lock | 6 +++--- Cargo.toml | 10 +++++----- flake.lock | 24 ++++++++++++------------ src/database/pool.rs | 6 +++--- 5 files changed, 30 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b20a43e..453d9df8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,13 +188,13 @@ jobs: - name: Run sccache-cache if: (env.SCCACHE_GHA_ENABLED == 'true') uses: mozilla-actions/sccache-action@main - with: - version: "v0.8.2" # use rust-cache - uses: Swatinem/rust-cache@v2 with: cache-all-crates: "true" + cache-on-failure: "true" + cache-targets: "true" - name: Run CI tests env: @@ -366,13 +366,13 @@ jobs: - name: Run sccache-cache if: (env.SCCACHE_GHA_ENABLED == 'true') uses: mozilla-actions/sccache-action@main - with: - version: "v0.8.2" # use rust-cache - uses: Swatinem/rust-cache@v2 with: cache-all-crates: "true" + cache-on-failure: "true" + cache-targets: "true" - name: Build static ${{ matrix.target }}-all-features run: | @@ -660,6 +660,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-all-crates: "true" + cache-on-failure: "true" + cache-targets: "true" # Nix can't do portable macOS builds yet - name: Build macOS x86_64 binary @@ -921,4 +923,4 @@ jobs: if [ ! -z $GITLAB_TOKEN ]; then echo "- \`docker pull ${GLCR_TAG}\`" >> $GITHUB_STEP_SUMMARY echo "- \`docker pull ${GLCR_TAG}-debug\`" >> $GITHUB_STEP_SUMMARY - fi \ No newline at end of file + fi diff --git a/Cargo.lock b/Cargo.lock index 2005202d..3f900a11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,7 +95,7 @@ checksum = "5f093eed78becd229346bf859eec0aa4dd7ddde0757287b2b4107a1f09c80002" [[package]] name = "async-channel" version = "2.3.1" -source = "git+https://github.com/jevolk/async-channel?rev=fefa543ca5eddf21237d75776fce98b7e09e924a#fefa543ca5eddf21237d75776fce98b7e09e924a" +source = "git+https://github.com/girlbossceo/async-channel?rev=92e5e74063bf2a3b10414bcc8a0d68b235644280#92e5e74063bf2a3b10414bcc8a0d68b235644280" dependencies = [ "concurrent-queue", "event-listener-strategy", @@ -938,7 +938,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core_affinity" version = "0.8.1" -source = "git+https://github.com/jevolk/core_affinity_rs?rev=9c8e51510c35077df888ee72a36b4b05637147da#9c8e51510c35077df888ee72a36b4b05637147da" +source = "git+https://github.com/girlbossceo/core_affinity_rs?rev=9c8e51510c35077df888ee72a36b4b05637147da#9c8e51510c35077df888ee72a36b4b05637147da" dependencies = [ "libc", "num_cpus", @@ -1258,7 +1258,7 @@ dependencies = [ [[package]] name = "event-listener" version = "5.3.1" -source = "git+https://github.com/jevolk/event-listener?rev=96d7e0fc026d8f708b19bc9267a382676a50354c#96d7e0fc026d8f708b19bc9267a382676a50354c" +source = "git+https://github.com/girlbossceo/event-listener?rev=fe4aebeeaae435af60087ddd56b573a2e0be671d#fe4aebeeaae435af60087ddd56b573a2e0be671d" dependencies = [ "concurrent-queue", "parking", diff --git a/Cargo.toml b/Cargo.toml index 3d65e4cd..76acda80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -532,14 +532,14 @@ rev = "deaeb0694e2083f53d363b648da06e10fc13900c" # adds LIFO queue scheduling; this should be updated with PR progress. [patch.crates-io.event-listener] -git = "https://github.com/jevolk/event-listener" -rev = "96d7e0fc026d8f708b19bc9267a382676a50354c" +git = "https://github.com/girlbossceo/event-listener" +rev = "fe4aebeeaae435af60087ddd56b573a2e0be671d" [patch.crates-io.async-channel] -git = "https://github.com/jevolk/async-channel" -rev = "fefa543ca5eddf21237d75776fce98b7e09e924a" +git = "https://github.com/girlbossceo/async-channel" +rev = "92e5e74063bf2a3b10414bcc8a0d68b235644280" [patch.crates-io.core_affinity] -git = "https://github.com/jevolk/core_affinity_rs" +git = "https://github.com/girlbossceo/core_affinity_rs" rev = "9c8e51510c35077df888ee72a36b4b05637147da" # diff --git a/flake.lock b/flake.lock index 94cef4dd..35029076 100644 --- a/flake.lock +++ b/flake.lock @@ -117,11 +117,11 @@ }, "crane_2": { "locked": { - "lastModified": 1733688869, - "narHash": "sha256-KrhxxFj1CjESDrL5+u/zsVH0K+Ik9tvoac/oFPoxSB8=", + "lastModified": 1734808813, + "narHash": "sha256-3aH/0Y6ajIlfy7j52FGZ+s4icVX0oHhqBzRdlOeztqg=", "owner": "ipetkov", "repo": "crane", - "rev": "604637106e420ad99907cae401e13ab6b452e7d9", + "rev": "72e2d02dbac80c8c86bf6bf3e785536acf8ee926", "type": "github" }, "original": { @@ -170,11 +170,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1733726208, - "narHash": "sha256-Z6zL4AtpZWxkvTd3l0KkPZamu2wtTKl4nNiqNSlgsb4=", + "lastModified": 1735799625, + "narHash": "sha256-lFadwWDvVIub11bwfZhsh2WUByf9LOi6yjsSUMmE0xk=", "owner": "nix-community", "repo": "fenix", - "rev": "d51a64e1d23e509f28a6955a6652cc62409dd4a8", + "rev": "a9d84a1545814910cb4ab0515ed6921e8b07ee95", "type": "github" }, "original": { @@ -550,11 +550,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1733656523, - "narHash": "sha256-w0FXPfpGhOihoJDiwMsyN1EzpsXi2F8VQ+NVZQSMtys=", + "lastModified": 1735685343, + "narHash": "sha256-h1CpBzdJDNtSUb5QMyfFHKHocTTky+4McgQEBQBM+xA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "93dc9803a1ee435e590b02cde9589038d5cc3a4e", + "rev": "81934660d6e9ea54d2f0cdee821e8533b10c221a", "type": "github" }, "original": { @@ -599,11 +599,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1733642337, - "narHash": "sha256-I1uc97f/cNhOpCemIbBAUS+CV0R7jts0NW9lc8jrpxc=", + "lastModified": 1735742096, + "narHash": "sha256-q3a80h8Jf8wfmPURUgRR46nQCB3I5fhZ+/swulTF5HY=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "4c755e62a617eeeef3066994731ce1cdd16504ac", + "rev": "7e639ee3dda6ed9cecc79d41f6d38235121e483d", "type": "github" }, "original": { diff --git a/src/database/pool.rs b/src/database/pool.rs index bcf20de8..0295e0e9 100644 --- a/src/database/pool.rs +++ b/src/database/pool.rs @@ -8,7 +8,7 @@ use std::{ }, }; -use async_channel::{Receiver, RecvError, Sched, Sender}; +use async_channel::{QueueStrategy, Receiver, RecvError, Sender}; use conduwuit::{ debug, debug_warn, defer, err, implement, result::DebugInspect, @@ -71,13 +71,13 @@ const BATCH_INLINE: usize = 1; #[implement(Pool)] pub(crate) async fn new(server: &Arc) -> Result> { - const CHAN_SCHED: (Sched, Sched) = (Sched::Fifo, Sched::Lifo); + const CHAN_SCHED: (QueueStrategy, QueueStrategy) = (QueueStrategy::Fifo, QueueStrategy::Lifo); let (total_workers, queue_sizes, topology) = configure(server); let (senders, receivers) = queue_sizes .into_iter() - .map(|cap| async_channel::bounded_with_sched(cap, CHAN_SCHED)) + .map(|cap| async_channel::bounded_with_queue_strategy(cap, CHAN_SCHED)) .unzip(); let pool = Arc::new(Self {