Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into server-ffi
Browse files Browse the repository at this point in the history
  • Loading branch information
bossmc committed Oct 12, 2023
2 parents f5c283c + f86c4b5 commit 9b4c651
Show file tree
Hide file tree
Showing 89 changed files with 2,947 additions and 879 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: seanmonstar
118 changes: 69 additions & 49 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
- ffi
- ffi-header
- doc
- check-external-types
- udeps
steps:
- run: exit 0

Expand All @@ -32,18 +34,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: cargo fmt --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: |
if ! rustfmt --check --edition 2021 $(git ls-files '*.rs'); then
printf "Please run \`rustfmt --edition 2021 \$(git ls-files '*.rs')\` to fix rustfmt errors.\nSee CONTRIBUTING.md for more details.\n" >&2
exit 1
fi
test:
name: Test ${{ matrix.rust }} on ${{ matrix.os }}
Expand Down Expand Up @@ -73,25 +76,19 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Rust (${{ matrix.rust }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.features }}
run: cargo test ${{ matrix.features }}

- name: Test all benches
if: matrix.benches
uses: actions-rs/cargo@v1
with:
command: test
args: --benches ${{ matrix.features }}
run: cargo test --benches ${{ matrix.features }}

msrv:
name: Check MSRV
Expand All @@ -101,7 +98,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get MSRV from package metadata
id: msrv
Expand All @@ -113,10 +110,7 @@ jobs:
toolchain: ${{ steps.msrv.outputs.version }}

- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --features full
run: cargo check --features full

miri:
name: Test with Miri
Expand All @@ -125,7 +119,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
Expand All @@ -142,76 +136,65 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
uses: dtolnay/rust-toolchain@stable

- name: Install cargo-hack
run: cargo install cargo-hack
uses: taiki-e/install-action@cargo-hack

- name: check --feature-powerset
run: cargo hack check --feature-powerset --depth 2 --skip ffi -Z avoid-dev-deps
run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --skip ffi,tracing

ffi:
name: Test C API (FFI)
needs: [style]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Build FFI
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: --cfg hyper_unstable_ffi
with:
command: rustc
args: --features ffi --crate-type cdylib --release
run: cargo rustc --features ffi --crate-type cdylib --release

- name: Make Examples
run: cd capi/examples && make

- name: Run FFI unit tests
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: --cfg hyper_unstable_ffi
with:
command: test
args: --features ffi --lib
run: cargo test --features ffi --lib

ffi-header:
name: Verify hyper.h is up to date
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
uses: dtolnay/rust-toolchain@stable

- name: Install cbindgen
uses: actions-rs/cargo@v1
uses: taiki-e/cache-cargo-install-action@v1
with:
command: install
args: cbindgen
tool: cbindgen

- name: Install cargo-expand
uses: actions-rs/cargo@v1
uses: taiki-e/cache-cargo-install-action@v1
with:
command: install
args: cargo-expand
tool: cargo-expand

- name: Build FFI
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: --cfg hyper_unstable_ffi
with:
command: build
args: --features client,http1,http2,ffi
run: cargo build --features client,http1,http2,ffi

- name: Ensure that hyper.h is up to date
run: ./capi/gen_header.sh --verify
Expand All @@ -222,13 +205,50 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@nightly

- name: cargo doc
uses: actions-rs/cargo@v1
run: cargo rustdoc --features full,ffi -- --cfg docsrs --cfg hyper_unstable_ffi -D broken-intra-doc-links

check-external-types:
name: Check exposed types
needs: [style, test]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2023-05-31 # Compatible version for cargo-check-external-types

- name: Install cargo-check-external-types
uses: taiki-e/cache-cargo-install-action@v1
with:
command: rustdoc
args: --features full,ffi -- --cfg docsrs --cfg hyper_unstable_ffi -D broken-intra-doc-links
tool: [email protected]

- name: check-external-types
run: cargo check-external-types --config .github/workflows/external-types.toml

udeps:
needs: [style]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@nightly

- name: Install cargo-udeps
uses: taiki-e/install-action@cargo-udeps

- name: Check unused dependencies on default features
run: cargo udeps

- name: Check unused dependencies on full features
run: cargo udeps --features full
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
#- end_to_end
#- pipeline
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/external-types.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
allowed_external_types = [
"bytes::buf::buf_impl::Buf",
"bytes::bytes::Bytes",
"http::header",
"http::header::map::HeaderMap",
"http::method::Method",
"http::request::Request",
"http::response::Response",
"http::status::StatusCode",
"http::uri::Uri",
"http::version::Version",
"http_body::Body",
"http_body::frame::Frame",
"http_body::size_hint::SizeHint",
]
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
### v1.0.0-rc.4 (2023-07-10)


#### Bug Fixes

* **http1:**
* http1 server graceful shutdown fix (#3261) ([f4b51300](https://github.com/hyperium/hyper/commit/f4b513009d81083081d1c60c1981847bbb17dd5d))
* send error on Incoming body when connection errors (#3256) ([52f19259](https://github.com/hyperium/hyper/commit/52f192593fb9ebcf6d3894e0c85cbf710da4decd), closes [#3253](https://github.com/hyperium/hyper/issues/3253))
* properly end chunked bodies when it was known to be empty (#3254) ([fec64cf0](https://github.com/hyperium/hyper/commit/fec64cf0abdc678e30ca5f1b310c5118b2e01999), closes [#3252](https://github.com/hyperium/hyper/issues/3252))


#### Features

* **client:** Make clients able to use non-Send executor (#3184) ([d977f209](https://github.com/hyperium/hyper/commit/d977f209bc6068d8f878b22803fc42d90c887fcc), closes [#3017](https://github.com/hyperium/hyper/issues/3017))
* **rt:**
* replace IO traits with hyper::rt ones (#3230) ([f9f65b7a](https://github.com/hyperium/hyper/commit/f9f65b7aa67fa3ec0267fe015945973726285bc2), closes [#3110](https://github.com/hyperium/hyper/issues/3110))
* add downcast on `Sleep` trait (#3125) ([d92d3917](https://github.com/hyperium/hyper/commit/d92d3917d950e4c61c37c2170f3ce273d2a0f7d1), closes [#3027](https://github.com/hyperium/hyper/issues/3027))
* **service:** change Service::call to take &self (#3223) ([d894439e](https://github.com/hyperium/hyper/commit/d894439e009aa75103f6382a7ba98fb17da72f02), closes [#3040](https://github.com/hyperium/hyper/issues/3040))


#### Breaking Changes

* Any IO transport type provided must not implement `hyper::rt::{Read, Write}` instead of
`tokio::io` traits. You can grab a helper type from `hyper-util` to wrap Tokio types, or implement the traits yourself,
if it's a custom type.
([f9f65b7a](https://github.com/hyperium/hyper/commit/f9f65b7aa67fa3ec0267fe015945973726285bc2))
* `client::conn::http2` types now use another generic for an `Executor`.
Code that names `Connection` needs to include the additional generic parameter.
([d977f209](https://github.com/hyperium/hyper/commit/d977f209bc6068d8f878b22803fc42d90c887fcc))
* The Service::call function no longer takes a mutable reference to self.
The FnMut trait bound on the service::util::service_fn function and the trait bound
on the impl for the ServiceFn struct were changed from FnMut to Fn.

([d894439e](https://github.com/hyperium/hyper/commit/d894439e009aa75103f6382a7ba98fb17da72f02))



### v1.0.0-rc.3 (2023-02-23)


Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ You want to contribute? You're awesome! Don't know where to start? Check the [li

- [Submitting a Pull Request](./docs/PULL_REQUESTS.md#submitting-a-pull-request)
- [Commit Guidelines](./docs/COMMITS.md)

## Cargo fmt
`cargo fmt --all` does not work in hyper. Please use the following commands:
```txt
# Mac or Linux
rustfmt --check --edition 2018 $(git ls-files '*.rs')
# Powershell
Get-ChildItem . -Filter "*.rs" -Recurse | foreach { rustfmt --check --edition 2018 $_.FullName }
```
Loading

0 comments on commit 9b4c651

Please sign in to comment.