Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise MSRV to 1.69.0 #2144

Merged
merged 3 commits into from
Oct 2, 2023
Merged

Raise MSRV to 1.69.0 #2144

merged 3 commits into from
Oct 2, 2023

Conversation

asomers
Copy link
Member

@asomers asomers commented Oct 1, 2023

This allows us to use the very useful CStr::from_bytes_until_nul

src/mount/bsd.rs Outdated Show resolved Hide resolved
src/sys/prctl.rs Outdated Show resolved Hide resolved
let nul = buf.iter().position(|c| *c == b'\0').unwrap();
buf.truncate(nul);
Ok(OsString::from_vec(buf).into())
CStr::from_bytes_until_nul(&buf[..])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The [..] in &buf[..] seems to be unnecessary here

@SteveLauC
Copy link
Member

SteveLauC commented Oct 2, 2023

The MSRV in README.md needs to be updated as well:

nix is supported on Rust 1.65 and higher. Its MSRV will not be changed in the future without bumping the major or minor version.

BTW, it seems that the version of the next release would be 0.28.0 since we bumped our MSRV in it

@asomers
Copy link
Member Author

asomers commented Oct 2, 2023

BTW, it seems that the version of the next release would be 0.28.0 since we bumped our MSRV in it

We would have to do that anyway, since we've changed the signatures of several functions to add I/O safety.

@SteveLauC
Copy link
Member

The CI failure of Fuchsia x86_64:

rustup target add $TARGET
error: toolchain '1.69.0-x86_64-unknown-linux-gnu' does not contain component 'rust-std' for target 'x86_64-fuchsia'
note: not all platforms have the standard library pre-compiled: https://doc.rust-lang.org/nightly/rustc/platform-support.html

seems to be because that the alias x86_64-fuchsia for x86_64-unknown-fuchsia has been removed?

Platform support: tier2

$ rustup target list | grep -i fuchsia
aarch64-unknown-fuchsia
x86_64-unknown-fuchsia (installed)

$ rustup target add x86_64-fuchsia
error: toolchain '1.69.0-x86_64-unknown-linux-gnu' does not contain component 'rust-std' for target 'x86_64-fuchsia'
note: not all platforms have the standard library pre-compiled: https://doc.rust-lang.org/nightly/rustc/platform-support.html

$ rustup target add x86_64-unknown-fuchsia
info: component 'rust-std' for target 'x86_64-unknown-fuchsia' is up to date

@SteveLauC
Copy link
Member

To fix the CI failure in Redox x86_64, importing std::ffi::OsStr for all the platforms:

    Checking nix v0.27.1 (/tmp/cirrus-ci-build)
error[E0433]: failed to resolve: use of undeclared type `OsStr`
    --> src/unistd.rs:3932:18
     |
3932 |         .map(|s| OsStr::from_bytes(s.to_bytes()).into())
     |                  ^^^^^ use of undeclared type `OsStr`
     |
help: consider importing one of these items
     |
3    + use crate::OsStr;
     |
3    + use std::ffi::OsStr;
     |
// old one
use std::ffi::{CStr, OsString};
#[cfg(not(target_os = "redox"))]
use std::ffi::{CString, OsStr};
// new one, the CI failure should be resolved by this
use std::ffi::{CStr, OsStr, OsString};
#[cfg(not(target_os = "redox"))]
use std::ffi::CString;

This allows us to use the very useful CStr::from_bytes_until_nul
x86_64-fuchsia -> x86_64-unknown-fuchsia
@SteveLauC SteveLauC added this pull request to the merge queue Oct 2, 2023
Merged via the queue into nix-rust:master with commit 2f4861f Oct 2, 2023
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants