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
21 tasks done
sunfishcode opened this issue Jul 19, 2023 · 23 comments
Open
21 tasks done

1.0 release planning #753

sunfishcode opened this issue Jul 19, 2023 · 23 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:

Deferring for now:

  • move rustix::thread sleep functions into a new rustix::sleep module, because they're usable from single-threaded programs too
  • Move Dir into its own crate, and have rustix export getdents directly?
  • Split open and openat into separate functions for "create" which needs a mode vs. "open existing" which doesn't need a mode?
  • 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.
  • Replace rustix::cstr! with something like rustix::nativestr! so that users don't hard code "native strings are C strings" in their code?
  • rename Arg::as_str to avoid "a method with this name may be added to the standard library in the future" warnings
  • 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.
  • remove libc from the public API (Port 1.0-staging to main #1152) (Remove most linux-raw-sys types from the public API #1277)

Don't do these:

  • set_ip_add_membership/get_ip_add_membership should take address and ifindex arguments and *_with_ifindex should be removed.
  • Rename ClockId::Uptime on FreeBSD to Boottime, since it's an alias
@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

This comment has been minimized.

@SUPERCILEX

This comment was marked as resolved.

@sunfishcode

This comment was marked as resolved.

@SUPERCILEX

This comment has been minimized.

@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

This comment has been minimized.

@raftario

This comment has been minimized.

@sunfishcode

This comment has been minimized.

@sunfishcode

This comment has been minimized.

@sunfishcode

This comment has been minimized.

@SUPERCILEX
Copy link
Contributor

I haven't yet made this change. I do like how it makes the interface clearer, but I'm unsure about the range check it introduces.

By this do you mean that we're limiting possible inputs the caller can supply (namely no negative numbers). I feel like that's reasonable as we probably want a different API if negative numbers start meaning something else.


I'd really like to see the story around MaybeUninit buffers resolved for 1.0 (or a clear expectation that there will be a 2.0 addressing the issue). I'm still on team dependent types (as in the input to the function determines the return type), but I'm not sure how we should hash this out.

@sunfishcode

This comment has been minimized.

@SUPERCILEX
Copy link
Contributor

we should just go all the way to Option and use ppoll

If we can, that sounds even better!


Yup, mostly #1110 as I think it could have ripple effects (e.g. getting rid of io::read_uninit).

sunfishcode added a commit that referenced this issue Jan 25, 2025
As discussed [here], use generic parameters instead of impl trait
argumentst.

[here]: #753 (comment)
@sunfishcode
Copy link
Member Author

we should just go all the way to Option and use ppoll

If we can, that sounds even better!

I've now filed #1285 to do that.

Yup, mostly #1110 as I think it could have ripple effects (e.g. getting rid of io::read_uninit).

I've now filed #1290 starting to prototype something.

@sunfishcode
Copy link
Member Author

I've now published rustix 1.0.0-prerelease.0. For anyone following this issue, please test it out and report any findings!

I've documented all the API changes I'm aware of here; please let me know if anything there is unclear or if there's something not covered.

A potential change that hasn't landed yet is #1290. It's mostly a backwards-compatible change, however it is technically an API break because in some cases it requires users add a &mut *. If that change lands, I'll plan to do another prerelease before the final release.

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