Skip to content

Commit 8f513e0

Browse files
committed
Merge branch 'master' into aarch64_regsets
2 parents 5f58d00 + 2a8b438 commit 8f513e0

Some content is hidden

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

88 files changed

+7648
-4779
lines changed

.cirrus.yml

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@ env:
99
RUSTDOCFLAGS: -D warnings
1010
TOOL: cargo
1111
# The MSRV
12-
TOOLCHAIN: 1.46.0
12+
TOOLCHAIN: 1.56.1
1313
ZFLAGS:
1414

1515
# Tests that don't require executing the build binaries
1616
build: &BUILD
1717
build_script:
1818
- . $HOME/.cargo/env || true
19+
- $TOOL +$TOOLCHAIN -Vv
20+
- rustc +$TOOLCHAIN -Vv
1921
- $TOOL +$TOOLCHAIN $BUILD $ZFLAGS --target $TARGET --all-targets
2022
- $TOOL +$TOOLCHAIN doc $ZFLAGS --no-deps --target $TARGET
21-
- $TOOL +$TOOLCHAIN clippy $ZFLAGS --target $TARGET -- -D warnings
22-
- if [ -z "$NOHACK" ]; then $TOOL +$TOOLCHAIN install cargo-hack; fi
23+
- $TOOL +$TOOLCHAIN clippy $ZFLAGS --target $TARGET --all-targets -- -D warnings
24+
- if [ -z "$NOHACK" ]; then mkdir -p $HOME/.cargo/bin; export PATH=$HOME/.cargo/bin:$PATH; fi
25+
- if [ -z "$NOHACK" ]; then curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-${HOST:-$TARGET}.tar.gz | tar xzf - -C ~/.cargo/bin; fi
2326
- if [ -z "$NOHACK" ]; then $TOOL +$TOOLCHAIN hack $ZFLAGS check --target $TARGET --each-feature; fi
2427

2528
# Tests that do require executing the binaries
@@ -34,11 +37,18 @@ test: &TEST
3437
# 64-bit kernel and in a 64-bit environment. Our tests don't execute any of
3538
# the system's binaries, so the environment shouldn't matter.
3639
task:
37-
name: FreeBSD amd64 & i686
3840
env:
3941
TARGET: x86_64-unknown-freebsd
40-
freebsd_instance:
41-
image: freebsd-12-2-release-amd64
42+
matrix:
43+
- name: FreeBSD 12 amd64 & i686
44+
freebsd_instance:
45+
image: freebsd-12-3-release-amd64
46+
- name: FreeBSD 14 amd64 & i686
47+
freebsd_instance:
48+
image_family: freebsd-14-0-snap
49+
# Enable tests that would fail on FreeBSD 12
50+
RUSTFLAGS: --cfg fbsd14 -D warnings
51+
RUSTDOCFLAGS: --cfg fbsd14
4252
setup_script:
4353
- kldload mqueuefs
4454
- fetch https://sh.rustup.rs -o rustup.sh
@@ -55,7 +65,7 @@ task:
5565
- cargo test --target i686-unknown-freebsd
5666
i386_feature_script:
5767
- . $HOME/.cargo/env
58-
- cargo hack check --each-feature --target i686-unknown-freebsd
68+
- if [ -z "$NOHACK" ]; then cargo hack check --each-feature --target i686-unknown-freebsd; fi
5969
before_cache_script: rm -rf $CARGO_HOME/registry/index
6070

6171
# Test macOS x86_64 in a full VM
@@ -80,6 +90,7 @@ task:
8090
env:
8191
RUST_TEST_THREADS: 1 # QEMU works best with 1 thread
8292
HOME: /tmp/home
93+
HOST: x86_64-unknown-linux-gnu
8394
PATH: $HOME/.cargo/bin:$PATH
8495
RUSTFLAGS: --cfg qemu -D warnings
8596
TOOL: cross
@@ -122,7 +133,7 @@ task:
122133
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
123134
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
124135
- . $HOME/.cargo/env
125-
- cargo install cross
136+
- cargo install cross --version 0.2.1 # cross 0.2.2 bumped the MSRV to 1.58.1
126137
- cp Cargo.lock.msrv Cargo.lock
127138
<< : *TEST
128139
before_cache_script: rm -rf $CARGO_HOME/registry/index
@@ -132,18 +143,18 @@ task:
132143
matrix:
133144
- name: Linux aarch64
134145
arm_container:
135-
image: rust:1.46
146+
image: rust:1.56
136147
env:
137148
RUSTFLAGS: --cfg graviton -D warnings
138149
TARGET: aarch64-unknown-linux-gnu
139150
- name: Linux x86_64
140151
container:
141-
image: rust:1.46
152+
image: rust:1.56
142153
env:
143154
TARGET: x86_64-unknown-linux-gnu
144155
- name: Linux x86_64 musl
145156
container:
146-
image: rust:1.46
157+
image: rust:1.56
147158
env:
148159
TARGET: x86_64-unknown-linux-musl
149160
setup_script:
@@ -169,9 +180,10 @@ task:
169180
# Tasks for cross-compiling, but no testing
170181
task:
171182
container:
172-
image: rust:1.46
183+
image: rust:1.56
173184
env:
174185
BUILD: check
186+
HOST: x86_64-unknown-linux-gnu
175187
matrix:
176188
# Cross claims to support Android, but when it tries to run Nix's tests it
177189
# reports undefined symbol references.
@@ -199,27 +211,18 @@ task:
199211
- name: Illumos
200212
env:
201213
TARGET: x86_64-unknown-illumos
202-
# illumos toolchain isn't available via rustup until 1.50
203-
TOOLCHAIN: 1.50.0
204-
container:
205-
image: rust:1.50
206214
# Cross claims to support running tests on iOS, but it actually doesn't.
207215
# https://github.com/rust-embedded/cross/issues/535
208216
- name: iOS aarch64
209217
env:
210218
# cargo hack tries to invoke the iphonesimulator SDK for iOS
211219
NOHACK: 1
212220
TARGET: aarch64-apple-ios
213-
# Rustup only supports cross-building from arbitrary hosts for iOS at
214-
# 1.49.0 and above. Below that it's possible to cross-build from a macOS
215-
# host, but macOS VMs are more expensive than Linux VMs.
216-
TOOLCHAIN: 1.49.0
217221
- name: iOS x86_64
218222
env:
219223
# cargo hack tries to invoke the iphonesimulator SDK for iOS
220224
NOHACK: 1
221225
TARGET: x86_64-apple-ios
222-
TOOLCHAIN: 1.49.0
223226
# Cross testing on powerpc fails with "undefined reference to renameat2".
224227
# Perhaps cross is using too-old a version?
225228
- name: Linux powerpc
@@ -239,10 +242,6 @@ task:
239242
- name: macOS aarch64
240243
env:
241244
TARGET: aarch64-apple-darwin
242-
# macOS aarch64 toolchain isn't available via rustup until 1.49
243-
TOOLCHAIN: 1.49.0
244-
container:
245-
image: rust:1.49
246245
- name: NetBSD x86_64
247246
env:
248247
TARGET: x86_64-unknown-netbsd
@@ -256,11 +255,12 @@ task:
256255

257256
task:
258257
container:
259-
image: rust:1.46
258+
image: rust:1.56
260259
env:
261260
BUILD: check
262261
name: Redox x86_64
263262
env:
263+
HOST: x86_64-unknown-linux-gnu
264264
TARGET: x86_64-unknown-redox
265265
# Redox's MSRV policy is unclear. Until they define it, use nightly.
266266
TOOLCHAIN: nightly
@@ -277,6 +277,7 @@ task:
277277
image: rustlang/rust:nightly
278278
env:
279279
BUILD: check
280+
HOST: x86_64-unknown-linux-gnu
280281
TOOLCHAIN: nightly
281282
ZFLAGS: -Zbuild-std
282283
matrix:
@@ -289,6 +290,9 @@ task:
289290
- name: Linux armv7 uclibceabihf
290291
env:
291292
TARGET: armv7-unknown-linux-uclibceabihf
293+
- name: Haiku x86_64
294+
env:
295+
TARGET: x86_64-unknown-haiku
292296
setup_script:
293297
- rustup component add rust-src
294298
<< : *BUILD
@@ -300,6 +304,7 @@ task:
300304
task:
301305
name: Minver
302306
env:
307+
HOST: x86_64-unknown-linux-gnu
303308
TOOLCHAIN: nightly
304309
container:
305310
image: rustlang/rust:nightly
@@ -308,3 +313,11 @@ task:
308313
check_script:
309314
- cargo check
310315
before_cache_script: rm -rf $CARGO_HOME/registry/index
316+
317+
# Tasks that checks if the code is formatted right using `cargo fmt` tool
318+
task:
319+
name: Rust Formatter
320+
container:
321+
image: rust:latest
322+
setup_script: rustup +$TOOLCHAIN component add rustfmt
323+
test_script: $TOOL +$TOOLCHAIN fmt --all -- --check

CHANGELOG.md

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,97 @@ This project adheres to [Semantic Versioning](https://semver.org/).
66
## [Unreleased] - ReleaseDate
77
### Added
88

9+
### Changed
10+
11+
- The MSRV is now 1.56.1
12+
([#1792](https://github.com/nix-rust/nix/pull/1792))
13+
14+
### Fixed
15+
16+
### Removed
17+
18+
## [0.25.0] - 2022-08-13
19+
### Added
20+
21+
- Added `faccessat`
22+
([#1780](https://github.com/nix-rust/nix/pull/1780))
23+
- Added `memfd` on Android.
24+
(#[1773](https://github.com/nix-rust/nix/pull/1773))
25+
- Added `ETH_P_ALL` to `SockProtocol` enum
26+
(#[1768](https://github.com/nix-rust/nix/pull/1768))
27+
- Added four non-standard Linux `SysconfVar` variants
28+
(#[1761](https://github.com/nix-rust/nix/pull/1761))
29+
- Added const constructors for `TimeSpec` and `TimeVal`
30+
(#[1760](https://github.com/nix-rust/nix/pull/1760))
31+
- Added `chflags`.
32+
(#[1758](https://github.com/nix-rust/nix/pull/1758))
33+
- Added `aio_writev` and `aio_readv`.
34+
(#[1713](https://github.com/nix-rust/nix/pull/1713))
35+
- impl `From<uid_t>` for `Uid` and `From<gid_t>` for `Gid`
36+
(#[1727](https://github.com/nix-rust/nix/pull/1727))
37+
- impl `From<SockaddrIn>` for `std::net::SocketAddrV4` and
38+
impl `From<SockaddrIn6>` for `std::net::SocketAddrV6`.
39+
(#[1711](https://github.com/nix-rust/nix/pull/1711))
40+
- Added support for the `x86_64-unknown-haiku` target.
41+
(#[1703](https://github.com/nix-rust/nix/pull/1703))
42+
- Added `ptrace::read_user` and `ptrace::write_user` for Linux.
43+
(#[1697](https://github.com/nix-rust/nix/pull/1697))
44+
- Added `getrusage` and helper types `UsageWho` and `Usage`
45+
(#[1747](https://github.com/nix-rust/nix/pull/1747))
46+
- Added the `DontRoute` SockOpt
47+
(#[1752](https://github.com/nix-rust/nix/pull/1752))
48+
- Added `signal::SigSet::from_sigset_t_unchecked()`.
49+
(#[1741](https://github.com/nix-rust/nix/pull/1741))
50+
- Added the `Ipv4OrigDstAddr` sockopt and control message.
51+
(#[1772](https://github.com/nix-rust/nix/pull/1772))
52+
- Added the `Ipv6OrigDstAddr` sockopt and control message.
53+
(#[1772](https://github.com/nix-rust/nix/pull/1772))
54+
- Added the `Ipv4SendSrcAddr` control message.
55+
(#[1776](https://github.com/nix-rust/nix/pull/1776))
56+
57+
### Changed
58+
59+
- Rewrote the aio module. The new module:
60+
* Does more type checking at compile time rather than runtime.
61+
* Gives the caller control over whether and when to `Box` an aio operation.
62+
* Changes the type of the `priority` arguments to `i32`.
63+
* Changes the return type of `aio_return` to `usize`.
64+
(#[1713](https://github.com/nix-rust/nix/pull/1713))
65+
- `nix::poll::ppoll`: `sigmask` parameter is now optional.
66+
(#[1739](https://github.com/nix-rust/nix/pull/1739))
67+
- Changed `gethostname` to return an owned `OsString`.
68+
(#[1745](https://github.com/nix-rust/nix/pull/1745))
69+
- `signal:SigSet` is now marked as `repr(transparent)`.
70+
(#[1741](https://github.com/nix-rust/nix/pull/1741))
71+
72+
### Removed
73+
74+
- Removed support for resubmitting partially complete `lio_listio` operations.
75+
It was too complicated, and didn't fit Nix's theme of zero-cost abstractions.
76+
Instead, it can be reimplemented downstream.
77+
(#[1713](https://github.com/nix-rust/nix/pull/1713))
78+
79+
## [0.24.2] - 2022-07-17
80+
### Fixed
81+
82+
- Fixed buffer overflow in `nix::sys::socket::recvfrom`.
83+
(#[1763](https://github.com/nix-rust/nix/pull/1763))
84+
- Enabled `SockaddrStorage::{as_link_addr, as_link_addr_mut}` for Linux-like
85+
operating systems.
86+
(#[1729](https://github.com/nix-rust/nix/pull/1729))
87+
- Fixed `SockaddrLike::from_raw` implementations for `VsockAddr` and
88+
`SysControlAddr`.
89+
(#[1736](https://github.com/nix-rust/nix/pull/1736))
90+
91+
## [0.24.1] - 2022-04-22
92+
### Fixed
93+
94+
- Fixed `UnixAddr::size` on Linux-based OSes.
95+
(#[1702](https://github.com/nix-rust/nix/pull/1702))
96+
97+
## [0.24.0] - 2022-04-21
98+
### Added
99+
9100
- Added fine-grained features flags. Most Nix functionality can now be
10101
conditionally enabled. By default, all features are enabled.
11102
(#[1611](https://github.com/nix-rust/nix/pull/1611))
@@ -112,7 +203,6 @@ This project adheres to [Semantic Versioning](https://semver.org/).
112203

113204
## [0.23.1] - 2021-12-16
114205

115-
### Added
116206
### Changed
117207

118208
- Relaxed the bitflags requirement from 1.3.1 to 1.1. This partially reverts

Cargo.toml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
name = "nix"
33
description = "Rust friendly bindings to *nix APIs"
44
edition = "2018"
5-
version = "0.23.1"
6-
rust-version = "1.46"
5+
version = "0.25.0"
6+
rust-version = "1.56"
77
authors = ["The nix-rust Project Developers"]
88
repository = "https://github.com/nix-rust/nix"
99
license = "MIT"
@@ -27,28 +27,32 @@ targets = [
2727
]
2828

2929
[dependencies]
30-
libc = { version = "0.2.121", features = [ "extra_traits" ] }
30+
libc = { version = "0.2.127", features = [ "extra_traits" ] }
3131
bitflags = "1.1"
3232
cfg-if = "1.0"
33+
pin-utils = { version = "0.1.0", optional = true }
3334

3435
[target.'cfg(not(target_os = "redox"))'.dependencies]
3536
memoffset = { version = "0.6.3", optional = true }
3637

38+
[build-dependencies]
39+
autocfg = "1.1.0"
40+
3741
[features]
3842
default = [
39-
"acct", "aio", "dir", "env", "event", "features", "fs",
43+
"acct", "aio", "dir", "env", "event", "feature", "fs",
4044
"hostname", "inotify", "ioctl", "kmod", "mman", "mount", "mqueue",
4145
"net", "personality", "poll", "process", "pthread", "ptrace", "quota",
4246
"reboot", "resource", "sched", "signal", "socket", "term", "time",
43-
"ucontext", "uio", "users", "zerocopy",
47+
"ucontext", "uio", "user", "zerocopy",
4448
]
4549

4650
acct = []
47-
aio = []
51+
aio = ["pin-utils"]
4852
dir = ["fs"]
4953
env = []
5054
event = []
51-
features = []
55+
feature = []
5256
fs = []
5357
hostname = []
5458
inotify = []
@@ -73,22 +77,22 @@ term = []
7377
time = []
7478
ucontext = ["signal"]
7579
uio = []
76-
users = ["features"]
80+
user = ["feature"]
7781
zerocopy = ["fs", "uio"]
7882

7983
[dev-dependencies]
8084
assert-impl = "0.1"
81-
lazy_static = "1.2"
85+
lazy_static = "1.4"
8286
parking_lot = "0.11.2"
8387
rand = "0.8"
84-
tempfile = "3.2.0"
85-
semver = "1.0.0"
88+
tempfile = "3.3.0"
89+
semver = "1.0.7"
8690

8791
[target.'cfg(any(target_os = "android", target_os = "linux"))'.dev-dependencies]
88-
caps = "0.5.1"
92+
caps = "0.5.3"
8993

9094
[target.'cfg(target_os = "freebsd")'.dev-dependencies]
91-
sysctl = "0.1"
95+
sysctl = "0.4"
9296

9397
[[test]]
9498
name = "test"
@@ -102,10 +106,6 @@ path = "test/sys/test_aio_drop.rs"
102106
name = "test-clearenv"
103107
path = "test/test_clearenv.rs"
104108

105-
[[test]]
106-
name = "test-lio-listio-resubmit"
107-
path = "test/sys/test_lio_listio_resubmit.rs"
108-
109109
[[test]]
110110
name = "test-mount"
111111
path = "test/test_mount.rs"

0 commit comments

Comments
 (0)