Skip to content

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
irgstg committed Aug 20, 2022
2 parents 5f58d00 + 2a8b438 commit 280d505
Show file tree
Hide file tree
Showing 88 changed files with 7,634 additions and 4,770 deletions.
65 changes: 39 additions & 26 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ env:
RUSTDOCFLAGS: -D warnings
TOOL: cargo
# The MSRV
TOOLCHAIN: 1.46.0
TOOLCHAIN: 1.56.1
ZFLAGS:

# Tests that don't require executing the build binaries
build: &BUILD
build_script:
- . $HOME/.cargo/env || true
- $TOOL +$TOOLCHAIN -Vv
- rustc +$TOOLCHAIN -Vv
- $TOOL +$TOOLCHAIN $BUILD $ZFLAGS --target $TARGET --all-targets
- $TOOL +$TOOLCHAIN doc $ZFLAGS --no-deps --target $TARGET
- $TOOL +$TOOLCHAIN clippy $ZFLAGS --target $TARGET -- -D warnings
- if [ -z "$NOHACK" ]; then $TOOL +$TOOLCHAIN install cargo-hack; fi
- $TOOL +$TOOLCHAIN clippy $ZFLAGS --target $TARGET --all-targets -- -D warnings
- if [ -z "$NOHACK" ]; then mkdir -p $HOME/.cargo/bin; export PATH=$HOME/.cargo/bin:$PATH; fi
- 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
- if [ -z "$NOHACK" ]; then $TOOL +$TOOLCHAIN hack $ZFLAGS check --target $TARGET --each-feature; fi

# Tests that do require executing the binaries
Expand All @@ -34,11 +37,18 @@ test: &TEST
# 64-bit kernel and in a 64-bit environment. Our tests don't execute any of
# the system's binaries, so the environment shouldn't matter.
task:
name: FreeBSD amd64 & i686
env:
TARGET: x86_64-unknown-freebsd
freebsd_instance:
image: freebsd-12-2-release-amd64
matrix:
- name: FreeBSD 12 amd64 & i686
freebsd_instance:
image: freebsd-12-3-release-amd64
- name: FreeBSD 14 amd64 & i686
freebsd_instance:
image_family: freebsd-14-0-snap
# Enable tests that would fail on FreeBSD 12
RUSTFLAGS: --cfg fbsd14 -D warnings
RUSTDOCFLAGS: --cfg fbsd14
setup_script:
- kldload mqueuefs
- fetch https://sh.rustup.rs -o rustup.sh
Expand All @@ -55,7 +65,7 @@ task:
- cargo test --target i686-unknown-freebsd
i386_feature_script:
- . $HOME/.cargo/env
- cargo hack check --each-feature --target i686-unknown-freebsd
- if [ -z "$NOHACK" ]; then cargo hack check --each-feature --target i686-unknown-freebsd; fi
before_cache_script: rm -rf $CARGO_HOME/registry/index

# Test macOS x86_64 in a full VM
Expand All @@ -80,6 +90,7 @@ task:
env:
RUST_TEST_THREADS: 1 # QEMU works best with 1 thread
HOME: /tmp/home
HOST: x86_64-unknown-linux-gnu
PATH: $HOME/.cargo/bin:$PATH
RUSTFLAGS: --cfg qemu -D warnings
TOOL: cross
Expand Down Expand Up @@ -122,7 +133,7 @@ task:
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
- . $HOME/.cargo/env
- cargo install cross
- cargo install cross --version 0.2.1 # cross 0.2.2 bumped the MSRV to 1.58.1
- cp Cargo.lock.msrv Cargo.lock
<< : *TEST
before_cache_script: rm -rf $CARGO_HOME/registry/index
Expand All @@ -132,18 +143,18 @@ task:
matrix:
- name: Linux aarch64
arm_container:
image: rust:1.46
image: rust:1.56
env:
RUSTFLAGS: --cfg graviton -D warnings
TARGET: aarch64-unknown-linux-gnu
- name: Linux x86_64
container:
image: rust:1.46
image: rust:1.56
env:
TARGET: x86_64-unknown-linux-gnu
- name: Linux x86_64 musl
container:
image: rust:1.46
image: rust:1.56
env:
TARGET: x86_64-unknown-linux-musl
setup_script:
Expand All @@ -169,9 +180,10 @@ task:
# Tasks for cross-compiling, but no testing
task:
container:
image: rust:1.46
image: rust:1.56
env:
BUILD: check
HOST: x86_64-unknown-linux-gnu
matrix:
# Cross claims to support Android, but when it tries to run Nix's tests it
# reports undefined symbol references.
Expand Down Expand Up @@ -199,27 +211,18 @@ task:
- name: Illumos
env:
TARGET: x86_64-unknown-illumos
# illumos toolchain isn't available via rustup until 1.50
TOOLCHAIN: 1.50.0
container:
image: rust:1.50
# Cross claims to support running tests on iOS, but it actually doesn't.
# https://github.com/rust-embedded/cross/issues/535
- name: iOS aarch64
env:
# cargo hack tries to invoke the iphonesimulator SDK for iOS
NOHACK: 1
TARGET: aarch64-apple-ios
# Rustup only supports cross-building from arbitrary hosts for iOS at
# 1.49.0 and above. Below that it's possible to cross-build from a macOS
# host, but macOS VMs are more expensive than Linux VMs.
TOOLCHAIN: 1.49.0
- name: iOS x86_64
env:
# cargo hack tries to invoke the iphonesimulator SDK for iOS
NOHACK: 1
TARGET: x86_64-apple-ios
TOOLCHAIN: 1.49.0
# Cross testing on powerpc fails with "undefined reference to renameat2".
# Perhaps cross is using too-old a version?
- name: Linux powerpc
Expand All @@ -239,10 +242,6 @@ task:
- name: macOS aarch64
env:
TARGET: aarch64-apple-darwin
# macOS aarch64 toolchain isn't available via rustup until 1.49
TOOLCHAIN: 1.49.0
container:
image: rust:1.49
- name: NetBSD x86_64
env:
TARGET: x86_64-unknown-netbsd
Expand All @@ -256,11 +255,12 @@ task:

task:
container:
image: rust:1.46
image: rust:1.56
env:
BUILD: check
name: Redox x86_64
env:
HOST: x86_64-unknown-linux-gnu
TARGET: x86_64-unknown-redox
# Redox's MSRV policy is unclear. Until they define it, use nightly.
TOOLCHAIN: nightly
Expand All @@ -277,6 +277,7 @@ task:
image: rustlang/rust:nightly
env:
BUILD: check
HOST: x86_64-unknown-linux-gnu
TOOLCHAIN: nightly
ZFLAGS: -Zbuild-std
matrix:
Expand All @@ -289,6 +290,9 @@ task:
- name: Linux armv7 uclibceabihf
env:
TARGET: armv7-unknown-linux-uclibceabihf
- name: Haiku x86_64
env:
TARGET: x86_64-unknown-haiku
setup_script:
- rustup component add rust-src
<< : *BUILD
Expand All @@ -300,6 +304,7 @@ task:
task:
name: Minver
env:
HOST: x86_64-unknown-linux-gnu
TOOLCHAIN: nightly
container:
image: rustlang/rust:nightly
Expand All @@ -308,3 +313,11 @@ task:
check_script:
- cargo check
before_cache_script: rm -rf $CARGO_HOME/registry/index

# Tasks that checks if the code is formatted right using `cargo fmt` tool
task:
name: Rust Formatter
container:
image: rust:latest
setup_script: rustup +$TOOLCHAIN component add rustfmt
test_script: $TOOL +$TOOLCHAIN fmt --all -- --check
92 changes: 91 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,97 @@ This project adheres to [Semantic Versioning](https://semver.org/).
## [Unreleased] - ReleaseDate
### Added

### Changed

- The MSRV is now 1.56.1
([#1792](https://github.com/nix-rust/nix/pull/1792))

### Fixed

### Removed

## [0.25.0] - 2022-08-13
### Added

- Added `faccessat`
([#1780](https://github.com/nix-rust/nix/pull/1780))
- Added `memfd` on Android.
(#[1773](https://github.com/nix-rust/nix/pull/1773))
- Added `ETH_P_ALL` to `SockProtocol` enum
(#[1768](https://github.com/nix-rust/nix/pull/1768))
- Added four non-standard Linux `SysconfVar` variants
(#[1761](https://github.com/nix-rust/nix/pull/1761))
- Added const constructors for `TimeSpec` and `TimeVal`
(#[1760](https://github.com/nix-rust/nix/pull/1760))
- Added `chflags`.
(#[1758](https://github.com/nix-rust/nix/pull/1758))
- Added `aio_writev` and `aio_readv`.
(#[1713](https://github.com/nix-rust/nix/pull/1713))
- impl `From<uid_t>` for `Uid` and `From<gid_t>` for `Gid`
(#[1727](https://github.com/nix-rust/nix/pull/1727))
- impl `From<SockaddrIn>` for `std::net::SocketAddrV4` and
impl `From<SockaddrIn6>` for `std::net::SocketAddrV6`.
(#[1711](https://github.com/nix-rust/nix/pull/1711))
- Added support for the `x86_64-unknown-haiku` target.
(#[1703](https://github.com/nix-rust/nix/pull/1703))
- Added `ptrace::read_user` and `ptrace::write_user` for Linux.
(#[1697](https://github.com/nix-rust/nix/pull/1697))
- Added `getrusage` and helper types `UsageWho` and `Usage`
(#[1747](https://github.com/nix-rust/nix/pull/1747))
- Added the `DontRoute` SockOpt
(#[1752](https://github.com/nix-rust/nix/pull/1752))
- Added `signal::SigSet::from_sigset_t_unchecked()`.
(#[1741](https://github.com/nix-rust/nix/pull/1741))
- Added the `Ipv4OrigDstAddr` sockopt and control message.
(#[1772](https://github.com/nix-rust/nix/pull/1772))
- Added the `Ipv6OrigDstAddr` sockopt and control message.
(#[1772](https://github.com/nix-rust/nix/pull/1772))
- Added the `Ipv4SendSrcAddr` control message.
(#[1776](https://github.com/nix-rust/nix/pull/1776))

### Changed

- Rewrote the aio module. The new module:
* Does more type checking at compile time rather than runtime.
* Gives the caller control over whether and when to `Box` an aio operation.
* Changes the type of the `priority` arguments to `i32`.
* Changes the return type of `aio_return` to `usize`.
(#[1713](https://github.com/nix-rust/nix/pull/1713))
- `nix::poll::ppoll`: `sigmask` parameter is now optional.
(#[1739](https://github.com/nix-rust/nix/pull/1739))
- Changed `gethostname` to return an owned `OsString`.
(#[1745](https://github.com/nix-rust/nix/pull/1745))
- `signal:SigSet` is now marked as `repr(transparent)`.
(#[1741](https://github.com/nix-rust/nix/pull/1741))

### Removed

- Removed support for resubmitting partially complete `lio_listio` operations.
It was too complicated, and didn't fit Nix's theme of zero-cost abstractions.
Instead, it can be reimplemented downstream.
(#[1713](https://github.com/nix-rust/nix/pull/1713))

## [0.24.2] - 2022-07-17
### Fixed

- Fixed buffer overflow in `nix::sys::socket::recvfrom`.
(#[1763](https://github.com/nix-rust/nix/pull/1763))
- Enabled `SockaddrStorage::{as_link_addr, as_link_addr_mut}` for Linux-like
operating systems.
(#[1729](https://github.com/nix-rust/nix/pull/1729))
- Fixed `SockaddrLike::from_raw` implementations for `VsockAddr` and
`SysControlAddr`.
(#[1736](https://github.com/nix-rust/nix/pull/1736))

## [0.24.1] - 2022-04-22
### Fixed

- Fixed `UnixAddr::size` on Linux-based OSes.
(#[1702](https://github.com/nix-rust/nix/pull/1702))

## [0.24.0] - 2022-04-21
### Added

- Added fine-grained features flags. Most Nix functionality can now be
conditionally enabled. By default, all features are enabled.
(#[1611](https://github.com/nix-rust/nix/pull/1611))
Expand Down Expand Up @@ -112,7 +203,6 @@ This project adheres to [Semantic Versioning](https://semver.org/).

## [0.23.1] - 2021-12-16

### Added
### Changed

- Relaxed the bitflags requirement from 1.3.1 to 1.1. This partially reverts
Expand Down
34 changes: 17 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "nix"
description = "Rust friendly bindings to *nix APIs"
edition = "2018"
version = "0.23.1"
rust-version = "1.46"
version = "0.25.0"
rust-version = "1.56"
authors = ["The nix-rust Project Developers"]
repository = "https://github.com/nix-rust/nix"
license = "MIT"
Expand All @@ -27,28 +27,32 @@ targets = [
]

[dependencies]
libc = { version = "0.2.121", features = [ "extra_traits" ] }
libc = { version = "0.2.127", features = [ "extra_traits" ] }
bitflags = "1.1"
cfg-if = "1.0"
pin-utils = { version = "0.1.0", optional = true }

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

[build-dependencies]
autocfg = "1.1.0"

[features]
default = [
"acct", "aio", "dir", "env", "event", "features", "fs",
"acct", "aio", "dir", "env", "event", "feature", "fs",
"hostname", "inotify", "ioctl", "kmod", "mman", "mount", "mqueue",
"net", "personality", "poll", "process", "pthread", "ptrace", "quota",
"reboot", "resource", "sched", "signal", "socket", "term", "time",
"ucontext", "uio", "users", "zerocopy",
"ucontext", "uio", "user", "zerocopy",
]

acct = []
aio = []
aio = ["pin-utils"]
dir = ["fs"]
env = []
event = []
features = []
feature = []
fs = []
hostname = []
inotify = []
Expand All @@ -73,22 +77,22 @@ term = []
time = []
ucontext = ["signal"]
uio = []
users = ["features"]
user = ["feature"]
zerocopy = ["fs", "uio"]

[dev-dependencies]
assert-impl = "0.1"
lazy_static = "1.2"
lazy_static = "1.4"
parking_lot = "0.11.2"
rand = "0.8"
tempfile = "3.2.0"
semver = "1.0.0"
tempfile = "3.3.0"
semver = "1.0.7"

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

[target.'cfg(target_os = "freebsd")'.dev-dependencies]
sysctl = "0.1"
sysctl = "0.4"

[[test]]
name = "test"
Expand All @@ -102,10 +106,6 @@ path = "test/sys/test_aio_drop.rs"
name = "test-clearenv"
path = "test/test_clearenv.rs"

[[test]]
name = "test-lio-listio-resubmit"
path = "test/sys/test_lio_listio_resubmit.rs"

[[test]]
name = "test-mount"
path = "test/test_mount.rs"
Expand Down
Loading

0 comments on commit 280d505

Please sign in to comment.