From f31e4a6bc586262a2c12a03dcc552db91cdc50e5 Mon Sep 17 00:00:00 2001 From: Jordan Santell Date: Thu, 19 Oct 2023 09:57:10 -0700 Subject: [PATCH] feat: Fix nightly builds and add to CI. --- .github/workflows/run_test_suite.yaml | 22 ++++++++++++++----- Cargo.lock | 6 ++--- .../src/handlers/v0alpha2/push.rs | 2 +- rust/noosphere/Cargo.toml | 2 +- rust/noosphere/src/ffi/mod.rs | 2 +- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/run_test_suite.yaml b/.github/workflows/run_test_suite.yaml index f6311545e..77793c7aa 100644 --- a/.github/workflows/run_test_suite.yaml +++ b/.github/workflows/run_test_suite.yaml @@ -61,31 +61,43 @@ jobs: run-linting-linux: runs-on: ubuntu-latest + strategy: + matrix: + include: + - toolchain: stable + - toolchain: nightly steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 - name: 'Setup Rust' run: | curl -sSf https://sh.rustup.rs | sh -s -- -y - rustup component add clippy - rustup component add rustfmt + rustup toolchain install ${{matrix.toolchain}} + rustup +${{matrix.toolchain}} component add clippy + rustup +${{matrix.toolchain}} component add rustfmt - name: 'Install environment packages' run: | sudo apt-get update -qqy sudo apt-get install jq protobuf-compiler cmake - name: 'Check Format' - run: cargo fmt --all -- --check + run: cargo +${{matrix.toolchain}} fmt --all -- --check - name: 'Run Linter' - run: cargo clippy --all -- -D warnings + run: cargo +${{matrix.toolchain}} clippy --all -- -D warnings run-test-suite-linux: runs-on: ubuntu-latest + strategy: + matrix: + include: + - toolchain: stable + - toolchain: nightly steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 - name: 'Setup Rust' run: | curl -sSf https://sh.rustup.rs | sh -s -- -y + rustup toolchain install ${{matrix.toolchain}} - name: 'Install environment packages' run: | sudo apt-get update -qqy @@ -96,7 +108,7 @@ jobs: ipfs_version: v0.17.0 run_daemon: true - name: 'Run Rust native target tests' - run: NOOSPHERE_LOG=deafening cargo test --features test-kubo,headers + run: NOOSPHERE_LOG=deafening cargo +${{matrix.toolchain}} test --features test-kubo,headers run-test-suite-linux-rocksdb: runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index d2cc1e7db..90e37fa42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4779,8 +4779,7 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "safer-ffi" version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c1d19b288ca9898cd421c7b105fb7269918a7f8e9253a991e228981ca421ad" +source = "git+https://github.com/jsantell/safer_ffi?branch=fix-190#3b829b4f6998c7a394989e8bf06c61378c737e4d" dependencies = [ "inventory", "libc", @@ -4796,8 +4795,7 @@ dependencies = [ [[package]] name = "safer_ffi-proc_macros" version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d7a04caa3ca2224f5ea4ddd850e2629c3b36b2b83621f87a8303bf41020110" +source = "git+https://github.com/jsantell/safer_ffi?branch=fix-190#3b829b4f6998c7a394989e8bf06c61378c737e4d" dependencies = [ "macro_rules_attribute", "prettyplease 0.1.25", diff --git a/rust/noosphere-gateway/src/handlers/v0alpha2/push.rs b/rust/noosphere-gateway/src/handlers/v0alpha2/push.rs index 06fdc442d..769e3c068 100644 --- a/rust/noosphere-gateway/src/handlers/v0alpha2/push.rs +++ b/rust/noosphere-gateway/src/handlers/v0alpha2/push.rs @@ -50,7 +50,7 @@ pub async fn push_route( stream: BodyStream, ) -> Result>>, GatewayErrorResponse> where - C: HasMutableSphereContext, + for<'a> C: HasMutableSphereContext + 'a, S: Storage + 'static, { debug!("Invoking push route..."); diff --git a/rust/noosphere/Cargo.toml b/rust/noosphere/Cargo.toml index 525e4269d..e9db3b4a0 100644 --- a/rust/noosphere/Cargo.toml +++ b/rust/noosphere/Cargo.toml @@ -73,7 +73,7 @@ features = [ ] [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -safer-ffi = { version = "0.1.2", features = ["proc_macros", "python-headers"] } +safer-ffi = { git = "https://github.com/jsantell/safer_ffi", branch = "fix-190", features = ["proc_macros", "python-headers"] } tokio = { workspace = true, features = ["full"] } [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] diff --git a/rust/noosphere/src/ffi/mod.rs b/rust/noosphere/src/ffi/mod.rs index 4d7c26378..cd28e23fb 100644 --- a/rust/noosphere/src/ffi/mod.rs +++ b/rust/noosphere/src/ffi/mod.rs @@ -1,5 +1,5 @@ // TODO(getditto/safer_ffi#181): Re-enable this lint -#![allow(clippy::incorrect_clone_impl_on_copy_type, non_snake_case)] +#![allow(clippy::non_canonical_clone_impl, non_snake_case)] //! This module defins a C FFI for Noosphere, suitable for cross-language //! embedding on many different targets