rfcs
rfcs copied to clipboard
Add text for the CFG OS Version RFC
This RFC is largely the work of @rylev. I've worked with him to update some of the language and then added some additional context from Android.
This is my first RFC PR so I apologize for any mistakes and look forward to working on this proposal with the community.
I'm going to propose to postpone this RFC. I think we all agree that this would be a great thing to have, but I think there are some big questions, particularly around how version support of pre-built std works, how it might tie into supporting target requirements, how the version information is determined, etc. Primarily, there isn't anyone on the team who has the capacity at this time to champion this feature.
@rfcbot fcp postpone
Team member @ehuss has proposed to postpone this. The next step is review by the rest of the tagged team members:
- [x] @Eh2406
- [ ] @Muscraft
- [ ] @arlosi
- [x] @ehuss
- [x] @epage
- [ ] @joshtriplett
- [ ] @nikomatsakis
- [ ] @pnkfelix
- [ ] @scottmcm
- [ ] @tmandry
- [x] @weihanglo
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. See this document for info about what commands tagged team members can give me.
As an alternative to a full postpone, I think it would be good to start by downscoping this RFC (or making a successor?) implementing something like the proposed os_version_min CFG inside of just the compiler/standard library. This avoids all the questions around Cargo support, the pre-built standard library (Rust defines minimum supported OS versions, this macro would just be used internally for clarity as opposed to the excessive dlsym-ing today), etc.
This is a very needed feature and Rust lags behind Objective-C, Swift, and Kotlin around of providing a good migration path for users wanting to port platform and OS-version specific code to Rust. Apple and Android's platform features are built around the assumption this is available in the language of choice.
I remember pushing for this change all the way back in 2020, helping with some of the initial design way back then.
Please strongly consider adjusting priorities so that someone can have the capacity to take this on. This feature isn't some nice to have that can be postponed indefinitely but rather an essential aspect of being able to write code that can take advantage of new OS versions in a sane way.
I like the suggestion by @BlackHoleFox that the best way to move forward is to downscope the RFC to just the lang parts. @chriswailes do you think that it would be possible, and still valuable, to start by nailing those down?