diff --git a/.cirrus.yml b/.cirrus.yml index 1c2e9a6a83..c41293bb82 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -17,6 +17,7 @@ task: - fetch https://sh.rustup.rs -o rustup.sh - sh rustup.sh -y --profile=minimal --default-toolchain 1.41.0 - $HOME/.cargo/bin/rustup target add i686-unknown-freebsd + - cp Cargo.lock.msrv Cargo.lock amd64_test_script: - . $HOME/.cargo/env - cargo test @@ -49,6 +50,7 @@ task: - sh rustup.sh -y --profile=minimal --default-toolchain 1.41.0 - . $HOME/.cargo/env - bash ci/install.sh + - cp Cargo.lock.msrv Cargo.lock script: - . $HOME/.cargo/env - bash ci/script.sh @@ -104,6 +106,7 @@ task: - sh rustup.sh -y --profile=minimal --default-toolchain 1.41.0 - . $HOME/.cargo/env - bash ci/install.sh + - cp Cargo.lock.msrv Cargo.lock script: - . $HOME/.cargo/env || true - bash ci/script.sh @@ -112,10 +115,6 @@ task: # Tasks for Linux amd64 builds task: matrix: - - name: Rust Stable - env: - TARGET: x86_64-unknown-linux-gnu - TOOLCHAIN: stable - name: Linux x86_64 env: TARGET: x86_64-unknown-linux-gnu @@ -126,6 +125,24 @@ task: TOOLCHAIN: 1.41.0 container: image: rust:1.41 + setup_script: + - rustup toolchain install $TOOLCHAIN + - rustup target add --toolchain $TOOLCHAIN $TARGET + - cp Cargo.lock.msrv Cargo.lock + script: + - cargo +$TOOLCHAIN build --target $TARGET --all-targets + - cargo +$TOOLCHAIN build --target $TARGET --all-targets --release + - cargo +$TOOLCHAIN test --target $TARGET + - cargo +$TOOLCHAIN test --target $TARGET --release + before_cache_script: rm -rf $CARGO_HOME/registry/index + +task: + name: Rust Stable + container: + image: rust:latest + env: + TARGET: x86_64-unknown-linux-gnu + TOOLCHAIN: stable setup_script: - rustup toolchain install $TOOLCHAIN - rustup target add --toolchain $TOOLCHAIN $TARGET @@ -176,6 +193,7 @@ task: image: rust:1.41 setup_script: - rustup target add $TARGET + - cp Cargo.lock.msrv Cargo.lock script: - cargo +$TOOLCHAIN check --target $TARGET - cargo +$TOOLCHAIN check --target $TARGET --release @@ -205,9 +223,9 @@ task: env: TARGET: x86_64-unknown-redox # Redox requires a nightly compiler. - # If stuff breaks, change nightly to the date in the toolchain_* - # directory at https://static.redox-os.org - TOOLCHAIN: nightly-2020-08-04 + # If stuff breaks, change nightly to the date at + # https://gitlab.redox-os.org/redox-os/redox/-/blob/master/rust-toolchain + TOOLCHAIN: nightly-2021-06-15 container: image: rustlang/rust:nightly setup_script: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8130d61003..c3506c04c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). +## [0.22.3] - 22 January 2022 +### Changed + +- Relaxed the bitflags requirement from 1.3.1 to 1.1. This partially reverts + #1492. From now on, the MSRV is not guaranteed to work with all versions of + all dependencies, just with some version of all dependencies. + (#[1607](https://github.com/nix-rust/nix/pull/1607)) + ## [0.22.2] - 28 September 2021 ### Added ### Changed diff --git a/Cargo.lock.msrv b/Cargo.lock.msrv new file mode 100644 index 0000000000..6ded195e98 --- /dev/null +++ b/Cargo.lock.msrv @@ -0,0 +1,318 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +# This file was generated by running the following command: +# `cargo +nightly generate-lockfile -Zminimal-versions` +# We use it on CI to test non-latest-stable Rust versions. +[[package]] +name = "assert-impl" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3464313de0c867016e3e69d7e1e9ae3499bcc4c18e12283d381359ed38b5b9e" + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "caps" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61bf7211aad104ce2769ec05efcdfabf85ee84ac92461d142f22cf8badd0e54c" +dependencies = [ + "errno", + "libc", + "thiserror", +] + +[[package]] +name = "cc" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + +[[package]] +name = "getrandom" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.113" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eef78b64d87775463c549fbd80e19249ef436ea3bf1de2a1eb7e717ec7fab1e9" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "nix" +version = "0.22.3" +dependencies = [ + "assert-impl", + "bitflags", + "caps", + "cc", + "cfg-if", + "lazy_static", + "libc", + "memoffset", + "rand", + "semver", + "sysctl", + "tempfile", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "proc-macro2" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", + "rand_hc", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +dependencies = [ + "rand_core", +] + +[[package]] +name = "redox_syscall" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +dependencies = [ + "bitflags", +] + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "semver" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" + +[[package]] +name = "syn" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "sysctl" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcf77d15d9b9261f4d32c0b4e3cf09050ee6aabb20cf21cb99dfe69c9a49d83" +dependencies = [ + "byteorder", + "errno", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "thiserror" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/Cargo.toml b/Cargo.toml index 9ad9233a8f..12c681c7ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "nix" description = "Rust friendly bindings to *nix APIs" edition = "2018" -version = "0.22.3-alpha.0" +version = "0.22.3" authors = ["The nix-rust Project Developers"] repository = "https://github.com/nix-rust/nix" license = "MIT" @@ -33,7 +33,7 @@ targets = [ [dependencies] libc = { version = "0.2.99", features = [ "extra_traits" ] } -bitflags = ">= 1.1.0, < 1.3.0" +bitflags = "1.1" cfg-if = "1.0" [target.'cfg(not(target_os = "redox"))'.dependencies] diff --git a/README.md b/README.md index a16820b95f..13617900df 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ To use `nix`, add this to your `Cargo.toml`: ```toml [dependencies] -nix = "0.22.2" +nix = "0.22.3" ``` ## Contributing diff --git a/src/mount/bsd.rs b/src/mount/bsd.rs index 0144908157..cd08584e89 100644 --- a/src/mount/bsd.rs +++ b/src/mount/bsd.rs @@ -396,7 +396,7 @@ impl<'a> Drop for Nmount<'a> { // Free the owned string. Safe because we recorded ownership, // and Nmount does not implement Clone. unsafe { - CString::from_raw(iov.0.iov_base as *mut c_char); + drop(CString::from_raw(iov.0.iov_base as *mut c_char)); } } }