Skip to content

Commit

Permalink
Support custom derives on Request and Response
Browse files Browse the repository at this point in the history
Replace the bespoke "derive_serde" with a more flexible
"derive = [<path>, <path>, ...]" form.

Deprecate the old "derive_serde" form, and emit deprecation warnings.

Add trybuild tests in a separate test crate to ensure the deprecation,
features, and error messages all behave as expected. This technique of a
separate trybuild test crate is borrowed from tokio/tests-build.
Update CI to run this new crate's tests under the serde matrix.
  • Loading branch information
ShaneMurphy2 committed Feb 24, 2024
1 parent 67cb619 commit 5c1d3a0
Show file tree
Hide file tree
Showing 18 changed files with 423 additions and 71 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ jobs:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: >
cargo test --manifest-path tarpc/Cargo.toml
${{ matrix.serde }} ${{ matrix.tokio }} ${{ matrix.serde-transport }}
${{ matrix.serde-transport-json }} ${{ matrix.serde-transport-bincode }}
${{ matrix.tcp }} ${{ matrix.unix }}
- run: |
cargo test --manifest-path tarpc/Cargo.toml \
${{ matrix.serde }} ${{ matrix.tokio }} ${{ matrix.serde-transport }} \
${{ matrix.serde-transport-json }} ${{ matrix.serde-transport-bincode }} \
${{ matrix.tcp }} ${{ matrix.unix }} \
cargo test --manifest-path tests-build/Cargo.toml $ {{ matrix.serde }}
list-examples:
name: List Examples
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"example-service",
"tarpc",
"plugins",
"tests-build",
]

[profile.dev]
Expand Down
1 change: 1 addition & 0 deletions plugins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ travis-ci = { repository = "google/tarpc" }
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "2.0", features = ["full"] }
proc-macro-warning = "1"

[lib]
proc-macro = true
Expand Down
Loading

0 comments on commit 5c1d3a0

Please sign in to comment.