Skip to content

Commit 9c448a4

Browse files
authored
Merge branch 'master' into master
2 parents 7199cf6 + 33291e2 commit 9c448a4

File tree

14 files changed

+3159
-769
lines changed

14 files changed

+3159
-769
lines changed

.cirrus.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
freebsd_instance:
2-
image_family: freebsd-13-0
2+
image: freebsd-13-2-release-amd64
33

44
env:
55
RUST_BACKTRACE: full
66

77
task:
88
name: FreeBSD
99
setup_script:
10-
- pkg install -y curl
11-
- curl https://sh.rustup.rs -sSf --output rustup.sh
10+
- fetch https://sh.rustup.rs -o rustup.sh
1211
- sh rustup.sh -y --profile minimal
1312
cargo_cache:
1413
folder: $HOME/.cargo/registry

.github/workflows/main.yml

Lines changed: 65 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
name: CI
22
on:
33
push:
4-
branches: [ master, "v0.3.x" ]
4+
branches: [ master, "v0.4.x" ]
55
pull_request:
6-
branches: [ master, "v0.3.x" ]
6+
branches: [ master, "v0.4.x" ]
77
env:
88
CARGO_TERM_COLOR: always
99
RUST_BACKTRACE: full
10-
1110
jobs:
1211
Test:
1312
name: Test
@@ -36,49 +35,86 @@ jobs:
3635
os: windows-latest
3736
rust: stable
3837
steps:
39-
- uses: actions/checkout@master
40-
- name: Install Rust (rustup)
41-
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
42-
shell: bash
43-
- name: Install cargo-hack
44-
uses: taiki-e/install-action@cargo-hack
38+
- uses: actions/checkout@v4
39+
- uses: dtolnay/rust-toolchain@master
40+
with:
41+
toolchain: ${{ matrix.rust }}
42+
- uses: taiki-e/install-action@cargo-hack
4543
- name: Run tests
4644
run: cargo hack test --feature-powerset && cargo hack test --feature-powerset --release
47-
4845
Rustfmt:
4946
name: Rustfmt
5047
runs-on: ubuntu-latest
5148
steps:
52-
- uses: actions/checkout@master
53-
- name: Install Rust
54-
run: rustup update stable && rustup default stable && rustup component add rustfmt
49+
- uses: actions/checkout@v4
50+
- uses: dtolnay/rust-toolchain@stable
5551
- name: Check formatting
5652
run: cargo fmt --all -- --check
57-
5853
Check:
59-
name: Check
6054
runs-on: ubuntu-latest
55+
timeout-minutes: 10
6156
strategy:
6257
fail-fast: false
6358
matrix:
64-
target: ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-fuchsia", "x86_64-pc-windows-msvc", "x86_64-pc-solaris", "x86_64-unknown-illumos", "x86_64-unknown-linux-gnu", "x86_64-unknown-netbsd", "x86_64-unknown-redox"]
59+
target:
60+
- aarch64-apple-darwin
61+
- aarch64-apple-ios
62+
- aarch64-apple-tvos
63+
# Broken, see https://github.com/rust-lang/socket2/issues/538.
64+
#- aarch64-apple-visionos
65+
- aarch64-apple-watchos
66+
- aarch64-linux-android
67+
- aarch64-unknown-freebsd
68+
- aarch64-unknown-linux-gnu
69+
- aarch64-unknown-linux-musl
70+
- aarch64-unknown-linux-ohos
71+
- aarch64-unknown-netbsd
72+
- aarch64-unknown-openbsd
73+
- aarch64-unknown-redox
74+
- arm-linux-androideabi
75+
- arm64_32-apple-watchos
76+
- armv7-linux-androideabi
77+
- armv7-sony-vita-newlibeabihf
78+
- armv7-unknown-linux-ohos
79+
- i686-linux-android
80+
# Broken, see https://github.com/rust-lang/socket2/issues/539.
81+
#- i686-unknown-hurd-gnu
82+
- i686-unknown-linux-gnu
83+
- sparcv9-sun-solaris
84+
- x86_64-apple-darwin
85+
- x86_64-apple-ios
86+
- x86_64-pc-solaris
87+
# Fails with:
88+
# `rror calling dlltool 'x86_64-w64-mingw32-dlltool': No such file or
89+
# directory (os error 2)`, build log:
90+
# <https://github.com/rust-lang/socket2/actions/runs/9577808331/job/26406752150>.
91+
#- x86_64-pc-windows-gnu
92+
- x86_64-pc-windows-msvc
93+
- x86_64-unknown-dragonfly
94+
- x86_64-unknown-freebsd
95+
- x86_64-unknown-fuchsia
96+
- x86_64-unknown-illumos
97+
- x86_64-unknown-linux-gnu
98+
- x86_64-unknown-linux-musl
99+
- x86_64-unknown-linux-ohos
100+
- x86_64-unknown-netbsd
101+
- x86_64-unknown-openbsd
102+
- x86_64-unknown-redox
65103
steps:
66-
- uses: actions/checkout@master
67-
- name: Install Rust
68-
run: rustup update stable && rustup default stable
69-
- name: Install Target
70-
run: rustup target add ${{ matrix.target }}
71-
- name: Install cargo-hack
72-
uses: taiki-e/install-action@cargo-hack
73-
- name: Run check
74-
run: cargo hack check --feature-powerset --all-targets --examples --bins --tests --target ${{ matrix.target }}
75-
104+
- uses: actions/checkout@v4
105+
- uses: dtolnay/rust-toolchain@nightly
106+
with:
107+
components: rust-src
108+
- uses: taiki-e/install-action@cargo-hack
109+
- name: Check build
110+
run: cargo hack check -Z build-std=std,panic_abort --feature-powerset --target ${{ matrix.target }}
111+
- name: Check docs
112+
run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc -Z build-std=std,panic_abort --no-deps --all-features --target ${{ matrix.target }}
76113
Clippy:
77114
name: Clippy
78115
runs-on: ubuntu-latest
79116
steps:
80-
- uses: actions/checkout@master
81-
- name: Install Rust
82-
run: rustup update stable && rustup default stable && rustup component add clippy
117+
- uses: actions/checkout@v4
118+
- uses: dtolnay/rust-toolchain@stable
83119
- name: Run Clippy
84120
run: cargo clippy --all-targets --all-features -- -D warnings

CHANGELOG.md

Lines changed: 227 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,227 @@
1-
# 0.4.5
1+
# 0.5.8
2+
3+
* Added `Socket::(set_)header_included_v4` and
4+
`Socket::(set_)header_included_v6`
5+
(https://github.com/rust-lang/socket2/pull/518).
6+
* Added support for `Socket::original_dst` and
7+
`Socket::original_dst_ipv6` on Windows
8+
(https://github.com/rust-lang/socket2/pull/529).
9+
10+
# 0.5.7
11+
12+
* Added `Socket::(set_)passcred`
13+
(https://github.com/rust-lang/socket2/pull/506).
14+
* Added `RecvFlags::is_confirm` and `RecvFlags::is_dontroute`
15+
(https://github.com/rust-lang/socket2/pull/499).
16+
* Added `MsgHdrMut::control_len`
17+
(https://github.com/rust-lang/socket2/pull/505).
18+
19+
# 0.5.6
20+
21+
* Added `Socket::(set_)multicast_all_v{4,6}`
22+
(https://github.com/rust-lang/socket2/pull/485 and
23+
https://github.com/rust-lang/socket2/pull/486).
24+
* Added support for GNU/Hurd
25+
(https://github.com/rust-lang/socket2/pull/474).
26+
* Fixes compilation on Haiku
27+
(https://github.com/rust-lang/socket2/pull/479 and
28+
https://github.com/rust-lang/socket2/pull/482).
29+
* Fixes compilation on OpenHarmony
30+
(https://github.com/rust-lang/socket2/pull/491).
31+
* Update to window-sys v0.52
32+
(https://github.com/rust-lang/socket2/pull/480).
33+
34+
# 0.5.5
35+
36+
* Added support for Vita
37+
(https://github.com/rust-lang/socket2/pull/465).
38+
39+
# 0.5.4
40+
41+
* Deprecated `Socket::(bind_)device_by_index`, replaced by
42+
`Socket::(bind_)device_by_index_v4` for IPv4 sockets
43+
(https://github.com/rust-lang/socket2/pull/432).
44+
* Added `Socket::(bind_)device_by_index_v6`
45+
(https://github.com/rust-lang/socket2/pull/432).
46+
* Added experimental support for the ESP-IDF framework
47+
(https://github.com/rust-lang/socket2/pull/452)
48+
* Added `Socket::{send,recv}msg` and `MsgHdr(Mut)` types, wrapping `sendmsg(2)`
49+
and `recvmsg(2)`
50+
(https://github.com/rust-lang/socket2/pull/447).
51+
* Added `Socket::(set_)reuse_port_lb` to retrieve or set `SO_REUSEPORT_LB` on
52+
FreeBSD
53+
(https://github.com/rust-lang/socket2/pull/442).
54+
* Added `Protocol::DIVERT` on FreeBSD and OpenBSD
55+
(https://github.com/rust-lang/socket2/pull/448).
56+
* Added `Socket::protocol` for Windows (using `WSAPROTOCOL_INFOW`)
57+
(https://github.com/rust-lang/socket2/pull/470).
58+
* `From<SocketAddrV{4,6}>` for `SockAddr ` nows sets `ss_len` on platforms that
59+
have the fields (most BSDs)
60+
(https://github.com/rust-lang/socket2/pull/469).
61+
* Change Windows to use `ADDRESS_FAMILY` for `sa_family_t`, this shouldn't
62+
affect anything in practice
63+
(https://github.com/rust-lang/socket2/pull/463).
64+
65+
# 0.5.3
66+
67+
* Added support for two new Android targets `armv7-linux-androideabi` and
68+
`i686-linux-android` (https://github.com/rust-lang/socket2/pull/434).
69+
* Added `Socket::cookie` to retrieve `SO_COOKIE` on Linux
70+
(https://github.com/rust-lang/socket2/pull/437).
71+
72+
# 0.5.2
73+
74+
* Added Unix socket methods to `SockAddr`
75+
(https://github.com/rust-lang/socket2/pull/403 and
76+
https://github.com/rust-lang/socket2/pull/429).
77+
* Added `SockAddr::as_storage`
78+
(https://github.com/rust-lang/socket2/pull/417).
79+
* Added `SockAddr::set_length`
80+
(https://github.com/rust-lang/socket2/pull/428).
81+
* Added `Protocol::UDPLITE`
82+
(https://github.com/rust-lang/socket2/pull/427).
83+
* Update windows-sys to 0.48
84+
(https://github.com/rust-lang/socket2/pull/422).
85+
* Fixes Fuchsia target after it changes in 1.68, see
86+
<https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1680-2023-03-09>
87+
(https://github.com/rust-lang/socket2/pull/423).
88+
* Fixes musl target and adds it to the CI
89+
(https://github.com/rust-lang/socket2/pull/426).
90+
91+
# 0.5.1
92+
93+
## Added
94+
95+
* `Type::cloexec` for Redox and Solaris
96+
(https://github.com/rust-lang/socket2/pull/398).
97+
* Generate documentation for more targets on docs.rs
98+
(https://github.com/rust-lang/socket2/pull/398).
99+
100+
## Fixed
101+
102+
* Generatation of documentation on docs.rs
103+
(https://github.com/rust-lang/socket2/pull/398).
104+
105+
# 0.5.0
106+
107+
## Changed
108+
109+
* **BREAKING** `SockAddr::init` is renamed to `try_init` to indicate it can fail
110+
(https://github.com/rust-lang/socket2/pull/328).
111+
* **BREAKING** Remove the returned `Result` from `SockAddr::vsock`, it can't
112+
fail (https://github.com/rust-lang/socket2/pull/328).
113+
* **BREAKING** `From<S>` is now implemented using the I/O traits `AsFd` and
114+
`AsRawSocket`
115+
(https://github.com/rust-lang/socket2/pull/325):
116+
* **BREAKING** renamed `SockAddr::vsock_addr` `SockAddr::as_vsock_addr` to match
117+
the IPv4 and IPv6 methods
118+
(https://github.com/rust-lang/socket2/pull/334).
119+
* Redox now works on a stable compiler
120+
(https://github.com/rust-lang/socket2/pull/326).
121+
* Remove copy from `From<SocketAddrV{4,6}>` implementation for `SockAddr`
122+
(https://github.com/rust-lang/socket2/pull/335).
123+
* Marked function as constant where possible.
124+
* Updated to Rust edition 2021
125+
(https://github.com/rust-lang/socket2/pull/393).
126+
127+
## Added
128+
129+
* Links to OS documentation to a lot of methods
130+
(https://github.com/rust-lang/socket2/pull/319).
131+
* I/O-safety traits (https://github.com/rust-lang/socket2/pull/325):
132+
* `AsFd` for `Socket` (Unix only).
133+
* `From<OwnedFd>` for `Socket` (Unix only).
134+
* `From<Socket>` for `OwnedFd` (Unix only).
135+
* `AsSocket` for `Socket` (Windows only).
136+
* `From<OwnedSocket>` for `Socket` (Windows only).
137+
* `From<Socket>` for `OwnedSocket` (Windows only).
138+
* Unix socket support on Windows
139+
(https://github.com/rust-lang/socket2/pull/249).
140+
* `SockAddr::is_ipv{4,6}` and `SockAddr::domain`
141+
(https://github.com/rust-lang/socket2/pull/334).
142+
* `Socket::nonblocking`
143+
(https://github.com/rust-lang/socket2/pull/348).
144+
* `Socket::original_dst(_ipv6)`
145+
(https://github.com/rust-lang/socket2/pull/360).
146+
* `Socket::(set_)recv_tclass_v6` and `Socket::(set_)tclass_v6`
147+
(https://github.com/rust-lang/socket2/pull/364).
148+
* `Socket::(set_)tcp_congestion`
149+
(https://github.com/rust-lang/socket2/pull/371).
150+
* Support for various DCCP socket options in the form of
151+
(https://github.com/rust-lang/socket2/pull/359):
152+
* `Socket::(set_)dccp_service`
153+
* `Socket::dccp_available_ccids`
154+
* `Socket::dccp_qpolicy_txqlen`
155+
* `Socket::dccp_recv_cscov`
156+
* `Socket::dccp_send_cscov`
157+
* `Socket::dccp_server_timewait`
158+
* `Socket::dccp_server_timewait`
159+
* `Socket::dccp_tx_ccid`
160+
* `Socket::dccp_xx_ccid`
161+
* `Socket::set_dccp_ccid`
162+
* `Socket::set_dccp_qpolicy_txqlen`
163+
* `Socket::set_dccp_recv_cscov`
164+
* `Socket::set_dccp_send_cscov`
165+
* `Socket::set_dccp_server_timewait`
166+
* `Socket::dccp_cur_mps`
167+
* `Socket::peek_send`
168+
(https://github.com/rust-lang/socket2/pull/389).
169+
* `Protocol::MPTCP`
170+
(https://github.com/rust-lang/socket2/pull/349).
171+
* `Protocol::SCTP`
172+
(https://github.com/rust-lang/socket2/pull/356).
173+
* `Protocol::DCCP`
174+
(https://github.com/rust-lang/socket2/pull/359).
175+
* `Type::DCCP`
176+
(https://github.com/rust-lang/socket2/pull/359).
177+
* Implement `Eq` and `Hash` for `SockAddr`
178+
(https://github.com/rust-lang/socket2/pull/374).
179+
* Support for QNX Neutrino
180+
(https://github.com/rust-lang/socket2/pull/380).
181+
* Support for AIX
182+
(https://github.com/rust-lang/socket2/pull/351).
183+
184+
# 0.4.10
185+
186+
* Fixed compilation with the `all` on QNX Neutrino
187+
(https://github.com/rust-lang/socket2/pull/419).
188+
* Added support for ESP-IDF
189+
(https://github.com/rust-lang/socket2/pull/455).
190+
* Added support for Vita
191+
(https://github.com/rust-lang/socket2/pull/475).
192+
193+
# 0.4.9
194+
195+
* Fixed compilation on Windows
196+
(https://github.com/rust-lang/socket2/pull/409).
197+
198+
# 0.4.8 (yanked)
199+
200+
This release was broken for Windows.
201+
202+
* Added `Socket::peek_sender` (backport)
203+
(https://github.com/rust-lang/socket2/pull/404).
204+
205+
# 0.4.7
206+
207+
* Fixes compilation on OpenBSD
208+
(https://github.com/rust-lang/socket2/pull/344).
209+
* Fixes compilation on DragonFlyBSD
210+
(https://github.com/rust-lang/socket2/pull/342).
211+
212+
# 0.4.6
213+
214+
* Reverted back to the `winapi` dependency as switch to `windows-sys` was a
215+
breaking change (https://github.com/rust-lang/socket2/pull/340).
216+
Note that we'll will switch to `windows-sys` in v0.5 .
217+
* Disable RECVTOS on OpenBSD
218+
(https://github.com/rust-lang/socket2/pull/307).
219+
* Derive Clone for SockAddr
220+
(https://github.com/rust-lang/socket2/pull/311).
221+
* Fixes cfg attributes for Fuchsia
222+
(https://github.com/rust-lang/socket2/pull/314).
223+
224+
# 0.4.5 (yanked)
2225

3226
## Changed
4227

@@ -14,7 +237,7 @@
14237

15238
## Fixed
16239

17-
* Fix OpenBSD build
240+
* OpenBSD build
18241
(https://github.com/rust-lang/socket2/pull/291).
19242

20243
# 0.4.4
@@ -59,13 +282,13 @@
59282

60283
## Added
61284

62-
* Add `SockAddr::new`
285+
* Added `SockAddr::new`
63286
* Support for `TCP_USER_TIMEOUT`.
64287
* Support for `IP_BOUND_IF`.
65288
* Support for `IP_TRANSPARENT`.
66289
* Enable `Socket::type` on all platforms.
67290
* Support for uclibc (for Haiku support).
68-
* Add DragonFly support for TCP keepalive (`KEEPINTVL`/`KEEPCNT`).
291+
* Added DragonFly support for TCP keepalive (`KEEPINTVL`/`KEEPCNT`).
69292
* Documentation for proper use of `SockRef::from`, and the improper use.
70293
* Assertion in `SockRef::from` to ensure the raw socket valid.
71294

0 commit comments

Comments
 (0)