Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ jobs:
env:
SKIP_EXT_BACKENDS: "true"
run: cargo nextest run --package citadel_user --features localhost-testing
- run: cargo nextest run --features=localhost-testing,multi-threaded --package citadel_proto
- run: cargo nextest run --features=localhost-testing --package citadel_proto
if: ${{ !startsWith(matrix.os, 'windows') }}
- run: cargo nextest run --features=localhost-testing,multi-threaded,vendored --package citadel_proto
- run: cargo nextest run --features=localhost-testing,vendored --package citadel_proto
if: ${{ startsWith(matrix.os, 'windows') }}

nat:
Expand Down Expand Up @@ -101,12 +101,9 @@ jobs:
- name: Single-threaded testing (windows only)
run: cargo nextest run --package citadel_sdk --features=localhost-testing,vendored
if: startsWith(matrix.os, 'windows')
- name: Multi-threaded testing (windows only)
run: cargo nextest run --package citadel_sdk --features=multi-threaded,localhost-testing,vendored
if: startsWith(matrix.os, 'windows')
- name: Multi-threaded testing
if: ${{ !startsWith(matrix.os, 'windows') }}
run: cargo nextest run --package citadel_sdk --features=multi-threaded,localhost-testing
- name: Skipped multi-threaded testing
run: echo "multi-threaded feature disabled"
if: false

citadel_sdk_release:
strategy:
Expand All @@ -119,8 +116,8 @@ jobs:
- uses: taiki-e/install-action@nextest
- name: Single-threaded testing
run: cargo nextest run --package citadel_sdk --features=localhost-testing --release
- name: Multi-threaded testing
run: cargo nextest run --package citadel_sdk --features=multi-threaded,localhost-testing --release
- name: Skipped multi-threaded testing
run: echo "multi-threaded feature disabled"

misc_checks:
name: miscellaneous
Expand All @@ -142,11 +139,9 @@ jobs:
# Run with valgrind
# - name: Run valgrind secmem_string
# run: valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all ./target/debug/secmem_string_test
- run: cargo check --package citadel_sdk --release --features=webrtc,sql,redis,multi-threaded
- run: cargo check --package citadel_sdk --release --features=webrtc,sql,redis
- run: cargo install --locked cargo-deny && cargo deny check all
- run: rustup component add clippy-preview
- run: cargo clippy --features=webrtc,sql,redis,multi-threaded -- -D warnings
- run: cargo clippy --features=webrtc,sql,redis,multi-threaded --release -- -D warnings
- run: cargo clippy --features=webrtc,sql,redis -- -D warnings
- run: cargo clippy --features=webrtc,sql,redis --release -- -D warnings
- run: cargo clippy --tests --examples -- -D warnings
Expand Down Expand Up @@ -183,7 +178,7 @@ jobs:
- name: Run llvm-cov nextest
env:
SKIP_EXT_BACKENDS: "true"
run: cargo llvm-cov nextest --features=filesystem,localhost-testing,multi-threaded -p citadel_sdk -p citadel_user -p citadel_crypt -p citadel_pqcrypto -p citadel_wire -p netbeam -p async_ip --lcov --output-path ${GITHUB_WORKSPACE}/lcov.info --ignore-filename-regex="firebase-rtdb/src/lib.rs|netbeam/src/sync/operations/net_join.rs|netbeam/src/sync/operations/net_select.rs|citadel_sdk/src/test_common.rs|citadel_wire/src/upnp_handler.rs"
run: cargo llvm-cov nextest --features=filesystem,localhost-testing -p citadel_sdk -p citadel_user -p citadel_crypt -p citadel_pqcrypto -p citadel_wire -p netbeam -p async_ip --lcov --output-path ${GITHUB_WORKSPACE}/lcov.info --ignore-filename-regex="firebase-rtdb/src/lib.rs|netbeam/src/sync/operations/net_join.rs|netbeam/src/sync/operations/net_select.rs|citadel_sdk/src/test_common.rs|citadel_wire/src/upnp_handler.rs"
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ sqlx = { version = "0.7.2" }
redis-base = { package = "redis", version = "0.23.0" }
mobc = { version = "0.8.1", default-features = false }
jwt = { version = "0.16.0", default-features = false }
openssl = { version = "0.10.66", default-features = false }
openssl = { version = "0.10.73", default-features = false, features = ["vendored"] }
chrono = { default-features = false, version = "0.4.23" }
tokio-util = { version = "0.7.4", default-features = false }
dirs2 = { default-features = false, version = "3.0.1" }
Expand All @@ -123,4 +123,6 @@ embed-doc-image = { version = "0.1.4" }
hyper = { version = "0.14.25" }
sha256 = { version = "1.5.0" }
tokio-openssl = { version = "0.6.3" }
openssl-sys = { version = "0.9.104" }
openssl-sys = { version = "0.9.104" }

base64ct = { version = ">=1.7.0, <1.8.0" }
2 changes: 1 addition & 1 deletion citadel_proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ license = "MIT OR Apache-2.0"
[features]
default = ["filesystem", "std"]
filesystem = ["citadel_user/filesystem"]
multi-threaded = []
sql = ["citadel_user/sql"]
redis = ["citadel_user/redis"]
webrtc = ["webrtc-util"]
localhost-testing = ["citadel_wire/localhost-testing", "citadel_user/localhost-testing", "tracing"]
localhost-testing-assert-no-proxy = ["localhost-testing"]
google-services = ["citadel_user/google-services"]
vendored = ["citadel_user/vendored", "citadel_wire/vendored"]
multi-threaded = []

std = [
"citadel_user/std",
Expand Down
4 changes: 1 addition & 3 deletions citadel_proto/src/kernel/kernel_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,9 @@ impl<K: NetKernel<R>, R: Ratchet> KernelExecutor<K, R> {
);
#[cfg(feature = "multi-threaded")]
{
use crate::proto::misc::panic_future::ExplicitPanicFuture;
let citadel_server_future = ExplicitPanicFuture::new(_rt.spawn(citadel_server));
citadel_io::tokio::select! {
ret0 = kernel_future => ret0,
ret1 = citadel_server_future => ret1.map_err(|err| NetworkError::Generic(err.to_string()))?
ret1 = citadel_server => ret1
}
}
#[cfg(not(feature = "multi-threaded"))]
Expand Down
23 changes: 10 additions & 13 deletions citadel_proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ pub mod macros {
};
}

#[allow(unused_macros)]
macro_rules! spawn_handle {
($future:expr) => {
crate::proto::misc::panic_future::ExplicitPanicFuture::new(
Expand Down Expand Up @@ -304,14 +305,14 @@ pub mod macros {

pub type EitherOwnedGuard<'a, T> = Either<OwnedReadGuard<'a, T>, OwnedWriteGuard<'a, T>>;

pub trait ContextRequirements: Send + 'static {}
impl<T: Send + 'static> ContextRequirements for T {}
pub trait ContextRequirements: 'static {}
impl<T: 'static> ContextRequirements for T {}

pub trait LocalContextRequirements<'a>: Send + 'a {}
impl<'a, T: Send + 'a> LocalContextRequirements<'a> for T {}
pub trait LocalContextRequirements<'a>: 'a {}
impl<'a, T: 'a> LocalContextRequirements<'a> for T {}

pub trait SyncContextRequirements: Send + Sync + 'static {}
impl<T: Send + Sync + 'static> SyncContextRequirements for T {}
pub trait SyncContextRequirements: Sync + 'static {}
impl<T: Sync + 'static> SyncContextRequirements for T {}

pub trait FutureRequirements: ContextRequirements + Future {}
impl<T: ContextRequirements + Future> FutureRequirements for T {}
Expand Down Expand Up @@ -455,17 +456,18 @@ pub mod macros {
macro_rules! spawn {
($future:expr) => {
if citadel_io::tokio::runtime::Handle::try_current().is_ok() {
std::mem::drop(crate::proto::misc::panic_future::ExplicitPanicFuture::new(citadel_io::tokio::task::spawn($future)));
std::mem::drop(crate::proto::misc::panic_future::ExplicitPanicFuture::new(citadel_io::tokio::task::spawn_local($future)));
} else {
log::warn!(target: "citadel", "Unable to spawn future: {:?}", stringify!($future));
}
};
}

#[allow(unused_macros)]
macro_rules! spawn_handle {
($future:expr) => {
crate::proto::misc::panic_future::ExplicitPanicFuture::new(
citadel_io::tokio::task::spawn($future),
citadel_io::tokio::task::spawn_local($future),
)
};
}
Expand Down Expand Up @@ -601,11 +603,6 @@ pub mod kernel;
/// The primary module of this crate
mod proto;

/// Concurrency improvements and utilities
pub mod concurrency_improvements {
pub use crate::proto::concurrency_improvements::*;
}

pub(crate) type ProtocolRatchetManager<R> =
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concurrency_improvements module has been removed. Ensure that all code that previously imported from this module has been updated to use alternative implementations or imports.

DefaultRatchetManager<NetworkError, R, MessengerLayerOrderedMessage<UserMessage>>;
pub type ProtocolMessengerTx<R> = RatchetManagerMessengerLayerTx<NetworkError, R, UserMessage>;
Expand Down
Loading
Loading