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

1.0 release planning #753

Open
5 of 28 tasks
sunfishcode opened this issue Jul 19, 2023 · 17 comments
Open
5 of 28 tasks

1.0 release planning #753

sunfishcode opened this issue Jul 19, 2023 · 17 comments
Labels
semver bump Issues that will require a semver-incompatible fix

Comments

@sunfishcode
Copy link
Member

sunfishcode commented Jul 19, 2023

Here's a planning issue for a 1.0 release, similar to the one for the 0.38 release. Hopefully we won't need a semver bump for a good long while, but when we do, here's the list of changes we can make:

  • Remove the deprecated mount functions in the fs module (details)
  • Make the underlying type of rustix::fs::Access consistent between linux_raw and libc backends
  • Rename mount_recursive_bind to mount_bind_recursive? Factor out a new top-level mount module. #763 (comment)
  • Change SeekFrom::Hole and SeekFrom::Data's field from i64 to u64.
  • rename Shutdown::ReadWrite to Shutdown::Both to align with std
  • remove the features = ["extra_traits"] from the libc dependency (Remove the "libc-extra-traits" feature. #1168)
  • move (or perhaps alias?) sched_yield from process to thread, since it yields the current thread
  • rustix::process::waitpid has no way to wait for specific process groups (Pid now requires non-negative values). waitpgid has been added as a temporary workaround.
  • Replace rustix::cstr! with something like rustix::nativestr! so that users don't hard code "native strings are C strings" in their code?
  • set_ip_add_membership/get_ip_add_membership should take address and ifindex arguments and *_with_ifindex should be removed.
  • stx_mtime and similar members of Statx should be i64, because Unix timestamps can be negative.
  • futex's first argument should be Atomic
  • Split open and openat into separate functions for "create" which needs a mode vs. "open existing" which doesn't need a mode?
  • Remove get_ from sockopt getters, following Rust convention. Consider removing get_ in other things too.
  • The udata argument to rustix::event::kqueue::Event::new should be a pointer instead of an isize in order to better preserve provenance.
  • The stx_attributes_mask field of Statx with flags like libc::STATX_ATTR_MOUNT_ROOT should ideally be a bitflags, which requires making Statx a custom type (which should match layout with libc::statx).
  • Move Dir into its own crate, and have rustix export getdents directly?
  • Rename get_* functions (eg. sockopts) to remove the get_ prefix, which is more idiomatic Rust?
  • Rename MountPropagationFlags::SLAVE (Rename a flag in MountPropagationFlags. #1169)
  • Rename ClockId::Uptime on FreeBSD to Boottime, since it's an alias
  • Rename some of WaitidOptions, WaitidStatus, and/or WaitId to make the capitalization of Id consistent
  • move rustix::thread sleep functions into a new rustix::sleep module, because they're usable from single-threaded programs too
  • Make RecvAncillaryBuffer::drain always remove all messages, even if the iterator isn't exhausted. With that, we can remove the read_and_length in AncillaryDrain.
  • Remove the inotify_ prefixes from things in the fs::inotify module.
  • Remove the shm_ and Shm prefixes from things in the shm module.
  • Figure out a way to do a recv into an uninitialized buffer with the TRUNC flag set (see Fix recv_uninit to handle the TRUNC flag. #1159)
  • remove rustix::procfs and publish rustix-linux-procfs as the replacement
  • remove linux-raw-sys and libc from the public API (Port 1.0-staging to main #1152)
@notgull

This comment was marked as resolved.

@sunfishcode sunfishcode added the semver bump Issues that will require a semver-incompatible fix label Sep 29, 2023
@sunfishcode

This comment was marked as resolved.

@sunfishcode sunfishcode changed the title 0.39 release planning 1.0 release planning Oct 22, 2023
@sunfishcode

This comment was marked as resolved.

@notgull
Copy link
Contributor

notgull commented Oct 22, 2023

If this is going to be a stable release, we should make sure that libc and linux-raw-sys aren't exposed in the public API. I know there are still a few places where it is.

In my opinion a stable release is a bad idea, as the API is still somewhat volatile. There should at least be an "unstable" feature flag to test new APIs for inclusion, like Tokio has.

@sunfishcode
Copy link
Member Author

I already consider 0.38 to be stable. For example, I maintain an older version of linux-raw-sys to preserve compatibility with rustix 0.38. And I'm not aware of any significant volatility in the 0.38 API. It's added lots of features, and even deprecated a handful of things, but ideas for breaking changes are collected here in this issue, specifically to keep 0.38 stable.

So my idea for 1.0 is just to better communicate what's already happening.

It would be nice to better encapsulate libc/linux-raw-sys types, and I'm open to adding an "unstable" feature flag if there's a need for it. I'm under the impression that these aren't urgent right now, though I'd be happy to learn more about how these impact users.

@SUPERCILEX

This comment was marked as resolved.

@morr0ne

This comment was marked as resolved.

@sunfishcode

This comment was marked as resolved.

@SUPERCILEX
Copy link
Contributor

I'd like to propose making the timeout param in https://docs.rs/rustix/latest/rustix/event/fn.poll.html be an Option<u32> where None passes -1 to act as an infinite timeout. That feels like a clearer interface than anything negative is infinity.

@SUPERCILEX

This comment was marked as resolved.

@sunfishcode

This comment was marked as resolved.

@SUPERCILEX
Copy link
Contributor

SUPERCILEX commented Aug 15, 2024

Fair enough.


From #1105 (comment), let's add to the todo list that we need to fix the occurrences of cargo clippy --workspace --all-targets --features all-apis -- -Aclippy::all -Dclippy::impl_trait_in_params (and use-libc).

@SUPERCILEX
Copy link
Contributor

From #1110 (comment):
epoll appears to be inconsistent in that it expects users to use the module prefix (i.e. epoll::foo) instead of using the free function directly. This is neat, but it's inconsistent with the rest of rustix's APIs: inotify, port, eventfd, io_uring, mount, shm, and probably others I didn't have time to look at. @sunfishcode thoughts on a PR that restores the epoll_ prefix with some deprecations? We could go the other direction, but that interacts poorly with auto-complete and would be much more breaking so not worth it IMO.

Sidenote: the deprecations won't actually work due to rust-lang/rust#30827. (For example the fs::*mount APIs are deprecated but there's no warning about it.)

@sunfishcode
Copy link
Member Author

I've now created the 0.38 branch and have started doing 0.38.x releases from it, so the main branch can now start accepting semver-incompatible fixes. First up is porting the 1.0-staging patches.

@raftario
Copy link

Is there anything you could use outside help with as part of the effort towards a 1.0 release ?

@sunfishcode
Copy link
Member Author

@raftario Anyone's welcome to work on any of the items from the checklist at the top here that isn't checked and doesn't have a PR next to it. Some of them are involved, but some are just simple renames.

@sunfishcode
Copy link
Member Author

Also, anything with a question mark is known to need further thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver bump Issues that will require a semver-incompatible fix
Projects
None yet
Development

No branches or pull requests

5 participants