Skip to content

Commit 9b4c651

Browse files
committed
Merge remote-tracking branch 'origin/master' into server-ffi
2 parents f5c283c + f86c4b5 commit 9b4c651

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2947
-879
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: seanmonstar

.github/workflows/CI.yml

Lines changed: 69 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
- ffi
2525
- ffi-header
2626
- doc
27+
- check-external-types
28+
- udeps
2729
steps:
2830
- run: exit 0
2931

@@ -32,18 +34,19 @@ jobs:
3234
runs-on: ubuntu-latest
3335
steps:
3436
- name: Checkout
35-
uses: actions/checkout@v3
37+
uses: actions/checkout@v4
3638

3739
- name: Install Rust
3840
uses: dtolnay/rust-toolchain@stable
3941
with:
4042
components: rustfmt
4143

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

7477
steps:
7578
- name: Checkout
76-
uses: actions/checkout@v3
79+
uses: actions/checkout@v4
7780

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

8386
- name: Test
84-
uses: actions-rs/cargo@v1
85-
with:
86-
command: test
87-
args: ${{ matrix.features }}
87+
run: cargo test ${{ matrix.features }}
8888

8989
- name: Test all benches
9090
if: matrix.benches
91-
uses: actions-rs/cargo@v1
92-
with:
93-
command: test
94-
args: --benches ${{ matrix.features }}
91+
run: cargo test --benches ${{ matrix.features }}
9592

9693
msrv:
9794
name: Check MSRV
@@ -101,7 +98,7 @@ jobs:
10198

10299
steps:
103100
- name: Checkout
104-
uses: actions/checkout@v3
101+
uses: actions/checkout@v4
105102

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

115112
- name: Check
116-
uses: actions-rs/cargo@v1
117-
with:
118-
command: check
119-
args: --features full
113+
run: cargo check --features full
120114

121115
miri:
122116
name: Test with Miri
@@ -125,7 +119,7 @@ jobs:
125119

126120
steps:
127121
- name: Checkout
128-
uses: actions/checkout@v3
122+
uses: actions/checkout@v4
129123

130124
- name: Install Rust
131125
uses: dtolnay/rust-toolchain@nightly
@@ -142,76 +136,65 @@ jobs:
142136
runs-on: ubuntu-latest
143137
steps:
144138
- name: Checkout
145-
uses: actions/checkout@v3
139+
uses: actions/checkout@v4
146140

147141
- name: Install Rust
148-
uses: dtolnay/rust-toolchain@nightly
142+
uses: dtolnay/rust-toolchain@stable
149143

150144
- name: Install cargo-hack
151-
run: cargo install cargo-hack
145+
uses: taiki-e/install-action@cargo-hack
152146

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

156150
ffi:
157151
name: Test C API (FFI)
158152
needs: [style]
159153
runs-on: ubuntu-latest
160154
steps:
161155
- name: Checkout
162-
uses: actions/checkout@v3
156+
uses: actions/checkout@v4
163157

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

167161
- name: Build FFI
168-
uses: actions-rs/cargo@v1
169162
env:
170163
RUSTFLAGS: --cfg hyper_unstable_ffi
171-
with:
172-
command: rustc
173-
args: --features ffi --crate-type cdylib --release
164+
run: cargo rustc --features ffi --crate-type cdylib --release
174165

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

178169
- name: Run FFI unit tests
179-
uses: actions-rs/cargo@v1
180170
env:
181171
RUSTFLAGS: --cfg hyper_unstable_ffi
182-
with:
183-
command: test
184-
args: --features ffi --lib
172+
run: cargo test --features ffi --lib
185173

186174
ffi-header:
187175
name: Verify hyper.h is up to date
188176
runs-on: ubuntu-latest
189177
steps:
190178
- name: Checkout
191-
uses: actions/checkout@v3
179+
uses: actions/checkout@v4
192180

193181
- name: Install Rust
194-
uses: dtolnay/rust-toolchain@nightly
182+
uses: dtolnay/rust-toolchain@stable
195183

196184
- name: Install cbindgen
197-
uses: actions-rs/cargo@v1
185+
uses: taiki-e/cache-cargo-install-action@v1
198186
with:
199-
command: install
200-
args: cbindgen
187+
tool: cbindgen
201188

202189
- name: Install cargo-expand
203-
uses: actions-rs/cargo@v1
190+
uses: taiki-e/cache-cargo-install-action@v1
204191
with:
205-
command: install
206-
args: cargo-expand
192+
tool: cargo-expand
207193

208194
- name: Build FFI
209-
uses: actions-rs/cargo@v1
210195
env:
211196
RUSTFLAGS: --cfg hyper_unstable_ffi
212-
with:
213-
command: build
214-
args: --features client,http1,http2,ffi
197+
run: cargo build --features client,http1,http2,ffi
215198

216199
- name: Ensure that hyper.h is up to date
217200
run: ./capi/gen_header.sh --verify
@@ -222,13 +205,50 @@ jobs:
222205
runs-on: ubuntu-latest
223206
steps:
224207
- name: Checkout
225-
uses: actions/checkout@v3
208+
uses: actions/checkout@v4
226209

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

230213
- name: cargo doc
231-
uses: actions-rs/cargo@v1
214+
run: cargo rustdoc --features full,ffi -- --cfg docsrs --cfg hyper_unstable_ffi -D broken-intra-doc-links
215+
216+
check-external-types:
217+
name: Check exposed types
218+
needs: [style, test]
219+
runs-on: ubuntu-latest
220+
steps:
221+
- name: Checkout
222+
uses: actions/checkout@v4
223+
224+
- name: Install Rust
225+
uses: dtolnay/rust-toolchain@master
226+
with:
227+
toolchain: nightly-2023-05-31 # Compatible version for cargo-check-external-types
228+
229+
- name: Install cargo-check-external-types
230+
uses: taiki-e/cache-cargo-install-action@v1
232231
with:
233-
command: rustdoc
234-
args: --features full,ffi -- --cfg docsrs --cfg hyper_unstable_ffi -D broken-intra-doc-links
232+
tool: cargo-check-external-types@0.1.7
233+
234+
- name: check-external-types
235+
run: cargo check-external-types --config .github/workflows/external-types.toml
236+
237+
udeps:
238+
needs: [style]
239+
runs-on: ubuntu-latest
240+
steps:
241+
- name: Checkout
242+
uses: actions/checkout@v4
243+
244+
- name: Install Rust
245+
uses: dtolnay/rust-toolchain@nightly
246+
247+
- name: Install cargo-udeps
248+
uses: taiki-e/install-action@cargo-udeps
249+
250+
- name: Check unused dependencies on default features
251+
run: cargo udeps
252+
253+
- name: Check unused dependencies on full features
254+
run: cargo udeps --features full

.github/workflows/bench.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
#- end_to_end
1616
#- pipeline
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919

2020
- name: Install Rust
2121
uses: dtolnay/rust-toolchain@nightly
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
allowed_external_types = [
2+
"bytes::buf::buf_impl::Buf",
3+
"bytes::bytes::Bytes",
4+
"http::header",
5+
"http::header::map::HeaderMap",
6+
"http::method::Method",
7+
"http::request::Request",
8+
"http::response::Response",
9+
"http::status::StatusCode",
10+
"http::uri::Uri",
11+
"http::version::Version",
12+
"http_body::Body",
13+
"http_body::frame::Frame",
14+
"http_body::size_hint::SizeHint",
15+
]

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
### v1.0.0-rc.4 (2023-07-10)
2+
3+
4+
#### Bug Fixes
5+
6+
* **http1:**
7+
* http1 server graceful shutdown fix (#3261) ([f4b51300](https://github.com/hyperium/hyper/commit/f4b513009d81083081d1c60c1981847bbb17dd5d))
8+
* 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))
9+
* 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))
10+
11+
12+
#### Features
13+
14+
* **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))
15+
* **rt:**
16+
* 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))
17+
* add downcast on `Sleep` trait (#3125) ([d92d3917](https://github.com/hyperium/hyper/commit/d92d3917d950e4c61c37c2170f3ce273d2a0f7d1), closes [#3027](https://github.com/hyperium/hyper/issues/3027))
18+
* **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))
19+
20+
21+
#### Breaking Changes
22+
23+
* Any IO transport type provided must not implement `hyper::rt::{Read, Write}` instead of
24+
`tokio::io` traits. You can grab a helper type from `hyper-util` to wrap Tokio types, or implement the traits yourself,
25+
if it's a custom type.
26+
([f9f65b7a](https://github.com/hyperium/hyper/commit/f9f65b7aa67fa3ec0267fe015945973726285bc2))
27+
* `client::conn::http2` types now use another generic for an `Executor`.
28+
Code that names `Connection` needs to include the additional generic parameter.
29+
([d977f209](https://github.com/hyperium/hyper/commit/d977f209bc6068d8f878b22803fc42d90c887fcc))
30+
* The Service::call function no longer takes a mutable reference to self.
31+
The FnMut trait bound on the service::util::service_fn function and the trait bound
32+
on the impl for the ServiceFn struct were changed from FnMut to Fn.
33+
34+
([d894439e](https://github.com/hyperium/hyper/commit/d894439e009aa75103f6382a7ba98fb17da72f02))
35+
36+
37+
138
### v1.0.0-rc.3 (2023-02-23)
239

340

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,13 @@ You want to contribute? You're awesome! Don't know where to start? Check the [li
99

1010
- [Submitting a Pull Request](./docs/PULL_REQUESTS.md#submitting-a-pull-request)
1111
- [Commit Guidelines](./docs/COMMITS.md)
12+
13+
## Cargo fmt
14+
`cargo fmt --all` does not work in hyper. Please use the following commands:
15+
```txt
16+
# Mac or Linux
17+
rustfmt --check --edition 2018 $(git ls-files '*.rs')
18+
19+
# Powershell
20+
Get-ChildItem . -Filter "*.rs" -Recurse | foreach { rustfmt --check --edition 2018 $_.FullName }
21+
```

0 commit comments

Comments
 (0)